/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c7a7b;
    --secondary-color: #38b2ac;
    --accent-color: #4fd1c7;
    --dark-color: #1a202c;
    --light-color: #f7fafc;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Theme override: SNPCC (Marron / Crème) */
body.theme-snpcc {
    --primary-color: #6b3f2a;   /* marron */
    --secondary-color: #a77953; /* marron clair */
    --accent-color: #e7d6be;    /* crème */
    --dark-color: #2a1b12;
    --light-color: #fbf5ea;     /* crème */
    --text-color: #2a1b12;
    --text-light: #7a5b45;
    --border-color: #eadfce;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: white;
    padding: 8px;
    border-radius: var(--border-radius);
}

/* SNPCC logo image */
body.theme-snpcc .logo.logo-snpcc {
    width: 150px;
    height: auto;
    max-height: 64px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Text logo (used by SNPCC page) */
.text-logo {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    font-weight: 900;
    letter-spacing: 0.14em;
    color: var(--light-color);
    background: linear-gradient(135deg, rgba(107, 63, 42, 0.95), rgba(42, 27, 18, 0.95));
    border: 1px solid rgba(231, 214, 190, 0.45);
    box-shadow: 0 12px 22px rgba(42, 27, 18, 0.28);
    text-transform: uppercase;
    user-select: none;
}

.text-logo-3 {
    font-size: 1.05rem;
}

.text-logo-footer {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.no-files {
    color: var(--text-light);
    font-weight: 500;
}

.brand-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.brand-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.brand-info--tagline p {
    font-size: 0.85rem;
    line-height: 1.25;
    font-weight: 500;
    opacity: 0.95;
    max-width: 520px;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Burger button (hidden by default, shown on mobile) */
.burger-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.burger-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* SNPCC quick square links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 260px));
    justify-content: center;
    gap: 1.25rem;
    margin-top: 2rem;
}

.quick-link {
    aspect-ratio: 1 / 1;
    border-radius: calc(var(--border-radius) + 6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    transition: var(--transition);
}

.quick-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.16);
}

.quick-link:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.65);
    outline-offset: 4px;
}

.quick-link-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.quick-link-icon i {
    font-size: 2rem;
}

.quick-link-label {
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: center;
}

.hero-apk-date {
    margin-top: 0.5rem;
}

.hero-publish-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    opacity: 0.95;
}

.hero-publish-date i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat span {
    font-weight: 500;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section:nth-child(even) {
    background-color: white;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.section-title i {
    color: var(--secondary-color);
}

/* File Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.file-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.file-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.file-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    margin-top: 2px;
    font-size: 1.5rem;
    color: white;
}

.file-icon.pdf {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.file-icon.zip {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.file-icon.video {
    background: linear-gradient(135deg, #ed8936, #f6ad55);
}

.file-icon.apk {
    background: linear-gradient(135deg, #3DDC84, #00A86B);
}

.file-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.file-type {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 500;
}

.file-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    flex-grow: 1;
}

.file-meta-info {
    margin-bottom: 1rem;
}

.publish-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.publish-date i {
    font-size: 0.75rem;
    opacity: 0.8;
}

.file-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 122, 123, 0.3);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-1px);
}

.btn-apk {
    background: linear-gradient(135deg, #ffffff, #edf2f7);
    color: #2c7a7b;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.25);
    border: 1px solid rgba(44, 122, 123, 0.3);
}

.btn-apk:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    box-shadow: 0 6px 18px rgba(148, 163, 184, 0.3);
}

/* Files List */
.files-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: var(--light-color);
}

.file-item .file-icon {
    margin-right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.file-details {
    flex: 1;
}

.file-details h5 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.file-size {
    margin-left: auto;
    margin-right: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: white;
    padding: 4px;
    border-radius: 4px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    /* Hide the top nav on mobile; burger will control side drawer */
    .nav { display: none; }

    /* Keep header layout row to place burger on the right */
    .header-content { flex-direction: row; }
    .logo-section { flex: 1; }
    .burger-btn { display: inline-flex; }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .quick-links {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        width: 100%;
    }
    
    .file-card {
        max-width: 100%;
    }
    
    .file-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .file-size {
        margin-left: 0;
        order: 3;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .brand-info h1 {
        font-size: 1.25rem;
        margin-bottom: 0.2rem;
    }
    
    .brand-info p {
        font-size: 0.8rem;
    }
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .file-actions {
        flex-direction: column;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .file-card {
        padding: 1rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
} 

/* Drawer and overlay */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 99; /* below header (100) but above content */
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    /* Use dynamic viewport on mobile to prevent bottom overflow when URL bar collapses */
    height: 100dvh;
    width: 80%;
    max-width: 320px;
    background: white;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: var(--transition);
    z-index: 101; /* above header */
    display: flex;
    flex-direction: column;
}

.side-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.drawer-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
}

.drawer-links-container {
    display: flex;
    flex-direction: column;
    /* Let content scroll if it exceeds viewport height */
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    padding: 1rem 1.25rem 1.5rem 1.25rem;
    /* Respect iOS safe area to keep bottom button tappable */
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.side-drawer .btn.btn-apk {
    /* Keep the button visible and tappable at the bottom */
    position: sticky;
    bottom: 0;
    width: 100%;
    justify-content: center;
    margin-top: auto;
    box-shadow: var(--shadow-lg);
}

.drawer-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem 0.5rem;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.drawer-link:hover {
    background: var(--light-color);
}

/* Ensure drawer is only relevant on small screens */
@media (min-width: 769px) {
    .drawer-overlay { display: none !important; }
    .side-drawer { display: none !important; }
    .burger-btn { display: none !important; }
}