/* =========================================
   1. VARIABLES & RESET
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    /* Colors */
    --bg-color: #0f0f0f;         /* Deep Black Background */
    --surface-color: #1a1a1a;    /* Cards & Sidebar */
    --surface-hover: #252525;    /* Hover State */
    --border-color: #333333;     /* Subtle Borders */
    
    /* Brand Colors */
    --primary: #4F46E5;          /* Indigo */
    --primary-hover: #4338ca;
    --text-main: #ffffff;
    --text-muted: #a3a3a3;

    /* Dimensions */
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
    height: var(--nav-height);
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar a { text-decoration: none; }

/* Search Bar */
.search-container {
    flex-grow: 1;        /* Takes up all remaining space */
    max-width: none;     /* Removes the size limit */
    margin-left: 40px;   /* Adds space between Logo and Search */
    margin-right: 0;     /* Extends to the far right edge */
}

.search-container input {
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 12px 25px;
    border-radius: 50px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-container input:focus {
    border-color: var(--primary);
    background: #000;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.3); /* Search Glow */
}

/* =========================================
   3. APP LAYOUT (Sidebar + Main)
   ========================================= */
.app-layout {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    z-index: 900;
}

.sidebar-header {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar ul { list-style: none; }

/* Sidebar Items */
.sidebar li {
    padding: 10px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0 8px 8px 0; /* Rounded on right side only */
    border-left: 3px solid transparent; /* Invisible border waiting for hover */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Hover Effect (Modern Glow Slide) */
.sidebar li:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.15) 0%, transparent 100%);
    border-left-color: var(--primary); /* The Blue Line */
    color: #fff; 
    padding-left: 20px; /* Slide text to the right */
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 250px; /* Width of sidebar */
    width: calc(100% - 250px);
    background-color: var(--bg-color);
}

/* =========================================
   4. FILTERS (Sticky)
   ========================================= */
.filter-container {
    padding: 15px 30px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    background-color: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    
    /* Sticky Magic */
    position: sticky;
    top: var(--nav-height);
    z-index: 800;
}

.filter-container::-webkit-scrollbar { display: none; }

.filter-btn {
    /* Critical Fixes for Size */
    flex-shrink: 0;           /* 1. Stops button from getting squished */
    white-space: nowrap;      /* 2. Keeps text on one line */
    display: inline-flex;     
    align-items: center;
    justify-content: center;
    
    /* Styling */
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 20px;        
    border-radius: 50px;      
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10; 
}

