/* =================================================================
   DECK BUILDER - LESSON PLAN EDITOR STYLES
   ================================================================= */

/* Toolbar */
.lesson-plan-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.lesson-plan-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-plan-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unsaved-badge {
    background: var(--warning);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unsaved-badge.hidden {
    display: none;
}

/* Container */
.lesson-plan-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Empty state */
.lesson-plan-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    text-align: center;
}

/* Unit Block */
.lp-unit-block {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-primary);
}

.lp-unit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
}

[data-theme="dark"] .lp-unit-header {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
}

.lp-unit-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.lp-unit-number {
    font-weight: 700;
    font-size: 15px;
}

.lp-unit-title {
    font-size: 15px;
    font-weight: 400;
    opacity: 0.95;
}

.lp-unit-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-unit-header-right .btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.lp-unit-header-right .btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.lp-unit-header-right .btn-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lp-unit-header-right .btn-outline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Unit collapse chevron */
.lp-unit-chevron {
    font-size: 12px;
    transition: transform 0.2s ease;
    transform: rotate(90deg);
    flex-shrink: 0;
}

.lp-unit-block.lp-collapsed .lp-unit-chevron {
    transform: rotate(0deg);
}

/* Lesson count badge (visible when collapsed) */
.lp-unit-lesson-count {
    font-size: 12px;
    font-weight: 400;
    opacity: 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.lp-unit-block.lp-collapsed .lp-unit-lesson-count {
    opacity: 1;
}

/* Collapsed state hides lesson table */
.lp-unit-block.lp-collapsed .lp-lesson-table {
    display: none;
}

/* Lesson Table */
.lp-lesson-table {
    width: 100%;
    border-collapse: collapse;
}

.lp-lesson-table thead th {
    background: var(--bg-secondary);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.lp-th-num { width: 60px; }
.lp-th-title { }
.lp-th-type { width: 120px; }
.lp-th-covers { width: 160px; }
.lp-th-actions { width: 90px; text-align: center !important; }

.lp-lesson-row td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

.lp-lesson-row:last-child td {
    border-bottom: none;
}

.lp-lesson-row:hover {
    background: var(--bg-hover, rgba(79, 70, 229, 0.04));
}

.lp-cell-num {
    font-weight: 600;
    color: var(--primary);
}

.lp-cell-covers {
    font-size: 13px;
    color: var(--text-secondary);
}

.lp-cell-actions {
    text-align: center;
}

.lp-cell-actions .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-size: 13px;
}

.lp-cell-actions .btn-icon:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.lp-cell-actions .lp-delete-lesson-btn:hover {
    color: var(--danger);
}

/* Type Badges */
.lp-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.lp-type-content {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.lp-type-review {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.lp-type-test {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

[data-theme="dark"] .lp-type-content {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

[data-theme="dark"] .lp-type-review {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

[data-theme="dark"] .lp-type-test {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Test & ACTFL indicator badges in lesson titles */
.lp-test-badge,
.lp-no-test-badge,
.lp-actfl-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.lp-test-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.lp-no-test-badge {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

.lp-actfl-badge {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

[data-theme="dark"] .lp-test-badge {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

[data-theme="dark"] .lp-actfl-badge {
    background: rgba(139, 92, 246, 0.25);
    color: #a78bfa;
}

/* Empty unit message */
.lp-empty-unit {
    text-align: center;
    padding: 24px 14px !important;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .lesson-plan-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .lesson-plan-toolbar-right {
        justify-content: flex-end;
    }

    .lp-unit-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lp-th-covers,
    .lp-cell-covers {
        display: none;
    }

    .lp-th-type { width: 100px; }
    .lp-th-actions { width: 70px; }
}
