/* ============================================================================
   Studio Demo - Specific Overrides
   
   This file contains styles specific only to the studio demo.
   Keep this file minimal - most styles should be in design-system.css
   ============================================================================ */

/* Dashboard Enhancements */
.kpi-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.highlight-card {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE8D6 100%);
    border: 2px solid var(--brand-primary);
}

.revenue-highlight {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-microcopy {
    font-size: 0.75rem;
    color: #D2691E;
    font-weight: 600;
    margin-top: 0.5rem;
}

.kpi-meta {
    font-size: 0.875rem;
    color: #707070;
    margin-top: 0.25rem;
}

.performance-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #F0FDF4 0%, #D1FAE5 100%);
    border: 2px solid #10B981;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.banner-icon {
    font-size: 1.5rem;
}

.banner-text {
    font-size: 1rem;
    font-weight: 600;
    color: #065F46;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.action-btn-primary,
.action-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    border: none;
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #FFA500 100%);
    color: white;
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(210, 105, 30, 0.3);
}

.action-btn-secondary {
    background: white;
    border: 2px solid #E0E0E0;
    color: var(--brand-text);
}

.action-btn-secondary:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-bg);
}

.btn-icon {
    font-size: 1.25rem;
}

/* Calendar Filters */
.calendar-filters {
    margin: 1.5rem 0;
    background: var(--brand-white);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-lg);
    overflow: visible;
    transition: all var(--motion-duration-fast) ease;
}

.calendar-filters:hover {
    border-color: rgba(210, 105, 30, 0.3);
    box-shadow: var(--shadow-sm);
}

.filter-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--space-lg);
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--brand-text);
    transition: all var(--motion-duration-fast) ease;
    border-radius: var(--radius-lg);
}

.filter-toggle-btn:hover {
    background: var(--brand-bg);
}

.filter-toggle-btn.active {
    background: linear-gradient(135deg, var(--brand-bg) 0%, #FFE8D6 100%);
}

.filter-toggle-btn .chevron {
    margin-left: auto;
    transition: transform var(--motion-duration) var(--motion-easing);
    flex-shrink: 0;
    color: var(--brand-primary);
}

.filter-toggle-btn.active .chevron {
    transform: rotate(180deg);
}

.filters-panel {
    padding: var(--space-lg);
    border-top: 2px solid #F0F0F0;
    background: linear-gradient(to bottom, #FAFAFA 0%, var(--brand-white) 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Selected Filter Tags (inline in header) */
.selected-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1;
    margin-left: 0.5rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: #D2691E;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.filter-tag-remove {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-tag-remove:hover {
    opacity: 1;
}

.filter-tag-remove svg {
    width: 14px;
    height: 14px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filter-group-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Multiselect Dropdown */
.multiselect-dropdown {
    position: relative;
}

.multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--brand-white);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--motion-duration-fast) ease;
}

.multiselect-trigger:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.multiselect-dropdown.open .multiselect-trigger {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1);
}

.multiselect-trigger svg {
    transition: transform var(--motion-duration) var(--motion-easing);
    flex-shrink: 0;
    color: var(--brand-primary);
}

.multiselect-dropdown.open .multiselect-trigger svg {
    transform: rotate(180deg);
}

.multiselect-placeholder {
    color: var(--brand-text-light);
    font-size: var(--font-size-sm);
}

.multiselect-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--brand-white);
    border: 2px solid var(--brand-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.multiselect-dropdown.open .multiselect-options {
    display: block;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    user-select: none;
    transition: all var(--motion-duration-fast) ease;
}

.multiselect-option:hover {
    background: var(--brand-bg);
}

.multiselect-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.multiselect-option span {
    color: var(--brand-text);
    font-size: var(--font-size-sm);
    flex: 1;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
    padding: var(--space-xs) 0;
    transition: all var(--motion-duration-fast) ease;
}

.filter-checkbox:hover {
    color: var(--brand-primary);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.filter-checkbox span {
    color: var(--brand-text);
    font-size: var(--font-size-sm);
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 2px solid #F0F0F0;
}

.filter-actions .btn-primary,
.filter-actions .btn-secondary {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--motion-duration-fast) ease;
}

.filter-actions .btn-primary {
    background: var(--brand-primary);
    color: var(--brand-white);
    border-color: var(--brand-primary);
}

.filter-actions .btn-primary:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.3);
    transform: translateY(-1px);
}

.filter-actions .btn-secondary {
    background: var(--brand-white);
    color: var(--brand-text-light);
    border-color: #E0E0E0;
}

