/**
 * Frontend User Interface Styles
 * ALGOPK Solar System Recommender
 */

/* =====================================================
   HEADER
   ===================================================== */
.header {
    background: var(--white);
    border-bottom: 2px solid var(--gray-light);
    padding: var(--spacing-lg) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    flex: 1;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--blue-dark);
    margin: 0;
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-size: 0.875rem;
    color: var(--gray-dark);
    margin: 0;
}

.language-toggle {
    display: flex;
    align-items: center;
}

.lang-btn {
    background: var(--gray-light);
    border: 2px solid var(--gray-mid);
    border-radius: var(--radius-pill);
    padding: 8px 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn:hover {
    border-color: var(--blue-mid);
}

.lang-option {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-dark);
    transition: all var(--transition-fast);
}

.lang-option.active {
    color: var(--blue-dark);
    font-weight: 700;
}

.lang-divider {
    color: var(--gray-mid);
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
    color: var(--white);
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: var(--spacing-md);
    opacity: 0;
    transform: translateY(20px);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-xl);
    opacity: 0;
    transform: translateY(20px);
}

.feature-pills {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.feature-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.9);
}

.feature-icon {
    font-size: 1.5rem;
}

/* =====================================================
   STEP INDICATOR
   ===================================================== */
.step-indicator {
    background: var(--white);
    padding: var(--spacing-xl) 0;
    border-bottom: 2px solid var(--gray-light);
}

.step-indicator .container {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex: 1;
}

/* Start Over Button */
.btn-start-over {
    padding: 10px 24px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    white-space: nowrap;
}

.btn-start-over:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-start-over:active {
    transform: translateY(0);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all var(--transition-base);
}

.step.active .step-circle {
    background: var(--blue-dark);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(13, 59, 110, 0.2);
}

.step.completed .step-circle {
    background: var(--green-dark);
    color: var(--white);
}

.step.completed .step-circle::before {
    content: "✓";
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-dark);
    text-align: center;
}

.step.active .step-label {
    color: var(--blue-dark);
    font-weight: 700;
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--gray-mid);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    padding: var(--spacing-2xl) 0;
    min-height: 60vh;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* =====================================================
   APPLIANCE SELECTOR (STEP 1)
   ===================================================== */
.category-filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid var(--gray-mid);
    background: var(--white);
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-btn:hover {
    border-color: var(--blue-mid);
    background: var(--blue-light);
}

.category-btn.active {
    background: var(--blue-dark);
    color: var(--white);
    border-color: var(--blue-dark);
}

.selector-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
}

.appliance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.appliance-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.appliance-card:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-md);
    border-color: var(--blue-mid);
}

.appliance-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.appliance-name-en {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.appliance-name-ur {
    font-size: 0.875rem;
    color: var(--gray-dark);
    margin-bottom: var(--spacing-sm);
}

.appliance-watt {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue-dark);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}

/* =====================================================
   HOME ILLUSTRATION
   ===================================================== */
.home-illustration {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    position: sticky;
    top: 120px;
}

.home-illustration h3 {
    text-align: center;
    color: var(--blue-dark);
    margin-bottom: var(--spacing-md);
}

.house-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.house-svg {
    width: 100%;
    height: auto;
}

.selected-appliances {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-height: 60px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

/* Scrollbar styling */
.selected-appliances::-webkit-scrollbar {
    width: 6px;
}

.selected-appliances::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 3px;
}

.selected-appliances::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.selected-appliances::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.selected-appliance-chip {
    background: var(--blue-light);
    border: 1px solid var(--blue-mid);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
}

.chip-icon {
    font-size: 1rem;
}