/* Filter Hover State */
.filter-btn:hover {
    border-color: var(--primary);
    color: #fff;
    background: rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Filter Active State */
.filter-btn.active {
    background: linear-gradient(135deg, #4F46E5 0%, #7c3aed 100%);
    border: 1px solid transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    font-weight: 600;
}

/* =========================================
   5. VIDEO GRID & CARDS
   ========================================= */
.grid {
    display: grid;
    /* 240px ensures 4 cards fit on standard screens */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 20px;
    padding: 30px;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

/* Card Hover Glow Effect */
.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.4); /* The Blue Neon Glow */
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content { padding: 15px; }

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-author {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =========================================
   6. CONTACT SECTION
   ========================================= */
.contact-section {
    padding: 60px 20px;
    background-color: #050505;
    border-top: 1px solid var(--border-color);
    margin-left: 250px; /* Match sidebar offset */
}

.contact-container {
    max-width: 900px;
    margin: 0 auto;
}

.contact-header { text-align: center; margin-bottom: 40px; }
.contact-header h2 { font-size: 2rem; margin-bottom: 10px; }
.contact-header p { color: var(--text-muted); }

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.contact-card {
    flex: 1;
    min-width: 300px;
    background: var(--surface-color);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.contact-card h3 { margin-bottom: 25px; color: var(--text-main); }

/* Buttons inside Contact */
.contact-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: 0.2s;
}

.link-title { color: var(--text-main); font-weight: 600; font-size: 0.95rem; }
.link-subtitle { color: var(--text-muted); font-size: 0.85rem; }

/* Contact Hover Effects */
.link-gmail:hover { border-color: #EA4335; background: rgba(234, 67, 53, 0.1); }
.link-insta:hover { border-color: #E1306C; background: rgba(225, 48, 108, 0.1); }

/* Form Styles */
.form-group { margin-bottom: 15px; }
.form-group label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; display: block; }

.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: white;
    font-family: inherit;
    outline: none;
}

.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
}

.submit-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover { background-color: var(--primary-hover); }

/* =========================================
   7. ANIMATIONS & INTRO
   ========================================= */
.intro-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.intro-content { text-align: center; animation: floatUp 0.8s ease-out forwards; }
.intro-logo { width: 80px; margin-bottom: 15px; }
.intro-title { font-size: 2.5rem; font-weight: 800; color: #fff; }
.intro-tagline { font-size: 1.2rem; color: var(--primary); opacity: 0; animation: fadeIn 0.5s ease-out 0.5s forwards; }
.intro-hidden { opacity: 0; pointer-events: none; }

@keyframes floatUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { to { opacity: 1; } }

/* =========================================
   8. MOBILE RESPONSIVENESS (Fixed Header Layout)
   ========================================= */
@media screen and (max-width: 900px) {

    /* 1. APP LAYOUT - Push content down to clear both bars */
    .app-layout {
        display: block; 
        /* Reset margin, use padding to clear the fixed headers */
        margin-top: 0; 
        /* 70px (Nav) + 60px (Filter) = 130px space at top */
        padding-top: calc(var(--nav-height) + 60px); 
        overflow-x: hidden;
    }

    /* 2. SIDEBAR - Hidden */
    .sidebar { display: none; }

    /* 3. MAIN CONTENT - Full Width */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0;
    }

    /* 4. NAVBAR - Keep strict height */
    .navbar {
        height: var(--nav-height); /* 70px */
        padding: 0 15px; 
        gap: 15px;
    }
    
    .nav-brand span { display: none; } /* Hide text on mobile */

    /* Search Bar Adjustment */
    .search-container {
        margin-left: 0;
        margin-right: 0;
        width: auto;
        flex: 1;
    }

    /* 5. FILTER BAR - THE FIX */
    .filter-container {
        /* FIXED POSITION: Locks it to the screen, not the page */
        position: fixed; 
        
        /* Placed exactly at the bottom of the Navbar */
        top: var(--nav-height); 
        left: 0;
        width: 100%;
        height: 60px; /* Fixed height for the bar */
        
        /* Layout */
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 15px;
        
        /* Styling */
        background-color: var(--bg-color); /* Opaque black so videos don't show behind */
        border-bottom: 1px solid var(--border-color);
        z-index: 900; /* Below Navbar (1000) but above Content */
        
        /* Scrolling */
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    
    /* Hide Scrollbar Chrome/Safari */
    .filter-container::-webkit-scrollbar { display: none; }

    /* Button Tweak */
    .filter-btn {
        flex-shrink: 0; /* Prevent squishing */
        margin: 0;
    }

    /* 6. GRID & OTHERS */
    .grid {
        grid-template-columns: 1fr; 
        gap: 20px;
        padding: 20px;
    }
    
    .contact-section { margin-left: 0; padding: 40px 20px; }
}

/* --- MODERN GLOWING CHAT WIDGET --- */
.ai-chat-widget {
    width: 100%;
    max-width: 900px; /* Limits width on big screens */
    height: 600px;    /* Much taller for better visibility */
    margin: 30px auto; /* Centers it and adds spacing */
    
    /* Dark Theme & Glow */
    background: #111111;
    border: 1px solid #333;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.15); /* Soft Blue Glow */
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
}

/* Header */
.ai-header {
    background: #1a1a1a;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glow-icon {
    text-shadow: 0 0 10px gold;
}

.header-status {
    font-size: 0.8rem;
    color: #00ff88; /* Bright Green */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.4);
}

/* Chat History Area */
.chat-scroll-area {
    flex: 1;
    background: #0f0f0f; /* Very Dark Grey */
    padding: 20px;
    overflow-y: auto; /* Internal Scrolling */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar Customization (Webkit) */
.chat-scroll-area::-webkit-scrollbar {
    width: 8px;
}
.chat-scroll-area::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* Input Area */
.chat-controls {
    background: #1a1a1a;
    padding: 15px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
}

#ai-input {
    flex: 1;
    background: #252525;
    border: 1px solid #444;
    color: #fff;
    padding: 12px 18px;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#ai-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

#ai-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

#ai-btn:hover {
    transform: scale(1.05);
}

/* --- MESSAGE BUBBLES --- */

/* User Bubble (Right) */
.user-msg {
    align-self: flex-end;
    background: linear-gradient(135deg, #007bff, #0062cc); /* Blue Gradient */
    color: white;
    padding: 12px 18px;
    border-radius: 18px 18px 2px 18px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* AI Bubble (Left) */
.ai-msg {
    align-self: flex-start;
    background: #2a2a2a; /* Dark Grey */
    color: #e0e0e0;      /* Light Text */
    border: 1px solid #3d3d3d;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 2px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Strong text highlight in dark mode */
.ai-msg strong {
    color: #66b3ff; /* Light Blue for importance */
}
