/**
 * ITAR Compliance Training - Course/Training Portal Styles
 * Fixed for mobile responsiveness
 */

:root {
    --primary-color: #003366;
    --secondary-color: #0066b2;
    --accent-color: #cc0000;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --light-bg: #f5f7fa;
    --dark-text: #333333;
    --light-text: #ffffff;
    --border-radius: 5px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.course-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.logo span {
    color: var(--accent-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-indicator {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.progress-indicator strong {
    color: var(--accent-color);
}

/* Course Container */
.course-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.course-sidebar {
    background: white;
    border-right: 1px solid #e5e5e5;
    padding: 30px 20px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.course-sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.module-nav {
    list-style: none;
}

.module-nav-item {
    margin-bottom: 10px;
}

.module-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark-text);
    transition: all 0.3s;
    cursor: pointer;
}

.module-nav-item.locked .module-link {
    opacity: 0.5;
    cursor: not-allowed;
}

.module-nav-item a.module-link:hover {
    background: var(--secondary-color);
    color: white;
}

.module-nav-item.active .module-link {
    background: var(--primary-color);
    color: white;
}

.module-nav-item.completed .module-link {
    background: #e8f5e9;
    border-left: 4px solid var(--success-color);
}

.module-number {
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.module-nav-item.active .module-number {
    background: white;
    color: var(--primary-color);
}

.module-title {
    flex: 1;
    font-size: 0.9rem;
}

.module-link i {
    margin-left: auto;
}

.completion-badge {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 30px;
}

.completion-badge i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.completion-badge p {
    margin: 10px 0;
    font-weight: bold;
}

.completion-badge .btn-primary {
    margin-top: 10px;
}

/* Main Content */
.course-main {
    padding: 40px;
    max-width: 1000px;
}

.locked-message {
    background: white;
    padding: 60px;
    border-radius: 10px;
    text-align: center;
}

.locked-message i {
    font-size: 4rem;
    color: var(--warning-color);
    margin-bottom: 20px;
}

.locked-message h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.locked-message p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Module Content */
.module-content {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.module-header {
    margin-bottom: 30px;
}

.module-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.module-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.module-duration {
    background: var(--light-bg);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
}

.module-duration i {
    margin-right: 5px;
}

.module-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.module-description {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Video Section */
.video-section {
    margin: 30px 0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.video-placeholder i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.video-placeholder p {
    margin: 5px 0;
}

.small-text {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Module Topics */
.module-topics-section {
    margin: 40px 0;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 10px;
}

.module-topics-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.topics-list {
    list-style: none;
}

.topics-list li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    border-bottom: 1px solid #e0e0e0;
}

.topics-list li:last-child {
    border-bottom: none;
}

.topics-list li i {
    position: absolute;
    left: 0;
    color: var(--success-color);
}

/* Quiz Section */
.quiz-section {
    margin-top: 40px;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 10px;
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.quiz-header h2 i {
    margin-right: 10px;
    color: var(--accent-color);
}

.quiz-header p {
    color: #666;
    margin: 5px 0;
}

.quiz-info {
    background: #e3f2fd;
    padding: 10px;
    border-radius: var(--border-radius);
    color: #1976d2;
    font-size: 0.9rem;
}

.quiz-form {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-question {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.quiz-question h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.question-text {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.option-label:hover {
    background: #e3f2fd;
    border-color: var(--secondary-color);
}

.option-label input[type="radio"] {
    margin-right: 15px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

/* Quiz Results */
.quiz-results {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-top: 20px;
}

.result-header {
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.result-header.passed {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    color: white;
}

.result-header.failed {
    background: linear-gradient(135deg, var(--error-color) 0%, #d32f2f 100%);
    color: white;
}

.result-header i {
    font-size: 4rem;
    margin-bottom: 15px;
}

.result-header h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.result-score {
    font-size: 3rem;
    font-weight: bold;
    margin: 15px 0;
}

.result-message {
    font-size: 1.1rem;
    opacity: 0.9;
}

.result-details {
    margin: 30px 0;
}

.detail-item {
    padding: 20px;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    border-left: 4px solid transparent;
}

.detail-item.correct {
    border-left-color: var(--success-color);
    background: #e8f5e9;
}

.detail-item.incorrect {
    border-left-color: var(--error-color);
    background: #ffebee;
}

.detail-question {
    font-weight: bold;
    margin-bottom: 10px;
}

.detail-answer {
    margin: 5px 0;
    font-size: 0.95rem;
}

.detail-answer.correct-answer {
    color: var(--success-color);
    font-weight: bold;
}

.detail-explanation {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* Module Navigation */
.module-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e5e5e5;
    gap: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
    .course-container {
        grid-template-columns: 250px 1fr;
    }

    .course-sidebar {
        padding: 20px 15px;
    }

    .course-main {
        padding: 30px 20px;
    }

    .module-content {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    /* CRITICAL FIX: Prevent header overlap on mobile */
    body {
        padding-top: 0;
    }

    .course-header {
        padding: 12px 0;
    }

    .logo {
        font-size: 16px;
    }

    .progress-indicator {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .course-container {
        grid-template-columns: 1fr;
        margin-top: 0;
    }

    .course-sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        top: 0;
        padding: 20px;
    }

    /* MAIN FIX: Add top padding to prevent overlap */
    .course-main {
        padding: 30px 20px 20px 20px;
    }

    .module-content {
        padding: 25px 15px;
    }

    .module-header h1 {
        font-size: 1.5rem;
    }

    .module-description {
        font-size: 1rem;
    }

    .video-section {
        margin: 20px 0;
    }

    .module-topics-section {
        padding: 20px;
    }

    .quiz-section {
        padding: 20px;
    }

    .quiz-question {
        padding: 20px;
    }

    .question-text {
        font-size: 1rem;
    }

    .module-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .locked-message {
        padding: 40px 20px;
    }

    .locked-message i {
        font-size: 3rem;
    }

    .result-header {
        padding: 25px 15px;
    }

    .result-header i {
        font-size: 3rem;
    }

    .result-header h3 {
        font-size: 1.5rem;
    }

    .result-score {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo {
        font-size: 14px;
    }

    .progress-indicator {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .course-main {
        padding: 20px 10px;
    }

    .module-content {
        padding: 20px 10px;
    }

    .module-header h1 {
        font-size: 1.3rem;
    }

    .module-meta {
        flex-direction: column;
        gap: 8px;
    }

    .quiz-question {
        padding: 15px;
    }

    .option-label {
        padding: 12px;
    }

    .btn-large {
        padding: 12px 25px;
        font-size: 1rem;
    }
}