/* Modern Premium Course Viewer Styles */

/* ============================================
   5-ZONE LAYOUT GRID
   ============================================ */
.modern-course-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 1fr auto;
    gap: 24px;
    min-height: calc(100vh - 120px);
}

/* Zone 1: Course Progress Sidebar (Left) */
.course-progress-sidebar {
    grid-column: 1;
    grid-row: 1 / -1;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.progress-tracker-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.progress-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.progress-bar-modern,
.progress-bar-large {
    width: 100%;
    height: 12px;
    background: #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill-modern,
.progress-fill-large {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #8B5CF6 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-percentage-large,
.progress-percentage {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
}

/* Modern Module List */
.modules-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.module-item-modern {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.module-item-modern:hover:not(.locked):not(.active) {
    background: var(--bg-secondary);
}

.module-item-modern.active {
    background: linear-gradient(135deg, #F3F4F6 0%, #FFFFFF 100%);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.module-item-modern.completed {
    opacity: 0.85;
}

.module-item-modern.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F9FAFB;
}

.module-status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.module-item-modern.completed .module-status-icon {
    background: #10B981;
    color: white;
}

.module-item-modern.active .module-status-icon {
    background: var(--primary);
    color: white;
}

.module-item-modern.locked .module-status-icon {
    background: #E5E7EB;
    color: #9CA3AF;
}

.module-title-modern {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.module-item-modern.locked .module-title-modern {
    color: #9CA3AF;
}

.module-meta-modern {
    font-size: 12px;
    color: var(--text-muted);
}

.unlock-section,
.unlock-course-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn-unlock,
.btn-unlock-course {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-unlock-course:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Zone 2: Lesson View Area (Main Content) */
.lesson-view-area {
    grid-column: 2;
    grid-row: 1;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 48px;
    border: 1px solid var(--border-color);
    min-height: 600px;
}

.module-content-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Modern Module Content Structure */
.module-header-modern {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.module-title-modern-large {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.module-meta-modern-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    align-items: center;
}

/* Learning Goals Card */
.learning-goals-card {
    background: linear-gradient(135deg, #F0F9FF 0%, #FFFFFF 100%);
    border: 2px solid #3B82F6;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 32px;
}

.learning-goals-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.learning-goals-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.learning-goals-list li {
    padding: 10px 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    position: relative;
    padding-left: 24px;
}

.learning-goals-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3B82F6;
    font-size: 24px;
    line-height: 1;
}

/* Key Concepts Mini-Cards */
.key-concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.key-concept-card {
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s ease;
}

.key-concept-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.key-concept-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.key-concept-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Action Items Checklist */
.action-items-section {
    background: #FFF7ED;
    border: 2px solid #F59E0B;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 40px;
}

.action-items-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-item-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
}

.action-item-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.action-item-checkbox label {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
}

.action-item-checkbox input[type="checkbox"]:checked + label {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Premium Reading Content */
.module-content-premium {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.9;
    font-size: 17px;
    color: #1F2937;
    max-width: 800px;
    margin: 0 auto;
}

.module-content-premium h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.module-content-premium h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 16px;
}

.module-content-premium h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
}

.module-content-premium p {
    margin-bottom: 20px;
    line-height: 1.9;
}

.module-content-premium ul,
.module-content-premium ol {
    margin: 20px 0;
    padding-left: 28px;
}

.module-content-premium li {
    margin-bottom: 12px;
    line-height: 1.8;
}

/* Zone 3 & 4: Learning Tools Row (Bottom) */
.learning-tools-row {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

/* Zone 3: AI Tutor Panel */
.ai-tutor-panel {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 500px;
}

.ai-tutor-header-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-tutor-header-panel:hover {
    background: linear-gradient(135deg, #6D28D9 0%, #9333EA 100%);
}

.tutor-icon-large {
    font-size: 24px;
}

.tutor-title-text {
    flex: 1;
}

.tutor-name-large {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.tutor-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.tutor-collapse-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-tutor-body-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.tutor-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 200px;
    max-height: 300px;
}

.tutor-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.tutor-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.tutor-send-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutor-send-btn:hover {
    background: #6D28D9;
}

.ai-tutor-panel.collapsed .ai-tutor-body-panel {
    display: none;
}

/* Zone 4: Resources Panel */
.resources-panel {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

.resources-header-panel {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.resources-header-panel h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.resource-section-item {
    margin-bottom: 24px;
}

.resource-section-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.resource-item:hover {
    border-color: var(--primary);
    background: #F9FAFB;
}

.resource-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* Text Selection Menu */
.text-selection-menu {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 10000;
    display: flex;
    gap: 4px;
}

.selection-action-btn {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Completion Reward Modal */
.completion-reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.completion-modal-content {
    background: white;
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.completion-icon-large {
    font-size: 64px;
    margin-bottom: 16px;
}

.completion-modal-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.completion-message {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Module Navigation */
.module-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--border-color);
    gap: 16px;
}

.module-navigation button {
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.module-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Resources Panel Styles */
.resource-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.resource-item:hover {
    border-color: var(--primary);
    background: #F9FAFB;
}

.resource-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: block;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .modern-course-layout {
        grid-template-columns: 280px 1fr;
    }
    
    .learning-tools-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .modern-course-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .course-progress-sidebar {
        grid-column: 1;
        grid-row: 1;
        position: relative;
        max-height: none;
    }
    
    .lesson-view-area {
        grid-column: 1;
        grid-row: 2;
    }
    
    .learning-tools-row {
        grid-column: 1;
        grid-row: 3;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lesson-view-area {
        padding: 24px;
    }
    
    .module-title-modern-large {
        font-size: 28px;
    }
    
    .key-concepts-grid {
        grid-template-columns: 1fr;
    }
}

