/* =========================================
   1. IMPORTS & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0c4a6e;       /* Deep Ocean Blue */
    --secondary-color: #28a745;     /* Success Green */
    --text-color: #333;
    --danger-color: #dc3545;        /* Red for Logout */
    --card-hover-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* =========================================
   2. GLOBAL RESET & BODY BACKGROUND
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    
    /* Animated Gradient Background */
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient-rgb-animation 20s ease infinite;
}

@keyframes gradient-rgb-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   3. HEADER & MOBILE NAVIGATION
   ========================================= */
.header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Desktop Menu */
.nav-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    font-size: 0.9rem;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logout-btn {
    background-color: var(--danger-color) !important;
}

/* Hamburger Icon (Hidden on Desktop) */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: white;
}

/* --- MOBILE RESPONSIVE (Screens < 768px) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Show Icon */
    }

    .nav-menu {
        display: none; /* Hide Menu by default */
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }

    /* JavaScript adds 'active' class to show menu */
    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        display: block;
        width: 100%;
        padding: 15px 25px;
        border-radius: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* =========================================
   4. MAIN CONTAINER (White Box)
   ========================================= */
.container {
    padding: 2rem;
    max-width: 1000px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    min-height: 80vh;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
}

/* =========================================
   5. GRIDS & CARDS (Dashboards & Selection)
   ========================================= */
.subject-grid, .resource-grid, .choice-container {
    display: grid;
    /* Responsive Columns: Stacks on mobile, side-by-side on desktop */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.subject-card, .resource-card, .choice-card {
    background-color: #333;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push text to bottom */
    background-size: cover;
    background-position: center;
    min-height: 180px; /* Default height */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

/* Hover Effects */
.subject-card:hover, .resource-card:hover, .choice-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

/* Dark Gradient Overlay for Readability */
.subject-card::before, .resource-card::before, .choice-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 60%);
    transition: background 0.3s;
}

.subject-card:hover::before {
    background: linear-gradient(to top, rgba(12, 74, 110, 0.9), rgba(12, 74, 110, 0.2));
}

/* Card Text Content */
.card-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-content i {
    font-size: 2.2rem;
    color: #fff;
}

.card-content span {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.card-content small {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 400;
}

/* =========================================
   6. LISTS & BUTTONS (Video/Notes Pages)
   ========================================= */
.topic-list {
    list-style: none;
    padding: 0;
}

.topic-list li {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    transition: background 0.2s;
}

.topic-list li:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.topic-list li:last-child { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-bottom: none; }
.topic-list li:hover { background: #f8f9fa; }

.view-btn {
    background: var(--secondary-color);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.view-btn:hover { background: #218838; }

/* =========================================
   7. LOGIN & SIGNUP FORMS
   ========================================= */
.login-box {
    max-width: 420px;
    margin: 8vh auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 25px;
    color: var(--primary-color);
}

input, select, button {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(12, 74, 110, 0.2);
}

button {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover { background: #0a3d5b; }

/* =========================================
   8. SUBJECT BACKGROUND IMAGES
   ========================================= */
/* Div A-G */
.physics-card { background-image: url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?q=80&w=1470'); }
.mechanics-card { background-image: url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?q=80&w=1470'); }
.electronics-card { background-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?q=80&w=1470'); }
.pps-card { background-image: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?q=80&w=1470'); }

/* Div H-Q */
.chemistry-card { background-image: url('https://images.unsplash.com/photo-1532094349884-543bc11b234d?q=80&w=1470'); }
.graphics-card { background-image: url('https://images.unsplash.com/photo-1581093458791-9f3c3900df4b?q=80&w=1470'); }
.electrical-card { background-image: url('https://images.unsplash.com/photo-1498084393753-b411b2d26b34?q=80&w=1332'); }
.pbl-card { background-image: url('https://images.unsplash.com/photo-1517048676732-d65bc937f952?q=80&w=1470'); }

/* Math & Default */
.lac-card { background-image: url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?q=80&w=1470'); }
.subject-card { background-image: url('https://images.unsplash.com/photo-1456513080510-7bf3a84b82f8?q=80'); }