/* ==================== VARIABLES ==================== */
:root {
    /* Colors */
    --brand-blue: #2563eb;
    --brand-green: #059669;
    --brand-dark: #0f172a;

    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #94a3b8;

    --white: #ffffff;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb, #1d4ed8);
    --gradient-brand: linear-gradient(135deg, #059669, #2563eb);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Layout */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --container-width: 1200px;
    --header-height: 70px;
}

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

html,
body {
    height: 100%;
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-brand-blue {
    color: var(--brand-blue);
}

.text-brand-green {
    color: var(--brand-green);
}

.text-gradient {
    background: var(--gradient-brand);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-spacing {
    margin-bottom: 60px;
}

.full-screen-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title,
.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--brand-dark);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.profile-container {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--bg-tertiary);
}

/* ==================== COMPONENTS ==================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-google {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
    gap: 10px;
}

.btn-google:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.btn-white {
    background: var(--white);
    color: var(--brand-blue);
    font-weight: 700;
}

.btn-white:hover {
    background: var(--bg-secondary);
}

.btn-text {
    color: var(--text-secondary);
    text-decoration: underline;
}

.btn-text:hover {
    color: var(--brand-blue);
}

.icon-btn {
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: background 0.2s;
    position: relative;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--brand-blue);
}

/* Badges */
.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid var(--white);
}

.badge-instructor {
    background: var(--brand-blue);
    color: var(--white);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
    vertical-align: middle;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-tertiary);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-blue);
}

/* ==================== LOGIN PAGE ==================== */
#loginPage {
    background: var(--bg-secondary);
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.brand-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* ==================== HEADER ==================== */
.app-header {
    background: var(--white);
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.notification-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hamburger & Dropdown */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: var(--radius-md);
}

.hamburger-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

.hamburger-btn:hover {
    background: var(--bg-tertiary);
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 280px;
    padding: 8px 0;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
}

.dropdown-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.menu-user-info {
    padding: 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    gap: 12px;
    align-items: center;
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.menu-links .menu-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background 0.2s;
}

.menu-links .menu-item:hover {
    background: var(--bg-secondary);
    color: var(--brand-blue);
}

.menu-links .menu-item.active {
    color: var(--brand-blue);
    background: #eff6ff;
    border-left: 3px solid var(--brand-blue);
}

.menu-links .menu-item.danger {
    color: var(--danger);
}

.menu-links .menu-item.danger:hover {
    background: #fee2e2;
}

.divider {
    height: 1px;
    background: var(--bg-tertiary);
    margin: 8px 0;
}

/* ==================== HERO SECTION ==================== */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--bg-tertiary);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== SEARCH SECTION ==================== */
.search-section {
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.search-box {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
    border: 1px solid var(--bg-tertiary);
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--brand-blue);
    outline: none;
    background: var(--white);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 20;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-tertiary);
    font-size: 0.95rem;
}

.suggestion-item:hover {
    background: var(--bg-secondary);
}

/* ==================== GRIDS ==================== */
.grid-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.grid-instructors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ==================== INSTRUCTOR CARD ==================== */
.instructor-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.instructor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-blue);
}

.card-header {
    padding: 20px;
    display: flex;
    gap: 16px;
    border-bottom: 1px solid var(--bg-secondary);
}

.instructor-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==================== BANNER ==================== */
.banner {
    background: var(--brand-dark);
    color: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.banner h2 {
    color: #38bdf8;
    margin-bottom: 10px;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    width: fit-content;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
}

.tab-btn.active {
    background: var(--white);
    color: var(--brand-blue);
    box-shadow: var(--shadow-sm);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .search-box {
        grid-template-columns: 1fr;
    }

    .nav-actions {
        gap: 8px;
    }
}

/* Firefly Animation */
.firefly {
    position: fixed;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float linear infinite;
    mix-blend-mode: screen;
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }

    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }

    100% {
        transform: translateY(-10vh) scale(0);
        opacity: 0;
    }
}
