/* ==========================================================================
   1. FONT IMPORT & THEME ENGINE
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Match your logo colors here */
    --primary-color: #0f172a; 
    --accent-color: #2563eb;  
    
    /* Backgrounds & Surfaces */
    --bg-color: #f8fafc;      
    --surface-color: #ffffff; 
    --border-color: #e2e8f0;
    
    /* Typography Upgrade */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Animation Speeds */
    --transition-fast: 0.2s ease-in-out;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Premium Diffused Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 12px 32px rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   2. CSS RESET & BASE RULES (Flexbox Sticky Footer)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    
    /* Professional Subtle Dot Pattern */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==========================================================================
   3. GLOBAL HEADER & NAVIGATION (Mobile Optimized)
   ========================================================================== */
/* ==========================================================================
   3. GLOBAL HEADER & NAVIGATION (Ultra-Compact Mobile First)
   ========================================================================== */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    padding: 0.5rem 1rem; /* RAZOR THIN PADDING */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem; /* Extremely tight gap */
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-logo {
    height: 24px; /* SHRUNK: Tiny mobile logo */
    width: auto;
    object-fit: contain;
}

.brand h1 {
    font-size: 1.05rem; /* SHRUNK: Smaller title */
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.8rem; /* Tighter navigation links */
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem; /* SHRUNK: Minimal text size */
    transition: color var(--transition-fast);
}

.main-nav a:hover {
    color: var(--accent-color);
}

.btn-telegram {
    background: linear-gradient(135deg, #0088cc, var(--accent-color));
    color: white !important;
    padding: 0.3rem 0.8rem; /* SHRUNK: Slimmer button */
    font-size: 0.75rem; /* SHRUNK: Micro button text */
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-telegram:active {
    transform: translateY(0); /* Button press effect */
}

/* ==========================================================================
   4. QUOTE OF THE DAY
   ========================================================================== */
.quote-section {
    padding: 2.5rem 1rem 0 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.glass-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,1);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.quote-text {
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 500;
    color: #334155;
    transition: opacity 0.5s ease;
}

/* ==========================================================================
   5. MAIN CONTENT LAYOUT
   ========================================================================== */
/* ==========================================================================
   5. MAIN CONTENT LAYOUT (Compact Mobile First)
   ========================================================================== */
.about-section {
    position: relative; 
    text-align: center;
    margin-bottom: 2rem; /* REDUCED: Brings the Vault closer to the top */
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    padding: 1.25rem 1rem; /* REDUCED: Much tighter box for phones */
    border-radius: 12px; /* Sharper corners for a smaller box */
    box-shadow: var(--shadow-sm); 
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    overflow: hidden; 
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px; /* REDUCED: Smaller glow for a smaller screen */
    height: 150px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    pointer-events: none; 
}

.about-section h2 {
    position: relative;
    margin-bottom: 0.5rem; /* Tighter gap below the title */
    font-size: 1.35rem; /* REDUCED: Professional but not overpowering on phone */
    font-weight: 800; 
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-section p {
    position: relative;
    color: #475569;
    font-size: 0.9rem; /* REDUCED: Standard mobile reading size */
    max-width: 100%; 
    margin: 0 auto;
    line-height: 1.5; /* Tighter line spacing */
}
/* ==========================================================================
   6. VAULT & FILTERS
   ========================================================================== */
.vault-header {
    margin-bottom: 2rem;
}

.vault-header h2 {
    font-size: 1.75rem;
    letter-spacing: -0.5px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

#search-input, #session-filter {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--surface-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    color: var(--primary-color);
}

#search-input {
    padding-left: 2.8rem; 
}

/* Custom Dropdown Arrow Fix */
#session-filter {
    appearance: none; 
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2rem;
    padding-right: 3rem; /* Extra space so text doesn't hit the arrow */
    cursor: pointer;
}

#search-input:focus, #session-filter:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   7. THE DATA TABLE (Mobile-First Card Layout)
   ========================================================================== */
.table-container {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow-x: visible; /* Prevents swiping */
}

/* Transform Table into Cards for Mobile */
.resource-table, .resource-table tbody, .resource-table tr, .resource-table td {
    display: block;
    width: 100%;
}

.resource-table thead {
    display: none; /* Hide headers on mobile */
}

.resource-table tr {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeIn 0.4s ease-out forwards;
}

.resource-table tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.resource-table td {
    padding: 0;
    border: none;
    margin-bottom: 0.75rem;
    color: #334155;
    font-weight: 500;
}

.resource-table td:last-child {
    margin-bottom: 0;
    margin-top: 1.25rem; /* Push the button down slightly */
}

.resource-link-btn {
    display: inline-flex;
    justify-content: center; /* Center text on mobile */
    width: 100%; /* Full width button on mobile */
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem;
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--accent-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.resource-link-btn:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   8. FALLBACK & FOOTER
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--surface-color);
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.empty-state i {
    font-size: 3.5rem;
    color: #94a3b8;
    margin-bottom: 1.25rem;
}

.empty-state h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
}

.hidden {
    display: none !important;
}

/* Sticky Footer Implementation (Compact & Professional) */
.site-footer {
    flex-shrink: 0; /* Keeps your footer anchored perfectly to the bottom */
    text-align: center;
    padding: 2rem 1rem; /* Slightly reduced padding so it looks minimal */
    background-color: #0f172a;
    color: rgba(255, 255, 255, 0.6); /* Dimmed text so it's not distracting */
    margin-top: 3rem;
    font-size: 0.85rem; /* Shrunk the text for a high-end feel */
}

/* New container rule to stack the text and link tightly */
.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem; 
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0; /* Removed the old margin, handled by container gap now */
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

/* The YouTube Hover Action */
.youtube-link:hover {
    color: #ff0000; /* Snaps to official YouTube Red */
    transform: translateY(-1px); /* Subtle premium lift */
}

/* ==========================================================================
   9. CSS KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   10. DESKTOP MEDIA QUERIES (Reverts Cards back to PC Table)
   ========================================================================== */
@media (min-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 3rem;
        max-width: 1400px;
        margin: 0 auto;
    }

    .brand h1 {
        font-size: 1.5rem;
    }

    .quote-text {
        font-size: 1.35rem;
    }

    .controls {
        flex-direction: row;
        align-items: center;
    }

    #search-input {
        flex: 2; 
    }

    #session-filter {
        flex: 1; 
        max-width: 250px;
    }

    .vault-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }

    .controls {
        margin-top: 0;
        width: 65%;
    }

    /* --- PC TABLE REVERSION --- */
    .table-container {
        background: var(--surface-color);
        border-radius: 12px;
        box-shadow: var(--shadow-md);
        border: 1px solid var(--border-color);
    }

    .resource-table {
        display: table;
    }

    .resource-table thead {
        display: table-header-group;
    }

    .resource-table tbody {
        display: table-row-group;
    }

    .resource-table tr {
        display: table-row;
        background: transparent;
        border: none;
        border-radius: 0;
        margin-bottom: 0;
        padding: 0;
        box-shadow: none;
    }

    .resource-table tr:hover {
        background-color: #f8fafc;
        transform: none; /* Turn off mobile hover lift */
        box-shadow: none;
    }

    .resource-table th, .resource-table td {
        display: table-cell;
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        margin: 0; /* Remove mobile margins */
    }

    .resource-table td:last-child {
        margin-top: 0;
    }

    .resource-link-btn {
        width: auto; /* Button goes back to normal size */
        padding: 0.6rem 1.2rem;
    }
}