.chip-remove {
    background: var(--red-dark);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.load-summary {
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.load-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.load-item:last-child {
    margin-bottom: 0;
}

.load-item strong {
    color: var(--blue-dark);
    font-size: 1.25rem;
}

/* =====================================================
   LOADING OVERLAY
   ===================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.sun-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    border: 6px solid var(--blue-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    background: var(--gray-light);
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: var(--gray-dark);
    font-size: 0.875rem;
}

.footer p {
    margin-bottom: var(--spacing-sm);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1279px) {
    .appliance-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1023px) {
    .selector-grid {
        grid-template-columns: 1fr;
    }
    
    .home-illustration {
        position: static;
    }
    
    .appliance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .steps {
        flex-wrap: wrap;
    }
    
    .step-line {
        display: none;
    }
    
    .appliance-grid {
        grid-template-columns: 1fr;
    }
    
    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

/* Selected appliance row layout */
.selected-appliance-row {
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.selected-appliance-row:hover {
    border-color: #1565C0;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.15);
}

/* Top row: Icon, Name, Quantity, Remove button */
.appliance-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.selected-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.appliance-name-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selected-name {
    font-size: 16px;
    font-weight: 600;
    color: #0D3B6E;
}

.selected-watts {
    font-size: 12px;
    color: #F59E0B;
    font-weight: 600;
}

.btn-remove {
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.btn-remove:hover {
    background: #FCA5A5;
    transform: scale(1.1);
}

/* Bottom row: Slider */
.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 8px;
}

.slider-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.hours-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #FEF3C7 0%, #F59E0B 50%, #1565C0 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.hours-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1565C0;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    border: 3px solid white;
}

.hours-slider::-webkit-slider-thumb:hover {
    background: #0D3B6E;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(13, 59, 110, 0.4);
}

.hours-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.hours-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1565C0;
    cursor: grab;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.hours-slider::-moz-range-thumb:hover {
    background: #0D3B6E;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(13, 59, 110, 0.4);
}

.hours-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.hours-display {
    font-size: 15px;
    color: #1565C0;
    font-weight: 700;
    min-width: 90px;
    text-align: right;
    white-space: nowrap;
}

.empty-message {
    text-align: center;
    color: #94A3B8;
    padding: 40px 20px;
    font-size: 15px;
    background: #F8FAFC;
    border-radius: 12px;
    border: 2px dashed #CBD5E1;
}

/* Responsive */
@media (max-width: 640px) {
    .selected-icon {
        font-size: 28px;
    }
    
    .selected-name {
        font-size: 14px;
    }
    
    .slider-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .slider-label {
        text-align: center;
    }
    
    .hours-display {
        text-align: center;
        min-width: auto;
    }
}

/* =====================================================
   LOAD BREAKDOWN TABLE (STEP 2)
   ===================================================== */
.appliance-breakdown {
    margin-top: 32px;
}

.appliance-breakdown h3 {
    font-size: 1.5rem;
    color: #0D3B6E;
    margin-bottom: 20px;
    font-weight: 700;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 15px;
}

.breakdown-table thead {
    background: linear-gradient(135deg, #0D3B6E 0%, #1565C0 100%);
    color: white;
}

.breakdown-table thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-table thead th:first-child {
    border-top-left-radius: 12px;
    text-align: center;
    width: 50px;
}

.breakdown-table thead th:last-child {
    border-top-right-radius: 12px;
}

.breakdown-table tbody tr {
    border-bottom: 1px solid #E2E8F0;
    transition: all 0.2s;
}

.breakdown-table tbody tr:hover {
    background: #F8FAFC;
    transform: scale(1.01);
}

.breakdown-table tbody td {
    padding: 14px 12px;
    color: #334155;
}

.breakdown-table tbody td:first-child {
    text-align: center;
    font-weight: 600;
    color: #64748B;
}

.breakdown-table tbody td:nth-child(2) {
    font-weight: 600;
    color: #0D3B6E;
}

.breakdown-table tbody td:nth-child(3) {
    color: #F59E0B;
    font-weight: 600;
}

.breakdown-table tbody td:nth-child(4) {
    color: #8B5CF6;
    font-weight: 600;
}

.breakdown-table tbody td:nth-child(5) {
    color: #10B981;
    font-weight: 700;
}

.units-column {
    background: rgba(245, 158, 11, 0.1);
}

.units-cell {
    background: rgba(245, 158, 11, 0.05);
    color: #F59E0B !important;
    font-weight: 700 !important;
    font-size: 16px;
}

.appliance-icon-small {
    font-size: 20px;
    margin-right: 8px;
}

.total-row {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%) !important;
    border-top: 3px solid #F59E0B !important;
    font-size: 16px;
}

.total-row td {
    padding: 18px 12px !important;
    color: #0D3B6E !important;
}

.total-row strong {
    font-weight: 800;
}

.total-row .units-cell {
    background: rgba(245, 158, 11, 0.2);
    font-size: 18px;
    color: #D97706 !important;
}

.highlight-units {
    color: #F59E0B !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
}

/* Responsive table */
@media (max-width: 768px) {
    .breakdown-table {
        font-size: 13px;
    }
    
    .breakdown-table thead th,
    .breakdown-table tbody td {
        padding: 10px 8px;
    }
    
    .appliance-icon-small {
        font-size: 16px;
        margin-right: 4px;
    }
    
    .units-cell {
        font-size: 14px !important;
    }
    
    .total-row .units-cell {
        font-size: 16px !important;
    }
}


/* ============================================
   TIME SELECTOR WITH DROPDOWNS (NO OVERLAPPING SLIDERS!)
   ============================================ */

.time-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.time-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #1565C0;
    background: white;
    color: #1565C0;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-btn:hover {
    background: #DBEAFE;
    transform: scale(1.05);
}

.time-btn:active {
    background: #BFDBFE;
    transform: scale(0.95);
}

.time-select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1565C0;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-select:hover {
    border-color: #1565C0;
    background: #F8FAFC;
}

.time-select:focus {
    outline: none;
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.visual-timeline {
    margin-top: 16px;
}

.timeline-bar {
    position: relative;
    height: 32px;
    background: #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}

.timeline-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #1565C0);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.timeline-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.timeline-marker {
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.solar-peak-indicator {
    position: relative;
    height: 24px;
    margin-top: 4px;
}

.solar-peak-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.2));
    border: 2px dashed #F59E0B;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400E;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .time-selector-grid {
        grid-template-columns: 1fr;
    }
}