.filter-actions .btn-secondary:hover {
    background: var(--brand-bg);
    border-color: var(--brand-primary);
    color: var(--brand-text);
}

/* Class list items with status colors - use vibrant colors when active */
#classesList .student-list-item.active {
    border-width: 3px !important;
    border-style: solid !important;
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.25);
    transform: translateY(-3px);
}

/* Active class with green status (confirmed/active) */
#classesList .student-list-item.active[style*="#BBF7D0"],
#classesList .student-list-item.active[style*="#bbf7d0"] {
    border-color: #22C55E !important;
    background: #F0FDF4 !important;
}

/* Active class with orange status (pending/soft-hold) */
#classesList .student-list-item.active[style*="#FDCFA6"],
#classesList .student-list-item.active[style*="#fdcfa6"] {
    border-color: #F97316 !important;
    background: #FFF8F0 !important;
}

/* Active class with blue status (competing) */
#classesList .student-list-item.active[style*="#BFDBFE"],
#classesList .student-list-item.active[style*="#bfdbfe"] {
    border-color: #3B82F6 !important;
    background: #EFF6FF !important;
}

/* ============================================================================
   Availability Heat Map for Space Details
   ============================================================================ */

.availability-heatmap {
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.heatmap-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: linear-gradient(to bottom, #FAFAFA, #F5F5F5);
    border-bottom: 2px solid #E5E5E5;
}

.heatmap-day-label {
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-weight: 700;
    font-size: 0.75rem;
    color: #2C2C2C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heatmap-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid #F0F0F0;
}

.heatmap-row:last-child {
    border-bottom: none;
}

.heatmap-row:hover {
    background: rgba(210, 105, 30, 0.02);
}

.heatmap-time-label {
    padding: 0.5rem;
    text-align: right;
    font-size: 0.7rem;
    color: #707070;
    font-weight: 600;
    background: #FAFAFA;
    border-right: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.heatmap-cell {
    min-height: 36px;
    cursor: pointer;
    border-right: 1px solid #F5F5F5;
    transition: all 0.2s ease;
    position: relative;
}

.heatmap-cell:last-child {
    border-right: none;
}

.heatmap-cell.available {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.heatmap-cell.occupied {
    background: #E5E7EB;
}

.heatmap-cell:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.heatmap-cell.available:hover {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.heatmap-cell.occupied:hover {
    background: #9CA3AF;
    color: white;
}

.heatmap-cell:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #2C2C2C;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.heatmap-cell:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2C2C2C;
    z-index: 100;
    pointer-events: none;
}

.heatmap-cell.closed {
    background: #F9FAFB;
    cursor: not-allowed;
}

.heatmap-cell.closed:hover {
    transform: none;
    box-shadow: none;
    background: #F9FAFB;
}

/* Availability Hours Modal Styles */
.availability-hours-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #F0F0F0;
}

.availability-hours-row:last-child {
    border-bottom: none;
}

.day-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.day-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.day-name {
    font-weight: 600;
    color: #2C2C2C;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.closed-label {
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

/* Active class with gray status (default) */
#classesList .student-list-item.active[style*="#E0E0E0"],
#classesList .student-list-item.active[style*="#e0e0e0"] {
    border-color: #71717A !important;
    background: #FAFAFA !important;
}

/* ============================================================================
   Modal Styles
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

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

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid #E5E5E5;
}

/* Availability Hours Form Styles */
.availability-hours-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #F5F5F5;
}

.availability-hours-row:last-of-type {
    border-bottom: none;
}

.day-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.day-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.day-name {
    font-weight: 500;
    color: #2C2C2C;
}

.time-inputs {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.time-inputs input[type="time"] {
    flex: 1;
    min-width: 0;
}

.closed-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2C2C2C;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: #707070;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2C2C2C;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #F0F0F0;
}

.btn-primary {
    background: #D2691E;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #B8551A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.3);
}

.btn-secondary {
    background: white;
    color: #707070;
    border: 2px solid #E5E5E5;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #F5F5F5;
    border-color: #D1D5DB;
}

/* 90-Day Forecast Responsive Layout */
@media (max-width: 768px) {
    .charts-grid > .section-card > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .charts-grid > .section-card .kpi-card {
        max-width: 100%;
    }
    
    /* Interactive forecast mobile responsiveness */
    #interactiveForecastChart {
        height: 320px !important;
    }
    
    .forecast-control input[type="range"],
    .forecast-control select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
