/**
 * Standards Subject Selector Styles
 * 
 * PURPOSE: Clean UX for Standards Tracker subject selection
 * LOCATION: /plugins/teacherai-simple/assets/css/standards-subject-selector.css
 * 
 * COMPONENTS:
 * - Subject button grid (5x2, responsive)
 * - Detail pane with header, progress, categories
 * - Category collapsibles
 * - Individual standard items (covered/uncovered states)
 * 
 * NAMING CONVENTION:
 * - .subject-btn-* for button grid elements
 * - .detail-* for detail pane elements
 * - .category-* for category collapsibles
 * - .std-* for individual standards
 * 
 * All class names are specific to avoid conflicts with existing platform CSS.
 * 
 * CREATED: Claude 248 + Tony | January 14, 2026
 * TEAM TEACHAI FOREVER! 💜
 */

/* =============================================================================
   SUBJECT SELECTOR CONTAINER
   ============================================================================= */

.subject-selector {
    margin-bottom: 2rem;
}

/* =============================================================================
   SUBJECT BUTTON GRID
   5 columns on desktop, 3 on tablet, 2 on mobile
   ============================================================================= */

.subject-button-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .subject-button-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 700px) {
    .subject-button-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .subject-button-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================================
   SUBJECT BUTTONS
   Default, hover, active, started, complete states
   ============================================================================= */

.subject-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.875rem 0.5rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 80px;
}

.subject-btn:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.subject-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3);
}

/* Active state - currently selected */
.subject-btn--active {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

/* Started state - has some coverage but not complete */
.subject-btn--started {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
}

.subject-btn--started:hover {
    border-color: #f59e0b;
}

/* Complete state - 100% coverage */
.subject-btn--complete {
    border-color: #22c55e;
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.subject-btn--complete:hover {
    border-color: #16a34a;
}

/* Button inner elements */
.subject-btn-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.subject-btn-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.subject-btn-progress {
    font-size: 0.625rem;
    font-weight: 500;
    color: #6b7280;
}

.subject-btn--started .subject-btn-progress {
    color: #b45309;
}

.subject-btn--complete .subject-btn-progress {
    color: #16a34a;
    font-weight: 700;
}

/* =============================================================================
   DETAIL PANE
   Shows when a subject is selected
   ============================================================================= */

.subject-detail-pane {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Empty state before selection */
.subject-detail-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #6b7280;
}

.subject-detail-empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subject-detail-empty p {
    margin: 0;
    font-size: 0.9375rem;
}

/* Empty state after selection (no standards found) */
.detail-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.detail-empty p {
    margin: 0 0 0.5rem 0;
}

.detail-empty-hint {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Error state */
.detail-error {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
}

.detail-error p {
    margin: 0;
}

/* =============================================================================
   DETAIL HEADER
   Subject name, icon, stats
   ============================================================================= */

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.detail-header--complete {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
    border-bottom-color: #bbf7d0;
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.detail-subject {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.detail-trophy {
    font-size: 1.25rem;
    margin-left: 0.25rem;
}

.detail-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-count {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
}

.detail-percentage {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0ea5e9;
}

.detail-header--complete .detail-percentage {
    color: #16a34a;
}

/* =============================================================================
   DETAIL PROGRESS BAR
   ============================================================================= */

.detail-progress {
    height: 8px;
    background: #e2e8f0;
}

.detail-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
    transition: width 0.5s ease;
    border-radius: 0 4px 4px 0;
}

.detail-progress-bar--complete {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

/* =============================================================================
   CATEGORY BLOCKS
   Collapsible sections within detail pane
   ============================================================================= */

.detail-categories {
    padding: 1rem;
}

.category-block {
    margin-bottom: 0.5rem;
}

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

/* Category toggle button */
.category-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    font-family: inherit;
    font-size: 0.875rem;
}

.category-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.category-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
}

.category-toggle--complete {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.03) 100%);
    border-color: #86efac;
}

.category-toggle--expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.category-arrow {
    font-size: 0.75rem;
    color: #94a3b8;
    width: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.category-name {
    flex: 1;
    font-weight: 600;
    color: #374151;
}

.category-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.category-check {
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

/* Category content (standards list) */
.category-content {
    display: none;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* =============================================================================
   INDIVIDUAL STANDARDS
   Covered vs uncovered states
   ============================================================================= */

.std-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: background 0.15s ease;
}

.std-item:last-child {
    margin-bottom: 0;
}

.std-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

.std-check {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.4;
}

.std-code {
    flex-shrink: 0;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #6366f1;
    background: #eef2ff;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.std-desc {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

/* ----- Covered State ----- */
.std-item--covered {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.02) 100%);
    border-left: 3px solid #22c55e;
    padding-left: calc(0.625rem - 3px);
}

.std-item--covered:hover {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
}

.std-item--covered .std-check {
    color: #22c55e;
}

.std-item--covered .std-code {
    background: #dcfce7;
    color: #15803d;
}

.std-item--covered .std-desc {
    color: #374151;
    font-weight: 500;
}

/* ----- Uncovered State ----- */
.std-item--uncovered {
    opacity: 0.7;
}

.std-item--uncovered:hover {
    opacity: 1;
    background: #ffffff;
}

.std-item--uncovered .std-check {
    color: #d1d5db;
}

.std-item--uncovered .std-code {
    background: #f3f4f6;
    color: #9ca3af;
}

.std-item--uncovered .std-desc {
    color: #9ca3af;
}

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

@media (max-width: 600px) {
    .detail-header {
        padding: 1rem;
    }
    
    .detail-subject {
        font-size: 1.125rem;
    }
    
    .detail-percentage {
        font-size: 1.25rem;
    }
    
    .detail-categories {
        padding: 0.75rem;
    }
    
    .category-toggle {
        padding: 0.625rem 0.75rem;
    }
    
    .std-code {
        font-size: 0.625rem;
    }
    
    .std-desc {
        font-size: 0.75rem;
    }
}