.time-range-section {
    margin-top: 12px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.time-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.time-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.time-display {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1565C0;
    background: white;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #BFDBFE;
}

.dual-slider-container {
    position: relative;
    padding: 8px 0;
}

.time-markers {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94A3B8;
    margin-bottom: 8px;
    padding: 0 4px;
}

.dual-slider-track {
    position: relative;
    height: 40px;
    background: #E2E8F0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.slider-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #1565C0);
    border-radius: 8px;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1;
}

.time-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 40px;
    background: white;
    border: 3px solid #1565C0;
    border-radius: 6px;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    pointer-events: auto;
}

.time-slider::-webkit-slider-thumb:hover {
    background: #DBEAFE;
    transform: scaleX(1.1);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.time-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scaleX(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    background: #BFDBFE;
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 40px;
    background: white;
    border: 3px solid #1565C0;
    border-radius: 6px;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    pointer-events: auto;
}

.time-slider::-moz-range-thumb:hover {
    background: #DBEAFE;
    transform: scaleX(1.1);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.time-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scaleX(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    background: #BFDBFE;
}

.time-slider-start {
    z-index: 4;
}

.time-slider-end {
    z-index: 3;
}

.solar-peak-indicator {
    position: relative;
    height: 24px;
    margin-top: 4px;
}

.solar-peak-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.2));
    border: 2px dashed #F59E0B;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400E;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .time-range-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .time-display {
        font-size: 0.8125rem;
    }
    
    .solar-peak-bar {
        font-size: 0.6875rem;
    }
}


/* =====================================================
   HOURLY USAGE GRID (24-HOUR CLICK INTERFACE)
   ===================================================== */
.hourly-usage-section {
    margin-top: 12px;
    padding: 15px;
    background: #F8FAFC;
    border-radius: 10px;
    border: 2px solid #E2E8F0;
}

.hourly-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.usage-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0D3B6E;
}

.usage-actions {
    display: flex;
    gap: 8px;
}

.btn-select-all,
.btn-clear-all {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-select-all:hover {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.btn-clear-all:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

.hourly-usage-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 10px;
    max-width: 100%;
}

.hour-block {
    aspect-ratio: 1;
    background: #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid transparent;
    min-height: 43px;
    max-height: 48px;
    padding: 2px;
}

.hour-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.hour-block.active {
    background: #10B981;
    border-color: #059669;
}

.hour-block.active:hover {
    background: #059669;
}

.hour-block.solar-peak {
    border-color: #F59E0B;
    border-width: 2px;
}

.hour-block.solar-peak.active {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    border-color: #F59E0B;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.hour-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748B;
    text-align: center;
    line-height: 1.1;
    user-select: none;
}

.hour-block.active .hour-label {
    color: white;
}

.solar-peak-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid #E2E8F0;
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748B;
}

.legend-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid transparent;
}

.legend-box.solar {
    background: white;
    border-color: #F59E0B;
}

.legend-box.active {
    background: #10B981;
    border-color: #059669;
}

.legend-box.inactive {
    background: #E5E7EB;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hourly-usage-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 4px;
    }
    
    .hour-block {
        min-height: 42px;
        max-height: 48px;
    }
    
    .hour-label {
        font-size: 0.625rem;
    }
}

@media (max-width: 768px) {
    .hourly-usage-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 3px;
    }
    
    .hour-block {
        min-height: 40px;
        max-height: 45px;
    }
    
    .hour-label {
        font-size: 0.6rem;
    }
    
    .usage-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-select-all,
    .btn-clear-all {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hourly-usage-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
    }
    
    .hour-block {
        min-height: 38px;
        max-height: 42px;
        border-radius: 5px;
    }
    
    .hour-label {
        font-size: 0.55rem;
    }
    
    .hourly-usage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .hourly-usage-section {
        padding: 12px;
    }
}


/* =====================================================
   LOAD FACTOR SLIDER
   ===================================================== */
.load-factor-section {
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}

.load-factor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.load-factor-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0D3B6E;
}

.load-factor-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1565C0;
    background: white;
    padding: 2px 10px;
    border-radius: 6px;
    border: 2px solid #1565C0;
}

.load-factor-slider-container {
    position: relative;
    padding: 4px 0 20px 0;
}

