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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-brand {
    color: white;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user {
    color: #ecf0f1;
    margin-right: 10px;
}

/* Hero */
.hero {
    /*background: linear-gradient(135deg, #2c3e50, #3498db); */
    background-image: url("../courses.png");
    background-size: cover;
  background-position: center;
  background-repeat: no-repeat;    
    color: white; 
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.2s;
    background: #34495e;
    color: white;
}

.btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-primary {
    background: #3498db;
}

.btn-success {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
}

.btn-outline {
    background: transparent;
    border: 1px solid #bdc3c7;
    color: #7f8c8d;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85em;
}

.btn-lg {
    padding: 14px 30px;
    font-size: 1.1em;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.9em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}

.auth-card h1 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.auth-card h2 {
    color: #7f8c8d;
    font-weight: 400;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.auth-card form {
    text-align: left;
}

.auth-link {
    margin-top: 15px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.alert p {
    margin: 0;
}

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

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

/* Courses Grid */
.courses-section {
    padding: 50px 20px;
}

.courses-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8em;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.course-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.course-card.completed {
    border: 2px solid #27ae60;
}

.course-image {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-placeholder {
    font-size: 3em;
    opacity: 0.5;
}

.course-image .badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.course-info {
    padding: 20px;
}

.course-info h3 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.course-info p {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.course-meta {
    display: flex;
    gap: 15px;
    color: #95a5a6;
    font-size: 0.85em;
    margin-bottom: 15px;
}

.course-actions {
    display: flex;
    gap: 10px;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar.large {
    height: 12px;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #27ae60);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-bottom: 15px;
}

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

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

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

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

/* Main Content */
.main-content {
    padding: 30px 20px;
}

.main-content h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.main-content h2 {
    margin: 30px 0 20px;
    color: #2c3e50;
}

/* Course Header */
.course-header {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.course-header h1 {
    margin-bottom: 10px;
}

.completion-box {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.completion-box h3 {
    margin-bottom: 15px;
}

/* Lessons */
.lessons-list {
    margin-top: 20px;
}

.lesson-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border-left: 4px solid #3498db;
}

.lesson-item.completed {
    border-left-color: #27ae60;
    background: #f8fff8;
}

.lesson-number {
    width: 36px;
    height: 36px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.lesson-item.completed .lesson-number {
    background: #27ae60;
}

.lesson-content {
    flex: 1;
}

.lesson-content h3 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.lesson-text {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 10px;
    white-space: pre-line;
}

.lesson-video {
    margin-bottom: 10px;
}

.lesson-complete-form {
    margin-top: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 1.1em;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: #95a5a6;
    margin-top: 40px;
    border-top: 1px solid #ecf0f1;
}

/* Admin Layout */
.admin-nav {
    background: #1a252f;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 220px;
    background: #2c3e50;
    padding: 20px 0;
    z-index: 50;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li a {
    display: block;
    padding: 12px 24px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95em;
}

.admin-sidebar li a:hover,
.admin-sidebar li.active a {
    background: #34495e;
    color: white;
    border-left: 3px solid #3498db;
}

.admin-content {
    margin-left: 220px;
    padding: 30px;
    min-height: calc(100vh - 60px);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-header h1 {
    margin-bottom: 0;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-table th {
    background: #34495e;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.9em;
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Admin Form */
.admin-form {
    max-width: 600px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

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

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    margin-top: 5px;
    font-size: 0.95em;
}

.admin-section {
    margin-top: 30px;
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* Video Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 10;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

.modal-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.btn-video {
    background: #e74c3c;
    color: white;
}

.btn-video:hover {
    background: #c0392b;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 10px;
    }

    .hero h1 {
        font-size: 1.8em;
    }

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

    .admin-sidebar {
        position: static;
        width: 100%;
        padding: 10px 0;
    }

    .admin-sidebar ul {
        display: flex;
        justify-content: center;
        gap: 5px;
    }

    .admin-sidebar li a {
        padding: 8px 16px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .admin-sidebar li.active a {
        border-bottom-color: #3498db;
        border-left: none;
    }

    .admin-content {
        margin-left: 0;
        padding: 20px;
    }

    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .admin-table {
        font-size: 0.85em;
    }

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

    .lesson-item {
        flex-direction: column;
    }
}
