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

body {
    font-family: Arial, sans-serif;
    background: #f9f9f9;
    color: #333;
}

/* Top Navigation */
.top-nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0064A4;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-badge {
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.9rem;
}

.auth-btn {
    padding: 8px 20px;
    background: #0064A4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.auth-btn:hover {
    background: #003366;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 20px;
}

.user-avatar {
    font-size: 1.5rem;
    color: #0064A4;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.75rem;
    color: #666;
}

.btn-logout {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
}

.btn-logout:hover {
    color: #dc2626;
}


/* Main Content - YouTube Style Side-by-Side Layout */
.main-content {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

/* Video Section - Left Side */
.video-section {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.video-info h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.video-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9rem;
}

.description-box {
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.description-box h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.action-buttons {
    padding: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Course Outline - Right Sidebar (YouTube Style) */
.course-outline {
    background: white;
    border-radius: 10px;
    padding: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
    transition: transform 0.3s ease;
}

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

.sidebar-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.sidebar-close:hover {
    color: #0064A4;
}

/* Certificate Section */
.certificate-section {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #0064A4 0%, #003366 100%);
    border-radius: 10px;
    color: white;
}

.certificate-card {
    text-align: center;
}

.certificate-card i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #F47E3C;
}

.certificate-card h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.certificate-card p {
    font-size: 0.85rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.btn-certificate {
    background: #F47E3C;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-certificate:hover {
    background: #d66a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 126, 60, 0.3);
}

.btn-certificate i {
    margin-right: 5px;
}

.progress-info {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #0064A4;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    display: block;
}

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

/* Module Section (Collapsible) */
.module-section {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s;
}

.module-section-header {
    padding: 12px;
    background: #f9f9f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.module-section-header:hover {
    background: #f0f0f0;
}

.module-section-header.active {
    background: #e3f2fd;
    border-left: 3px solid #0064A4;
}

.module-section-header .toggle-icon {
    font-size: 0.9rem;
    color: #0064A4;
    transition: transform 0.3s;
}

.module-section.collapsed .toggle-icon {
    transform: rotate(0deg);
}

.module-section:not(.collapsed) .toggle-icon {
    transform: rotate(90deg);
}

.module-section-header .section-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.module-section-header .section-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #666;
}

.module-section-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.module-section.collapsed .module-section-content {
    max-height: 0;
}

/* Module Items inside sections */
.module-item {
    padding: 12px;
    padding-left: 35px;
    border-top: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.module-item:hover {
    background: #f5f5f5;
}

.module-item.active {
    background: #e3f2fd;
    border-left: 3px solid #0064A4;
}

.module-item.completed {
    background: #f0f9ff;
}

.module-item .module-title {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.module-item .module-meta {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #0064A4;
    color: white;
}

.btn-primary:hover {
    background: #003366;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Quiz Section */
.quiz-section {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
    display: none; /* Hidden by default */
}

.quiz-section.active {
    display: block; /* Show when active */
}

/* Hide main content when quiz is active */
.main-content.quiz-active {
    display: none !important;
}

/* Hide sidebar and restructure layout when quiz is active */
body.quiz-active .course-outline {
    display: none !important;
}

body.quiz-active .sidebar-toggle {
    display: none !important;
}

body.quiz-active .main-content {
    display: block !important;
    max-width: 100% !important;
    grid-template-columns: 1fr !important;
}

body.quiz-active .video-section {
    display: none !important;
}

.quiz-container {
    background: white;
    border-radius: 10px;
    padding: 40px;
}

.quiz-intro {
    text-align: center;
}

.quiz-intro p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.question-card {
    margin-top: 20px;
}

.question-number {
    color: #666;
    margin-bottom: 10px;
}

.question-card h3 {
    margin-bottom: 20px;
    line-height: 1.8;
    white-space: pre-line;
}

/* Style for quiz question options within the question text */
.question-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Make options in question text smaller and display on separate lines */
.quiz-question-options {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 2;
    margin-top: 15px;
    display: block;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.option:hover {
    border-color: #0064A4;
    background: #f5f5f5;
}

.option.selected {
    border-color: #0064A4;
    background: #e3f2fd;
}

.option.correct {
    border-color: #10b981;
    background: #d1fae5;
}

.option.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
}

.quiz-results {
    text-align: center;
}

.score {
    font-size: 2rem;
    margin: 20px 0;
    color: #0064A4;
}

.score-message {
    font-size: 1.1rem;
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    background: #f0f9ff;
    color: #0064A4;
}

.score-message.success {
    background: #d1fae5;
    color: #10b981;
}

.score-message.retry {
    background: #fee2e2;
    color: #ef4444;
}

.quiz-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.quiz-actions button {
    min-width: 150px;
}

/* Quiz Navigation Buttons */
.quiz-navigation {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.quiz-navigation button {
    min-width: 150px;
}

/* Quiz Navigation Buttons (Below Quiz) */
.quiz-navigation {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.quiz-navigation button {
    flex: 1;
    max-width: 250px;
}

@media (max-width: 768px) {
    .quiz-navigation {
        flex-direction: column;
    }
    
    .quiz-navigation button {
        max-width: 100%;
        width: 100%;
    }
}

/* Instructor Section */
.instructor-section {
    background: white;
    padding: 40px 20px;
    margin-top: 40px;
}

.instructor-section .container {
    max-width: 1400px;
    margin: 0 auto;
}

.instructor-section h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.instructors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.instructor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.instructor-avatar {
    font-size: 3rem;
    color: #0064A4;
    margin-bottom: 10px;
}

.instructor-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.instructor-info .instructor-title {
    color: #F47E3C;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.instructor-info .instructor-university {
    color: #0064A4;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.instructor-info .instructor-bio {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: left;
    margin-bottom: 15px;
}

.btn-contact {
    padding: 8px 16px;
    background: #0064A4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-contact:hover {
    background: #003366;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 100, 164, 0.3);
}

.instructor-section {
    background: #f9f9f9;
    padding: 60px 20px;
    margin-top: 40px;
}

.instructor-section .container {
    max-width: 1400px;
    margin: 0 auto;
}

.instructor-section h3 {
    text-align: center;
    font-size: 2rem;
    color: #0064A4;
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.auth-form h3 {
    margin-bottom: 20px;
    text-align: center;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.auth-form button {
    width: 100%;
}

.auth-form p {
    text-align: center;
    margin-top: 15px;
}

.auth-form a {
    color: #0064A4;
    text-decoration: none;
}

/* Contact Form Styles */
.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.contact-form select,
.contact-form input[type="text"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: border-color 0.3s;
}

.contact-form select:focus,
.contact-form input[type="text"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #0064A4;
    box-shadow: 0 0 0 3px rgba(0, 100, 164, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form select {
    cursor: pointer;
    background-color: white;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 1024px) {
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .course-outline {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        max-height: 100vh;
        width: 350px;
        z-index: 98;
        transform: translateX(100%);
        border-radius: 0;
        box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    }
    
    .course-outline.show {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .instructors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-player {
        padding-bottom: 56.25%; /* Maintain 16:9 aspect ratio */
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .sidebar-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        top: 65px;
        right: 15px;
    }
    
    .course-outline {
        width: 100%;
        max-width: 350px;
    }
    
    .nav-container {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-right {
        gap: 10px;
    }
    
    .progress-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .user-details {
        display: none;
    }
    
    .main-content {
        padding: 0 10px;
        margin: 10px auto;
    }
    
    .video-section {
        border-radius: 8px;
    }
    
    .video-info h1 {
        font-size: 1.1rem;
    }
    
    .video-meta {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .description-box {
        padding: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        padding: 15px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 12px;
    }
    
    .course-outline {
        padding: 15px;
        border-radius: 8px;
    }
    
    .course-outline h3 {
        font-size: 1.1rem;
    }
    
    .module-section-header {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .module-item {
        padding: 10px;
        padding-left: 30px;
    }
    
    .instructors-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .instructor-card {
        padding: 15px;
    }
    
    .instructor-avatar {
        font-size: 2.5rem;
    }
    
    .quiz-container {
        padding: 20px;
    }
    
    .quiz-actions {
        flex-direction: column;
    }
    
    .quiz-actions button {
        width: 100%;
    }
    
    .certificate-card i {
        font-size: 2rem;
    }
    
    .modal-content {
        padding: 25px;
        width: 95%;
    }
    
    .auth-form input {
        padding: 10px;
        font-size: 14px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }
    
    .progress-badge {
        display: none;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .video-info h1 {
        font-size: 1rem;
    }
    
    .module-section-header .section-title {
        font-size: 0.85rem;
    }
    
    .module-item .module-title {
        font-size: 0.85rem;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 0.9rem;
        padding: 10px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .video-player {
        padding-bottom: 45%; /* Adjust for landscape */
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .main-content {
        max-width: 1600px;
    }
    
    .video-player {
        padding-bottom: 50%; /* Slightly different ratio for large screens */
    }
}

/* Print styles */
@media print {
    .top-nav,
    .action-buttons,
    .auth-btn,
    .btn-logout,
    .modal {
        display: none !important;
    }
    
    .main-content {
        display: block;
    }
    
    .video-section,
    .course-outline {
        page-break-inside: avoid;
    }
}

/* Notification */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    background: #0064A4;
    color: white;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s;
    max-width: 400px;
    font-size: 0.9rem;
}

.notification.error {
    background: #ef4444;
}

.notification.success {
    background: #10b981;
}

.notification.info {
    background: #0064A4;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Quiz History Section */
.quiz-history-section {
    margin-top: 40px;
    padding: 30px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.quiz-history-section h3 {
    color: #0064A4;
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-history-section h3 i {
    font-size: 1.4rem;
}

.history-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.quiz-history-table {
    overflow-x: auto;
    margin-bottom: 25px;
}

.quiz-history-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quiz-history-table thead {
    background: linear-gradient(135deg, #0064A4 0%, #003366 100%);
    color: white;
}

.quiz-history-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-history-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
}

.quiz-history-table tbody tr {
    transition: background-color 0.2s;
}

.quiz-history-table tbody tr:hover {
    background-color: #f9fafb;
}

.quiz-history-table tbody tr:last-child td {
    border-bottom: none;
}

.quiz-history-table tbody tr.best-attempt {
    background-color: #fef3c7;
}

.quiz-history-table tbody tr.best-attempt:hover {
    background-color: #fde68a;
}

.best-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.status-passed {
    color: #10b981;
    font-weight: 600;
}

.status-failed {
    color: #ef4444;
    font-weight: 600;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 100, 164, 0.15);
}

.stat-item i {
    font-size: 1.8rem;
    color: #0064A4;
}

.stat-item span {
    font-size: 0.9rem;
    color: #6b7280;
}

.stat-item strong {
    color: #0064A4;
    font-size: 1.1rem;
}

/* Responsive Quiz History */
@media (max-width: 768px) {
    .quiz-history-section {
        padding: 20px;
        margin-top: 30px;
    }
    
    .quiz-history-section h3 {
        font-size: 1.2rem;
    }
    
    .quiz-history-table {
        font-size: 0.85rem;
    }
    
    .quiz-history-table th,
    .quiz-history-table td {
        padding: 10px 8px;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-item i {
        font-size: 1.5rem;
    }
    
    .best-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .quiz-history-table table {
        font-size: 0.75rem;
    }
    
    .quiz-history-table th,
    .quiz-history-table td {
        padding: 8px 5px;
    }
    
    .quiz-history-section h3 {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