.load-factor-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, 
        #FEF3C7 0%, 
        #FDE68A 25%, 
        #FCD34D 50%, 
        #FBBF24 75%, 
        #10B981 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.load-factor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1565C0;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.load-factor-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4);
}

.load-factor-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1565C0;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.load-factor-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4);
}

.load-factor-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 4px;
}

.load-factor-markers span {
    font-size: 0.6875rem;
    color: #64748B;
    text-align: center;
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .load-factor-section {
        padding: 8px 10px;
    }
    
    .load-factor-header {
        flex-direction: row;
        gap: 8px;
    }
    
    .load-factor-markers span {
        font-size: 0.625rem;
    }
}

/* =====================================================
   APPLIANCE DIALOG MODAL
   ===================================================== */
#appliance-dialog-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    animation: dlgFadeIn 0.2s ease;
}
@keyframes dlgFadeIn { from{opacity:0} to{opacity:1} }
.appliance-dialog {
    background: #fff; border-radius: 16px; width: 520px; max-width: 95vw;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    position: relative; animation: dlgSlideUp 0.3s ease;
}
@keyframes dlgSlideUp { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }
.dlg-close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    font-size: 28px; color: #94A3B8; cursor: pointer; z-index: 1;
}
.dlg-close:hover { color: #EF4444; }
.dlg-header {
    display: flex; align-items: center; gap: 16px; padding: 24px 24px 16px;
    border-bottom: 1px solid #E2E8F0;
}
.dlg-header h3 { margin: 0; font-size: 1.25rem; color: #0D3B6E; }
.dlg-urdu { margin: 2px 0 0; color: #64748B; font-size: 0.875rem; }
.dlg-watts { margin: 4px 0 0; color: #F59E0B; font-weight: 700; font-size: 0.875rem; }
.dlg-section { padding: 16px 24px; border-bottom: 1px solid #F1F5F9; }
.dlg-label { font-weight: 600; color: #334155; font-size: 0.9rem; display: block; margin-bottom: 10px; }
.dlg-qty-row { display: flex; align-items: center; gap: 12px; }
.dlg-qty-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 2px solid #E2E8F0;
    background: #F8FAFC; font-size: 20px; font-weight: 700; cursor: pointer;
    color: #0D3B6E; transition: all 0.15s;
}
.dlg-qty-btn:hover { background: #DBEAFE; border-color: #3B82F6; }
.dlg-qty-input {
    width: 60px; height: 40px; text-align: center; font-size: 1.25rem; font-weight: 700;
    border: 2px solid #E2E8F0; border-radius: 10px; color: #0D3B6E;
}
.dlg-total { font-size: 0.9rem; color: #64748B; margin-left: auto; }
.dlg-total strong { color: #10B981; }
.dlg-slider {
    width: 100%; height: 8px; border-radius: 4px; outline: none;
    -webkit-appearance: none; appearance: none;
    background: linear-gradient(to right, #FEF3C7, #F59E0B, #10B981);
}
.dlg-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: #0D3B6E; border: 3px solid #fff; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.dlg-slider-marks { display: flex; justify-content: space-between; font-size: 0.7rem; color: #94A3B8; margin-top: 4px; }
.dlg-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.dlg-act-btn {
    padding: 4px 12px; border-radius: 6px; border: 1px solid #CBD5E1;
    background: #F8FAFC; font-size: 0.75rem; cursor: pointer; color: #475569;
}
.dlg-act-btn:hover { background: #DBEAFE; border-color: #3B82F6; }
.dlg-hour-grid {
    display: grid; grid-template-columns: repeat(12,1fr); gap: 4px;
}
.dlg-hour {
    padding: 6px 2px; text-align: center; font-size: 0.6rem; font-weight: 600;
    border-radius: 6px; cursor: pointer; border: 2px solid #E2E8F0;
    background: #F8FAFC; color: #64748B; transition: all 0.15s; user-select: none;
}
.dlg-hour.solar { border-color: #FDE68A; background: #FFFBEB; }
.dlg-hour.active { background: #1565C0; color: #fff; border-color: #1565C0; }
.dlg-hour.active.solar { background: #10B981; border-color: #10B981; }
.dlg-hour:hover { transform: scale(1.1); z-index: 1; }
.dlg-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 0.75rem; color: #64748B; }
.dlg-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; }
.dlg-cancel {
    padding: 10px 20px; border-radius: 10px; border: 2px solid #E2E8F0;
    background: #fff; color: #64748B; font-weight: 600; cursor: pointer;
}
.dlg-cancel:hover { background: #F1F5F9; }
.dlg-confirm {
    padding: 10px 24px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #0D3B6E, #1565C0); color: #fff;
    font-weight: 700; cursor: pointer; font-size: 1rem;
}
.dlg-confirm:hover { background: linear-gradient(135deg, #0A2E57, #0D3B6E); }
