:root {
    --bg-page: #e6e8eb; /* The gray outside the app window */
    --bg-window: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-light: #f3f4f6;
    
    --blue-primary: #1d4ed8; /* Matching the deep blue Join Now / Buttons */
    --cyan-primary: #06b6d4; /* Matching the cyan donate button */
    
    --shadow-window: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.theme-dark {
    --bg-page: #0f172a;
    --bg-window: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-light: #334155;
    --blue-primary: #3b82f6;
    --cyan-primary: #22d3ee;
}
.theme-dark .comic-card, .theme-dark .video-archive-card, .theme-dark .donate-card { background: #1e293b; }
.theme-dark .search-bar { background: #334155; border-color: #475569; }
.theme-dark .comic-page-canvas { background: #0f172a; }
.theme-dark .search-bar input { color: #f8fafc; }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }

body { background-color: var(--bg-page); color: var(--text-main); min-height: 100vh; padding: 2rem; display: flex; justify-content: center; }
a { text-decoration: none; color: inherit; }

/* Wrapper - matches the mockup's physical browser frame */
.app-window {
    background: var(--bg-window);
    width: 100%; max-width: 1300px;
    border-radius: 12px;
    box-shadow: var(--shadow-window);
    overflow: hidden;
    display: flex; flex-direction: column;
}

/* Header */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border-light);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 36px; height: 36px; border-radius: 50%; }
.logo-text { font-size: 1.1rem; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }

.app-nav { display: flex; gap: 2rem; font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.app-nav a:hover, .app-nav a.active { color: var(--blue-primary); }

.header-actions { display: flex; align-items: center; gap: 1rem; }
.search-bar { 
    display: flex; align-items: center; gap: 8px; 
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 12px; 
}
.search-bar svg { color: var(--text-muted); }
.search-bar input { border: none; background: transparent; outline: none; font-size: 0.9rem; width: 150px; }
.btn-primary { 
    background: var(--blue-primary); color: white; padding: 8px 16px; 
    border-radius: 6px; font-weight: 600; font-size: 0.9rem; transition: 0.2s;
}
.btn-primary:hover { opacity: 0.9; }

/* Dashboard 2-Column Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 3rem;
    padding: 3rem 2.5rem;
}

/* LEFT COLUMN */
.page-title { font-size: 2.5rem; font-weight: 900; letter-spacing: -1px; text-transform: uppercase; margin-bottom: 0.5rem; }
.page-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; }

.comic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.comic-card {
    border: 1px solid var(--border-light); border-radius: 12px; padding: 0.75rem; 
    transition: 0.2s; background: #ffffff;
}
.comic-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }

.comic-cover { 
    border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; background: #0f172a; 
    display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.cover-placeholder { color: white; font-weight: 800; font-size: 1rem; text-align: center; }

.comic-card-title { font-size: 0.95rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.2rem; }
.comic-creator { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.star-rating { color: #fbbf24; font-size: 0.8rem; letter-spacing: 2px; margin-bottom: 0.75rem; }

.btn-read {
    display: block; width: 100%; text-align: center;
    background: #06b6d4; color: white; border-radius: 4px; padding: 6px 0;
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
}
.btn-read:hover { background: #0891b2; }

/* RIGHT COLUMN - SIDEBAR */
.sidebar-title { 
    font-size: 1.1rem; font-weight: 800; text-transform: uppercase; 
    margin-bottom: 1.5rem; letter-spacing: -0.5px;
}

.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.video-card { display: flex; flex-direction: column; gap: 0.5rem; }
.video-card.full-width { grid-column: 1 / -1; }

.video-thumbnail {
    background: #1e293b; border-radius: 8px; height: 100px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.video-card.full-width .video-thumbnail { height: 140px; }
.play-btn { 
    background: rgba(255,255,255,0.2); backdrop-filter: blur(4px);
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.8rem; padding-left: 2px;
}
.video-duration { 
    position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.7); 
    color: white; font-size: 0.7rem; font-weight: 600; padding: 2px 4px; border-radius: 4px;
}
.video-details h4 { font-size: 0.9rem; font-weight: 800; margin-bottom: 0.2rem; line-height: 1.2; }
.video-details p { font-size: 0.75rem; color: var(--text-muted); }

.view-all-link { display: block; font-size: 0.8rem; font-weight: 800; color: var(--blue-primary); margin-bottom: 3rem; text-transform: uppercase; }

/* Donate Grid */
.donate-grid { display: flex; gap: 1rem; flex-wrap: wrap; }
.donate-card {
    flex: 1; min-width: 200px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #334155;
    border-radius: 16px; 
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    display: flex; flex-direction: column;
    color: #f8fafc;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}
.donate-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 100%;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.15), transparent 70%);
    pointer-events: none;
}
.donate-card:last-child::before {
    background: radial-gradient(circle at top right, rgba(247, 147, 26, 0.15), transparent 70%);
}
.donate-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: #475569;
}
.donate-header { display: flex; align-items: center; gap: 15px; margin-bottom: 1.25rem; z-index: 1; }
.donate-icon { 
    width: 38px; height: 38px; border-radius: 50%; background: #06b6d4; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.3rem;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}
.donate-header-text { z-index: 1; }
.donate-header-text h4 { font-size: 1.1rem; font-weight: 900; line-height: 1.1; letter-spacing: 0.05em; color: #fff; }
.donate-header-text span { font-size: 0.8rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; }

.donate-graphic { 
    height: 100px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.hand-icon { font-size: 3rem; color: #60a5fa; }

.input-row { display: flex; justify-content: space-between; border-bottom: 1px solid #e5e7eb; padding: 8px 0; margin-bottom: 0.5rem; }
.input-val { font-size: 0.9rem; font-weight: 600; }
.input-currency { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.donate-conversion { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; font-weight: 500; }

.btn-donate {
    border: none; border-radius: 8px; padding: 12px 0; font-weight: 800; font-size: 0.95rem; cursor: pointer; color: white; display: block; width: 100%; transition: all 0.2s; z-index: 1;
}
.cyan-btn { background: #06b6d4; }
.cyan-btn:hover { background: #0891b2; }
.blue-btn { background: var(--blue-primary); }
.blue-btn:hover { background: #1e3a8a; }

.donate-stats { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.positive { color: #10b981; }

.app-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 2.5rem; border-top: 1px solid var(--border-light);
    font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
}
.footer-left a { margin-left: 10px; }
.footer-socials { display: flex; gap: 15px; font-weight: 800; color: var(--text-main); font-size: 1rem;}

/* Responsive Fallbacks */
@media (max-width: 1024px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .donate-grid { flex-direction: column; }
    .comic-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .comic-grid { grid-template-columns: repeat(2, 1fr); }
    .app-header { flex-direction: column; gap: 1rem; }
}
