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

:root {
    --bg-main: #0b0f19;
    --bg-card: #151e33;
    --bg-input: #1e2942;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --border: #1e2942;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Ocean Blue Theme */
html.theme-ocean {
    --bg-main: #051329;
    --bg-card: #0b2245;
    --bg-input: #113364;
    --text-primary: #f0f6fc;
    --text-secondary: #8b9eb7;
    --accent: #00d2ff;
    --accent-hover: #00b4db;
    --border: #143c73;
}

/* Sunset Orange Theme */
html.theme-sunset {
    --bg-main: #180909;
    --bg-card: #2c1212;
    --bg-input: #3d1b1b;
    --text-primary: #fdf5f5;
    --text-secondary: #c29d9d;
    --accent: #ff5a36;
    --accent-hover: #e04420;
    --border: #3d1b1b;
}

/* Emerald Green Theme */
html.theme-emerald {
    --bg-main: #05140e;
    --bg-card: #0c271c;
    --bg-input: #123c2a;
    --text-primary: #f0f7f4;
    --text-secondary: #8faea1;
    --accent: #10b981;
    --accent-hover: #059669;
    --border: #123c2a;
}

/* Royal Purple Theme */
html.theme-purple {
    --bg-main: #0d091a;
    --bg-card: #171130;
    --bg-input: #231a47;
    --text-primary: #fbfaff;
    --text-secondary: #a39cb8;
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --border: #231a47;
}

/* Theme Selector Hover & Active Styles */
.theme-option:hover {
    background: rgba(255, 255, 255, 0.05);
}
.theme-option.active {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Navbar */
.navbar {
    background-color: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.navbar-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-card);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover {
    background-color: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.25);
}

.btn-outline:active {
    transform: translateY(0);
}

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 24px;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--bg-input);
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
    resize: none;
}

/* Auth Container */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 32px;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 1.75rem;
}

.auth-header p {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Premium Rounded Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
}

th {
    padding: 12px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px 20px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

td:first-child {
    border-left: 1px solid var(--border);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

td:last-child {
    border-right: 1px solid var(--border);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: var(--accent);
}

/* Sidebar Toggle & Slide-over styles for Mobile (learn.php) */
.sidebar-toggle-btn {
    display: none;
}

#sidebarCloseBtn {
    display: none;
}

@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: inline-flex !important;
    }
    
    #sidebarCloseBtn {
        display: block !important;
    }
    
    .learning-course-title {
        display: none !important;
    }
    
    .learning-container .sidebar {
        position: fixed !important;
        top: 60px !important;
        left: -350px !important;
        width: 300px !important;
        height: calc(100vh - 60px) !important;
        z-index: 999 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5) !important;
    }
    
    .learning-container .sidebar.open {
        left: 0 !important;
    }
}

/* ==========================================
   Admin Panel Styles (Monochromatic Glassmorphism)
   ========================================== */

/* Sub-navigation Tabs */
.admin-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.admin-tab-item {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
}

.admin-tab-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

.admin-tab-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.admin-tab-item.active .tab-icon {
    color: var(--accent);
}

/* Stat Cards (Monochromatic Glassmorphism) */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.admin-stat-card {
    background: rgba(21, 30, 51, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.02), transparent 70%);
    pointer-events: none;
}

.admin-stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.admin-stat-card .stat-icon {
    font-size: 1.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.admin-stat-card:hover .stat-icon {
    color: var(--accent);
    opacity: 1;
}

.admin-stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
    line-height: 1.2;
    transition: color 0.2s ease;
}

.admin-stat-card:hover .stat-number {
    color: var(--accent);
}

.admin-stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-stat-card .stat-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 4px;
}

/* Admin Custom Card */
.admin-card {
    background: rgba(21, 30, 51, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.admin-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quick Filter Buttons */
.role-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.filter-btn.active {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Custom Confirmation Modal */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 15, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal-content {
    background: rgba(21, 30, 51, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-modal-overlay.open .admin-modal-content {
    transform: translateY(0) scale(1);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-modal-header .modal-icon {
    font-size: 1.8rem;
    color: var(--danger);
}

.admin-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-modal-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.admin-modal-body strong {
    color: var(--text-primary);
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: capitalize;
}

.badge-admin {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-instructor {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-student {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}


/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast-alert {
    min-width: 250px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-alert.hiding {
    opacity: 0;
    transform: translateX(100%);
}
.toast-success {
    border-left-color: #10b981;
}
.toast-success .toast-icon {
    color: #10b981;
}
.toast-error {
    border-left-color: #ef4444;
}
.toast-error .toast-icon {
    color: #ef4444;
}
.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}
.toast-close:hover {
    color: var(--text-primary);
}
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
