/* frontend2/js/lex/lex-content-player.css */
/* LEx Content Player Styles */

:root {
    --lex-sidebar-width: 320px;
    --lex-header-height: 70px;
    --lex-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== CONTAINER ==================== */

lex-content-player {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: white;
}

lex-content-player.active {
    display: block;
}

.lex-player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-color, #ffffff);
}

/* ==================== HEADER ==================== */

.lex-player-header {
    height: var(--lex-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: linear-gradient(135deg, rgba(139, 126, 200, 0.1), rgba(127, 176, 105, 0.1));
    border-bottom: 2px solid var(--border-color, #dee2e6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.header-left,
.header-right {
    flex: 0 0 200px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.unit-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-close-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark, #212529);
    transition: var(--lex-transition);
}

.btn-close-player:hover {
    background: var(--gray-light, #f8f9fa);
    border-color: var(--primary-purple, #8B7EC8);
    color: var(--primary-purple, #8B7EC8);
}

.unit-progress {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==================== MAIN CONTENT AREA ==================== */

.lex-player-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ==================== SIDEBAR ==================== */

.lex-sidebar {
    width: var(--lex-sidebar-width);
    background: var(--bg-alt, #f8f9fa);
    border-right: 1px solid var(--border-color, #dee2e6);
    overflow-y: auto;
    transition: var(--lex-transition);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.lex-sidebar.collapsed {
    width: 0;
    border-right: none;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    color: var(--text-muted, #6c757d);
    transition: var(--lex-transition);
}

.btn-toggle-sidebar:hover {
    color: var(--primary-purple, #8B7EC8);
}

.sidebar-section {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Learning Outcomes in Sidebar */
.outcomes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.outcomes-list li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-dark, #212529);
}

.outcomes-list li::before {
    content: '✓ ';
    color: var(--primary-green, #7FB069);
    font-weight: 600;
}

/* Blocks List in Sidebar */
.blocks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.block-item {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--lex-transition);
}

.block-item:hover {
    background: linear-gradient(135deg, rgba(139, 126, 200, 0.05), rgba(127, 176, 105, 0.05));
    border-color: var(--primary-purple, #8B7EC8);
}

.block-item.active {
    background: linear-gradient(135deg, rgba(139, 126, 200, 0.1), rgba(127, 176, 105, 0.1));
    border-color: var(--primary-purple, #8B7EC8);
    border-width: 2px;
    font-weight: 600;
}

.block-item.completed {
    opacity: 0.7;
}

.block-item.completed .block-icon {
    opacity: 0.6;
}

.block-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-light, #e9ecef);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
}

.block-item.active .block-number {
    background: var(--primary-purple, #8B7EC8);
    color: white;
}

.block-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.block-info {
    flex: 1 1 120px;
    min-width: 80px;
}

.block-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark, #212529);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.block-meta {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.block-status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--primary-green, #7FB069);
}

.required-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: auto;
}

/* ==================== CONTENT AREA ==================== */

.lex-player-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#contentPlayerEngine {
    width: 100%;
    height: 100%;
}

/* ==================== OUTCOMES OVERLAY ==================== */

.outcomes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.overlay-content {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.overlay-content h2 {
    margin: 0 0 1rem 0;
    color: var(--primary-purple, #8B7EC8);
    font-size: 1.75rem;
}

.overlay-content h3 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-dark, #212529);
}

.overlay-body {
    margin-bottom: 2rem;
}

.overlay-body .outcomes-list {
    padding-left: 0;
}

.overlay-body .outcomes-list li {
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--gray-light, #f8f9fa);
}

.overlay-body .outcomes-list li:last-child {
    border-bottom: none;
}

#btnStartLearning {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--lex-transition);
}

#btnStartLearning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 126, 200, 0.4);
}

/* ==================== ERROR STATE ==================== */

.lex-error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-alt, #f8f9fa);
}

.error-content {
    text-align: center;
    padding: 3rem;
    max-width: 500px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-content h2 {
    color: var(--text-dark, #212529);
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-muted, #6c757d);
    margin-bottom: 2rem;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1200px) {
    :root {
        --lex-sidebar-width: 280px;
    }
}

@media (max-width: 1024px) {
    :root {
        --lex-sidebar-width: 260px;
    }

    .header-left,
    .header-right {
        flex: 0 0 150px;
    }

    .unit-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .lex-player-header {
        padding: 0 1rem;
        height: 60px;
    }

    .header-left,
    .header-right {
        flex: 0 0 auto;
    }

    .unit-title {
        font-size: 1rem;
    }

    .btn-close-player {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .unit-progress {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Hide sidebar by default on mobile */
    .lex-sidebar {
        position: absolute;
        left: 0;
        top: var(--lex-header-height);
        height: calc(100vh - var(--lex-header-height));
        z-index: 100;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .lex-sidebar.collapsed {
        transform: translateX(-100%);
    }

    .overlay-content {
        padding: 2rem;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .overlay-content h2 {
        font-size: 1.5rem;
    }

    .overlay-content h3 {
        font-size: 1.1rem;
    }
}

/* ==================== NO DATA STATES ==================== */

.no-data {
    color: var(--text-muted, #6c757d);
    font-style: italic;
    font-size: 0.875rem;
}

/* ==================== UTILITY CLASSES ==================== */

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--lex-transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 126, 200, 0.3);
}

/* ==================== COMPLETION MODAL ==================== */

.completion-modal {
    text-align: center;
    padding: 2rem;
}

.completion-icon {
    font-size: 4rem;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-modal h3 {
    color: var(--text-dark, #212529);
    margin-bottom: 1rem;
}

.completion-modal p {
    color: var(--text-muted, #6c757d);
    margin-bottom: 2rem;
}

.completion-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==================== BLOCK CONTENT AREA ==================== */

.block-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.block-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted, #6c757d);
}

.block-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-light, #e9ecef);
    border-top-color: var(--primary-purple, #8B7EC8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.block-error {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted, #6c757d);
}

.no-blocks {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted, #6c757d);
    font-size: 1.1rem;
}

/* ==================== BLOCK NAVIGATION ==================== */

.block-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 3rem;
    background: var(--gray-light, #f8f9fa);
    border-top: 1px solid var(--border-color, #dee2e6);
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.block-counter {
    font-size: 1rem;
    color: var(--text-muted, #6c757d);
}

.block-counter #currentBlockNum {
    font-weight: 600;
    color: var(--primary-purple, #8B7EC8);
}

.btn-prev,
.btn-next {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-prev:disabled,
.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-prev:hover:not(:disabled),
.btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 126, 200, 0.2);
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

@media (max-width: 768px) {
    .block-content-area {
        padding: 1rem;
    }

    .block-navigation {
        padding: 1rem;
    }

    .btn-prev,
    .btn-next {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}
