:root {
    --primary: #132632;
    --secondary: #68DEC5;
    --white: #ffffff;
    --light-gray: #f5f7fa;
    --gray: #6c757d;
    --border: #e0e0e0;
    --error: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background: var(--light-gray);
    min-height: 100vh;
    color: var(--primary);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Logo Header */
.logo-header {
    margin-bottom: 20px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
}

.logo-text:hover {
    color: #1a3a4a;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.header-left p {
    color: var(--gray);
    font-size: 0.95rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-info, .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--white);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--gray);
}

.admin-info svg, .user-info svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
}

.admin-info strong, .user-info strong {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: #1a3a4a;
}

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

.btn-secondary:hover {
    background: #5bc9b2;
}

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

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--gray);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-logout {
    background: #fee2e2;
    color: var(--error);
    padding: 10px 18px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: var(--error);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Admin Navigation Menu */
.admin-nav {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    padding: 0;
}

.admin-nav .nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-nav .nav-menu li {
    position: relative;
}

.admin-nav .nav-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    color: var(--gray);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.admin-nav .nav-menu a:hover {
    color: var(--primary);
    background: var(--light-gray);
}

.admin-nav .nav-menu a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--light-gray);
}

.admin-nav .nav-menu a svg {
    width: 18px;
    height: 18px;
}

/* Submenu Styles */
.admin-nav .nav-menu .has-submenu {
    position: relative;
}

.admin-nav .nav-menu .has-submenu > a {
    padding-right: 32px;
}

.admin-nav .nav-menu .has-submenu > a::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    border: 5px solid transparent;
    border-top-color: currentColor;
    transition: transform 0.2s ease;
}

.admin-nav .nav-menu .has-submenu:hover > a::after {
    transform: translateY(-50%) rotate(180deg);
}

.admin-nav .nav-menu .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    list-style: none;
    z-index: 100;
    padding: 8px;
    padding-top: 15px;
    border: 1px solid var(--border);
    margin-top: 5px;
}

.admin-nav .nav-menu .submenu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 25px;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
}

/* Invisible bridge to prevent hover gap issue */
.admin-nav .nav-menu .submenu::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

.admin-nav .nav-menu .has-submenu:hover .submenu {
    display: block;
}

.admin-nav .nav-menu .submenu li {
    margin: 2px 0;
}

.admin-nav .nav-menu .submenu li a {
    padding: 10px 14px;
    border-bottom: none;
    font-size: 0.9rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.admin-nav .nav-menu .submenu li a svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.admin-nav .nav-menu .submenu li a:hover {
    background: var(--light-gray);
    color: var(--primary);
}

.admin-nav .nav-menu .submenu li a:hover svg {
    opacity: 1;
}

.admin-nav .nav-menu .submenu li a.active {
    background: linear-gradient(135deg, var(--primary) 0%, #1a3a4a 100%);
    color: var(--white);
    border-bottom: none;
}

.admin-nav .nav-menu .submenu li a.active svg {
    opacity: 1;
}

/* Navigation Badge for notifications */
.nav-badge {
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.tab-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
}

.tab-btn:hover {
    border-color: var(--secondary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Cards */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(19, 38, 50, 0.08);
}

.stat-card h3 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card.highlight {
    background: var(--primary);
}

.stat-card.highlight h3,
.stat-card.highlight .value {
    color: var(--white);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.stat-card .icon svg {
    width: 24px;
    height: 24px;
}

.stat-card .icon.blue {
    background: #e3f2fd;
}

.stat-card .icon.blue svg {
    stroke: var(--info);
}

.stat-card .icon.green {
    background: #e8f5e9;
}

.stat-card .icon.green svg {
    stroke: var(--success);
}

.stat-card .icon.orange {
    background: #fff3e0;
}

.stat-card .icon.orange svg {
    stroke: #ff9800;
}

.stat-card .icon.purple {
    background: #f3e5f5;
}

.stat-card .icon.purple svg {
    stroke: #9c27b0;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(19, 38, 50, 0.08);
    overflow: hidden;
    margin-bottom: 25px;
}

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

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: var(--light-gray);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
}

table td {
    font-size: 0.95rem;
}

table tr:hover {
    background: #fafbfc;
}

table .actions {
    display: flex;
    gap: 8px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: var(--primary);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* File upload */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload:hover {
    border-color: var(--secondary);
    background: #f8fffe;
}

.file-upload.dragover {
    border-color: var(--secondary);
    background: #f0fdf9;
}

.file-upload svg {
    width: 48px;
    height: 48px;
    stroke: var(--gray);
    margin-bottom: 15px;
}

.file-upload p {
    color: var(--gray);
    margin-bottom: 10px;
}

.file-upload .file-name {
    color: var(--primary);
    font-weight: 500;
}

.file-upload input {
    display: none;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(19, 38, 50, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.modal-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--gray);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

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

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(19, 38, 50, 0.12);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-box .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.login-box .logo p {
    color: var(--gray);
    font-size: 0.9rem;
}

.login-box h2 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
}

/* Course Cards */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.course-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(19, 38, 50, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(19, 38, 50, 0.12);
}

.course-card .thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--light-gray);
}

.course-card .content {
    padding: 20px;
}

.course-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.course-card p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.course-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.course-card .meta span {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Video Player */
.video-player-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
}

.video-player-container video {
    width: 100%;
    display: block;
}

/* Video List */
.video-list {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(19, 38, 50, 0.08);
}

.video-list-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}

.video-list-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.video-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-item:last-child {
    border-bottom: none;
}

.video-item:hover {
    background: var(--light-gray);
}

.video-item.active {
    background: #f0fdf9;
    border-left: 3px solid var(--secondary);
}

.video-item .play-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.video-item .play-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
}

.video-item.completed .play-icon {
    background: #d4edda;
}

.video-item.completed .play-icon svg {
    stroke: var(--success);
}

.video-item .info {
    flex: 1;
}

.video-item .info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 3px;
}

.video-item .info span {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Sidebar Layout */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
}

@media (max-width: 992px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    stroke: var(--border);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    table th,
    table td {
        padding: 12px 15px;
    }

    .modal {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }
}
