@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    /* --- BRAND COLORS --- */
    --primary: #cc0000;
    --primary-hover: #aa0000;
    
    /* --- LIGHT THEME (Default) --- */
    --bg-body: #f9f9f9;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #0f0f0f;
    --text-muted: #606060;
    --border: #e5e5e5;
    --hover-bg: #f2f2f2;
    --search-bg: #f0f0f0;
    
    /* --- DIMENSIONS --- */
    --header-height: 64px; /* Increased for better spacing */
    --sidebar-width: 240px;
}

/* --- DARK THEME --- */
body.dark-mode {
    --bg-body: #0f0f0f;
    --bg-surface: #0f0f0f; 
    --bg-sidebar: #0f0f0f;
    --text-main: #f1f1f1;
    --text-muted: #aaaaaa;
    --border: #333333;
    --hover-bg: #272727;
    --search-bg: #121212;
}

/* --- GLOBAL RESETS --- */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
* { box-sizing: border-box; }

/* --- HEADER --- */
.main-header {
    background-color: var(--bg-surface);
    height: var(--header-height);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0 16px;
    display: flex; /* Flexbox controls alignment */
    align-items: center; /* Vertically Centers everything */
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Subtle shadow for separation */
}

.header-left { display: flex; align-items: center; gap: 16px; min-width: 150px; }
.logo img { height: 26px; display: block; width: auto; }

.header-center { 
    flex: 1; 
    max-width: 600px; 
    display: flex; 
    justify-content: center; /* Centers search bar horizontally */
}
.search-bar {
    width: 100%; 
    display: flex; 
    align-items: center;
    background: var(--search-bg);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 0 0 0 16px;
    height: 40px; /* Explicit height */
    overflow: hidden;
}
.search-bar input {
    width: 100%; border: none; background: transparent;
    font-size: 16px; color: var(--text-main); outline: none;
    height: 100%;
}
.search-btn {
    background: var(--search-bg); border: none; padding: 0 20px;
    cursor: pointer; color: var(--text-main); border-left: 1px solid var(--border);
    height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.search-btn:hover { background-color: var(--border); }

.header-right { display: flex; align-items: center; gap: 10px; min-width: 150px; justify-content: flex-end; }

.menu-btn, .icon-btn {
    background: none; border: none; cursor: pointer; color: var(--text-main);
    padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.menu-btn:hover, .icon-btn:hover { background-color: var(--hover-bg); }

/* --- SIDEBAR --- */
.sidebar {
    position: fixed; 
    top: var(--header-height); 
    left: 0; 
    bottom: 0;
    width: var(--sidebar-width); 
    background-color: var(--bg-sidebar);
    padding: 12px; 
    overflow-y: auto; 
    z-index: 900;
    border-right: 1px solid transparent;
    transition: transform 0.3s ease; /* Smooth slide animation */
}

.sidebar-link {
    display: flex; align-items: center; padding: 10px 12px;
    border-radius: 10px; color: var(--text-main); font-size: 14px; font-weight: 500;
    margin-bottom: 4px; white-space: nowrap;
}
.sidebar-link:hover { background-color: var(--hover-bg); }
.sidebar-link .material-icons, .sidebar-link .material-icons-outlined { margin-right: 20px; font-size: 24px; }

/* --- MAIN CONTENT --- */
.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width); /* Default Desktop Margin */
    padding: 24px;
    flex: 1; 
    transition: margin-left 0.3s ease;
}

/* --- HERO & COMPONENTS --- */
.hero-banner {
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    color: white; padding: 60px 20px; border-radius: 16px;
    text-align: center; margin-bottom: 30px; position: relative; overflow: hidden;
}
.btn-cta {
    background-color: var(--primary); color: white; padding: 12px 30px;
    font-size: 16px; font-weight: 700; border-radius: 2px; text-transform: uppercase;
    display: inline-block; cursor: pointer; border: none;
}
.video-card:hover { transform: translateY(-2px); transition: 0.2s; }

/* --- FOOTER --- */
.main-footer {
    margin-left: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    margin-top: auto;
    transition: margin-left 0.3s ease;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px;
    max-width: 1200px; margin: 0 auto;
}
.footer-col h4 { margin-top: 0; color: var(--text-main); font-size: 14px; text-transform: uppercase; }
.footer-col a { display: block; color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }

/* --- RESPONSIVE / MOBILE RULES --- */
@media (max-width: 768px) {
    /* 1. Sidebar is hidden off-screen by default */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.5); /* Shadow when it slides out */
    }

    /* 2. When 'active' class is added via JS, it slides in */
    .sidebar.active {
        transform: translateX(0);
    }

    /* 3. Main content takes full width on mobile */
    .main-content {
        margin-left: 0;
    }

    /* 4. Footer takes full width on mobile */
    .main-footer {
        margin-left: 0;
    }

    /* 5. Hide search bar on very small screens if needed, or adjust */
    .header-center {
        margin: 0 10px;
    }
}