/* Courses System - Modern Design */
* {
    box-sizing: border-box;
}

body {
    background: var(--g-primary);
    min-height: 100vh;
    font-family: var(--font-body);
}

/* =============================================================================
   Courses List Page
   ============================================================================= */

.courses-container {
    max-width: 95vw;
    width: 95vw;
    margin: 20px auto;
    padding: 0 20px;
}

.courses-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.page-title {
    background: var(--g-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.page-subtitle {
    color: color-mix(in srgb, var(--c-text) 70%, transparent);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

.manage-courses-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 24px;
    background: var(--g-accent);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--c-chord) 26%, transparent);
    transition: all 0.3s ease;
}
.manage-courses-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
}

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

.course-card {
    background: color-mix(in srgb, var(--c-surface) 22%, white);
    border-radius: 16px;
    padding: 25px;
    border: 2px solid #e1e8ed;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--g-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.course-card:hover::before {
    transform: scaleX(1);
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--c-chord);
}

.course-image {
    width: 100%;
    height: 150px;
    background: var(--g-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    font-size: 3rem;
}

.course-content {
    flex: 1;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.course-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    flex: 1;
}

.price-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.price-badge.free {
    background: #10b981;
    color: white;
}

.price-badge.paid {
    background: #f59e0b;
    color: white;
}

.course-field {
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 5px 0;
}

.course-description {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 10px 0;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #f59e0b;
    font-weight: 600;
}

.course-rating.no-rating {
    color: #94a3b8;
    font-size: 0.85rem;
}

.reviews-count {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: normal;
}

.course-stats {
    color: #64748b;
    font-size: 0.9rem;
}

.course-stats i {
    margin-left: 5px;
}

.course-actions {
    margin-top: 15px;
}

.view-course-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.view-course-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* =============================================================================
   Course Detail Page
   ============================================================================= */

.course-detail-container {
    max-width: 95vw;
    width: 95vw;
    margin: 20px auto;
    padding: 0 20px;
}

.course-detail-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px 40px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #764ba2;
    transform: translateX(-5px);
}

.course-title-main {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 10px 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.course-header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

.course-field-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.course-rating-display {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #f59e0b;
    font-weight: 600;
}

.course-detail-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.course-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-description-box,
.course-details-box,
.course-requirements-box,
.course-prerequisites-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.course-description-box h2,
.course-details-box h3,
.course-requirements-box h3,
.course-prerequisites-box h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.course-description-text {
    color: #64748b;
    line-height: 1.8;
    font-size: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: #64748b;
}

.detail-item i {
    color: #667eea;
    width: 20px;
}

.course-actions-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-price-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.price-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
}

.price-label {
    color: #64748b;
    font-size: 0.95rem;
}

.price-display.free .price-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}

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

.start-course-btn,
.preview-course-btn,
.purchase-course-btn {
    width: 100%;
    padding: 15px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.start-course-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.preview-course-btn {
    background: #e1e8ed;
    color: #2c3e50;
}

.purchase-course-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.start-course-btn:hover,
.purchase-course-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.course-share-box,
.course-stats-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-course-btn {
    width: 100%;
    padding: 12px;
    background: #f8f9ff;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-course-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: #64748b;
}

.stat-item i {
    color: #667eea;
    width: 20px;
}

/* Reviews Section */
.course-reviews-section {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.course-reviews-section h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.review-item {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
}

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

.review-stars {
    color: #f59e0b;
}

.review-text {
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.no-reviews {
    color: #94a3b8;
    text-align: center;
    padding: 20px;
}

.add-review-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e1e8ed;
}

.add-review-form h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.rating-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.star-rating {
    display: flex;
    gap: 5px;
    cursor: pointer;
}

.star-rating i {
    font-size: 1.5rem;
    color: #e1e8ed;
    transition: all 0.2s ease;
}

.star-rating i.fas {
    color: #f59e0b;
}

.star-rating i:hover {
    transform: scale(1.1);
}

#reviewText {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 15px;
}

.submit-review-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* =============================================================================
   Lesson Page
   ============================================================================= */

.lesson-container {
    max-width: 95vw;
    width: 95vw;
    margin: 20px auto;
    padding: 0 20px;
}

.lesson-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px 40px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lesson-title {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 15px 0 5px 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lesson-course-name {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.lesson-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.lesson-content-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lesson-video-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.lesson-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.no-video {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.no-video i {
    font-size: 4rem;
    margin-bottom: 15px;
}

.lesson-notes-box,
.lesson-attachments-box,
.lesson-questions-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lesson-notes-box h3,
.lesson-attachments-box h3,
.lesson-questions-box h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.notes-content {
    color: #64748b;
    line-height: 1.8;
    white-space: pre-wrap;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    border: 1px solid #e1e8ed;
}

.attachment-item:hover {
    background: #667eea;
    color: white;
    transform: translateX(-5px);
}

.attachment-item i:first-child {
    font-size: 1.5rem;
    color: #667eea;
}

.attachment-item:hover i:first-child {
    color: white;
}

.attachment-item span {
    flex: 1;
}

.question-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
}

.question-text {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e1e8ed;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-option input[type="radio"] {
    cursor: pointer;
}

.submit-answers-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.submit-answers-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Lesson Sidebar */
.lesson-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lessons-list-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lessons-list-box h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    border: 2px solid #e1e8ed;
    position: relative;
}

.lesson-item:hover {
    background: #e1e8ed;
    transform: translateX(-5px);
}

.lesson-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.lesson-item.watched {
    border-color: #10b981;
}

.lesson-item-number {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #667eea;
    flex-shrink: 0;
}

.lesson-item.active .lesson-item-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lesson-item-content {
    flex: 1;
}

.lesson-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.lesson-item-duration {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 3px;
}

.lesson-item.active .lesson-item-duration {
    color: rgba(255, 255, 255, 0.9);
}

.lesson-item-check {
    color: #10b981;
    font-size: 1.2rem;
}

.lesson-item.active .lesson-item-check {
    color: white;
}

.lesson-navigation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.prev-btn {
    background: #f8f9ff;
    color: #667eea;
    border: 2px solid #e1e8ed;
}

.prev-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.next-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.complete-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Loading and Error States */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.loading-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #667eea;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ef4444;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #e1e8ed;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .course-detail-main,
    .lesson-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }

    .courses-card,
    .course-detail-header,
    .lesson-header {
        padding: 25px;
    }

    .course-title-main,
    .lesson-title {
        font-size: 1.8rem;
    }
}

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

    .courses-container,
    .course-detail-container,
    .lesson-container {
        padding: 0 15px;
    }

    .page-title {
        font-size: 2rem;
    }
}

