/**
 * OzCopilot - Interactive Checklist Demo Styles
 * Styles for the aviation checklist UI component
 */

/* ==========================================================================
   0. SCROLL-TRIGGERED FADE-IN ANIMATION
   ========================================================================== */

.checklist-demo-wrapper {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.checklist-demo-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   1. CONTAINER
   ========================================================================== */

.cl-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

/* ==========================================================================
   2. SECTION STYLES
   ========================================================================== */

.cl-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cl-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cl-section-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cl-section-icon {
    width: 28px;
    height: 28px;
    background: #0ea5e9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cl-section-name {
    color: white;
    font-size: 11px;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-section-progress {
    color: #94a3b8;
    font-size: 9px;
    flex-shrink: 0;
}

.cl-chevron {
    color: #64748b;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.cl-section-items.expanded + .cl-section-header .cl-chevron,
.cl-section:has(.cl-section-items.expanded) .cl-chevron {
    transform: rotate(180deg);
}

.cl-section-items {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
}

.cl-section-items.expanded {
    max-height: 500px;
    opacity: 1;
}

/* ==========================================================================
   3. EMERGENCY SECTION
   ========================================================================== */

[data-emergency="true"] {
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(127, 29, 29, 0.2);
}

[data-emergency="true"] .cl-section-icon {
    background: #ef4444;
}

/* ==========================================================================
   4. ITEM STYLES
   ========================================================================== */

.cl-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

.cl-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cl-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid rgba(100, 116, 139, 0.5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-right: 10px;
    margin-top: 1px;
}

.cl-checkmark {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    color: white;
    font-size: 12px;
}

.cl-item-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.cl-item-label {
    color: white;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.cl-item-action {
    color: #fbbf24;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.cl-critical {
    display: none;
    color: #fbbf24;
    flex-shrink: 0;
    font-size: 16px;
    margin-left: 8px;
    margin-top: 1px;
}

.cl-item[data-critical="true"] .cl-critical {
    display: block;
}

/* ==========================================================================
   5. CHECKED STATE
   ========================================================================== */

.cl-item.checked {
    background: rgba(16, 185, 129, 0.12);
    animation: item-check 0.3s ease-out;
}

@keyframes item-check {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.cl-item.checked .cl-checkbox {
    background: #10b981;
    border-color: #10b981;
}

.cl-item.checked .cl-checkmark {
    opacity: 1;
    transform: scale(1);
}

.cl-item.checked .cl-item-label {
    color: #5eead4;
}

.cl-item.checked .cl-item-action {
    color: #34d399;
}
