/* delivery-mode.css */
/* Phase 2: Enhanced Lesson Delivery Styling */

/* ===== Delivery Container ===== */
.delivery-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.delivery-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--accent-orange);
}

.delivery-header h2 {
    font-size: 32px;
    margin: 0 0 8px 0;
}

.delivery-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

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

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ===== Section Navigation ===== */
.delivery-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-100);
}

.delivery-nav-item {
    padding: 16px 12px;
    background: var(--white);
    border: none;
    border-right: 1px solid var(--gray-200);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.delivery-nav-item:last-child {
    border-right: none;
}

.delivery-nav-item .nav-icon {
    font-size: 24px;
}

.delivery-nav-item .nav-label {
    font-size: 12px;
}

.delivery-nav-item:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--primary-bright);
}

.delivery-nav-item.active {
    background: var(--primary-bright);
    color: var(--white);
}

.delivery-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-orange);
}

.delivery-nav-item:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.delivery-nav-item.empty {
    opacity: 0.5;
}

/* ===== Section Header ===== */
.delivery-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
}

.delivery-section-header h3 {
    font-size: 24px;
    color: var(--primary-dark);
    margin: 0;
}

.btn-nav {
    padding: 10px 20px;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-nav:hover:not(:disabled) {
    background: var(--primary-bright);
    color: var(--white);
    border-color: var(--primary-bright);
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Main Content Area ===== */
.delivery-main {
    display: flex;
    flex: 1;
    min-height: 500px;
}

.delivery-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* ===== Content Sections ===== */
.starter-list,
.delivery-list {
    list-style: none;
    padding: 0;
}

.starter-list li,
.delivery-list li {
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.6;
    border-left: 4px solid var(--primary-bright);
    transition: all 0.2s;
}

.starter-list li:hover,
.delivery-list li:hover {
    background: var(--gray-200);
    transform: translateX(4px);
}

.delivery-content h4 {
    font-size: 22px;
    color: var(--primary-dark);
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-orange);
}

.delivery-content h4:first-child {
    margin-top: 0;
}

.empty-message {
    text-align: center;
    color: var(--gray-700);
    font-size: 16px;
    padding: 60px 20px;
}

.content-placeholder {
    text-align: center;
    padding: 60px 40px;
    background: var(--gray-100);
    border-radius: 12px;
    border: 2px dashed var(--gray-300);
}

.content-placeholder h4 {
    border: none;
    margin: 0 0 15px 0;
    padding: 0;
}

.content-placeholder p {
    margin: 10px 0;
    color: var(--gray-700);
}

/* ===== Content Slides ===== */
.content-slide {
    animation: slideIn 0.3s ease-out;
}

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

.slide-title {
    font-size: 32px;
    color: var(--primary-dark);
    margin: 0 0 30px 0;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--accent-orange);
}

.slide-blocks {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Content Blocks ===== */
.block {
    border-radius: 8px;
    padding: 20px;
    background: var(--white);
}

.block-text {
    font-size: 18px;
    line-height: 1.8;
    background: none;
    padding: 0;
}

.block-text p {
    margin: 0 0 16px 0;
}

.block-text p:last-child {
    margin-bottom: 0;
}

.block-text strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.block-text code {
    background: var(--gray-200);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
}

.block-code {
    background: var(--gray-900);
    padding: 0;
    overflow: hidden;
}

.block-code pre {
    margin: 0;
    padding: 20px;
    background: var(--gray-900);
    overflow-x: auto;
}

.block-code code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    color: #f8f8f2;
}

.block-bullets {
    background: none;
    padding: 0;
}

.block-bullets ul,
.block-bullets ol {
    margin: 0;
    padding-left: 30px;
}

.block-bullets li {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.block-bullets .checklist {
    list-style: none;
    padding-left: 0;
}

.block-bullets .checklist li::before {
    content: '☐ ';
    margin-right: 8px;
    color: var(--primary-bright);
    font-size: 20px;
}

.block-image {
    background: none;
    padding: 20px 0;
}

.block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.block-image-small {
    max-width: 400px;
}

.block-image-medium {
    max-width: 600px;
}

.block-image-large {
    max-width: 900px;
}

.block-image-full {
    max-width: 100%;
}

.block-video {
    background: none;
    padding: 20px 0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

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

.block-caption {
    text-align: center;
    font-size: 14px;
    color: var(--gray-700);
    margin-top: 12px;
    font-style: italic;
}

.block-unknown {
    background: var(--danger);
    color: var(--white);
    padding: 16px;
    border-radius: 8px;
    font-weight: 500;
}

/* ===== Slide Navigation ===== */
.slide-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--gray-200);
}

.btn-slide {
    padding: 12px 24px;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-slide:hover:not(:disabled) {
    background: var(--primary-bright);
    color: var(--white);
    border-color: var(--primary-bright);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-slide:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slide-counter {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

/* ===== Teacher Notes Panel ===== */
.teacher-notes-panel {
    width: 350px;
    background: var(--gray-100);
    border-left: 3px solid var(--accent-orange);
    display: flex;
    flex-direction: column;
}

.teacher-notes-header {
    padding: 20px;
    background: var(--primary-dark);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.teacher-notes-header h4 {
    margin: 0;
    font-size: 18px;
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.teacher-notes-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.teacher-notes-content pre {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-900);
    margin: 0;
}

/* ===== Actions Footer ===== */
.delivery-actions {
    padding: 20px 30px;
    background: var(--gray-100);
    border-top: 2px solid var(--gray-200);
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== Presentation Mode ===== */
.delivery-presentation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.delivery-presentation .delivery-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    font-size: 120%;
}

.delivery-presentation .slide-title {
    font-size: 48px;
    text-align: center;
}

.delivery-presentation .block-text {
    font-size: 24px;
}

.delivery-presentation .block-bullets li {
    font-size: 24px;
    margin-bottom: 20px;
}

.presentation-controls {
    padding: 20px;
    background: var(--gray-900);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.presentation-controls .btn-icon {
    border-color: rgba(255, 255, 255, 0.3);
}

.presentation-counter {
    font-size: 16px;
    font-weight: 500;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .teacher-notes-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .delivery-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .delivery-nav {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .delivery-nav-item .nav-label {
        display: none;
    }
    
    .delivery-main {
        flex-direction: column;
    }
    
    .teacher-notes-panel {
        width: 100%;
        border-left: none;
        border-top: 3px solid var(--accent-orange);
        max-height: 300px;
    }
    
    .delivery-section-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .slide-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .delivery-presentation .delivery-content {
        padding: 40px 20px;
    }
    
    .delivery-presentation .slide-title {
        font-size: 32px;
    }
    
    .delivery-presentation .block-text {
        font-size: 18px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .delivery-header-actions,
    .delivery-nav,
    .delivery-section-header,
    .slide-navigation,
    .delivery-actions,
    .teacher-notes-panel {
        display: none !important;
    }
    
    .delivery-content {
        padding: 20px;
    }
    
    .block {
        break-inside: avoid;
    }
}
