/*
 * Shared CSS styles for Node Detail and Node Average pages
 * V8-style compact design with dark theme
 */

/* V8-style Node Box */
.node-section {
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #334155;
    min-width: 0;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    border-left: 4px solid #3b82f6;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.node-name {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    word-break: break-word;
}

.node-date-range {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.node-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.node-stat {
    text-align: center;
}

.node-stat-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.node-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
}

.node-stat-value.positive { color: #10b981; }
.node-stat-value.negative { color: #ef4444; }
.node-stat-value.neutral { color: #3b82f6; }

/* Compact Hourly Table */
.node-table-container {
    padding: 0.5rem;
    overflow-x: auto;
}

.hourly-table-compact {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
    border: 1px solid #475569;
    table-layout: auto;
}

.hourly-table-compact th {
    background: #0f172a;
    color: #94a3b8;
    padding: 0.35rem 0.5rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.7rem;
    border: 1px solid #475569;
    white-space: nowrap;
}

.hourly-table-compact td {
    padding: 0.25rem 0.4rem;
    text-align: center;
    border: 1px solid #334155;
    white-space: nowrap;
}

.hourly-table-compact tr:hover {
    background: rgba(59, 130, 246, 0.15);
}

.hour-cell {
    font-weight: 600;
    color: #e2e8f0;
    background: #0f172a;
}

/* Color scheme for LMP values */
.lmp-da { color: #3b82f6; }
.lmp-rt { color: #f59e0b; }
.cc-value { color: #8b5cf6; }

/* Positive/Negative values */
.val-positive { color: #10b981; }
.val-negative { color: #ef4444; }
.val-neutral { color: #e2e8f0; }

/* Peak hour highlight */
.peak-hour {
    background: rgba(59, 130, 246, 0.08);
}

/* Totals row */
.totals-row {
    background: #0f172a !important;
    border-top: 2px solid #475569 !important;
}
.totals-row td {
    padding: 0.4rem 0.5rem;
    font-weight: 600;
}

/* Summary cards V8 style */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border-left: 4px solid #3b82f6;
}

.summary-card.da { border-left-color: #3b82f6; }
.summary-card.rt { border-left-color: #f59e0b; }
.summary-card.spread { border-left-color: #10b981; }
.summary-card.hours { border-left-color: #8b5cf6; }

.summary-label {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.summary-value.positive { color: #10b981; }
.summary-value.negative { color: #ef4444; }
.summary-value.neutral { color: #3b82f6; }

/* Filter bar V8 style */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    background: #1e293b;
    padding: 1rem;
    border-radius: 8px;
}

.filter-bar label {
    color: #94a3b8;
    font-size: 0.85rem;
}

.filter-bar select,
.filter-bar input[type="date"],
.filter-bar input[type="number"] {
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 0.5rem;
    border-radius: 4px;
}

.filter-bar select,
.filter-bar input[type="date"] {
    min-width: 150px;
}

.filter-bar input[type="number"] {
    width: 70px;
}

.filter-bar input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Load buttons group */
.load-buttons-group {
    display: flex;
    flex-direction: column;
}

.load-buttons-group > label {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.load-buttons {
    display: flex;
    gap: 0.5rem;
}

.load-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border: 2px solid #475569;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 85px;
    font-weight: 600;
    background: #1e293b;
    color: #94a3b8;
}

.load-btn-icon {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.load-btn-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-btn:hover {
    background: #334155;
    border-color: #64748b;
    color: #e2e8f0;
}

/* Active/Selected button state */
.load-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.load-btn.active:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

@media (max-width: 600px) {
    .load-buttons {
        flex-direction: column;
    }
    .load-btn {
        flex-direction: row;
        gap: 0.5rem;
        min-width: auto;
    }
    .load-btn-icon {
        margin-bottom: 0;
    }
}

/* Help section styling */
.help-section {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.help-section summary {
    cursor: pointer;
    color: #3b82f6;
    font-weight: 600;
}

.help-content {
    padding-top: 1rem;
    color: #94a3b8;
}

.help-content h4 {
    color: #e2e8f0;
    margin-top: 1rem;
}

.help-content ul {
    margin-left: 1.5rem;
}

/* View toggle styling */
.view-toggle {
    margin-bottom: 1rem;
    display: inline-flex;
}

.view-toggle-btn {
    color: #94a3b8;
    padding: 0.4rem 0.8rem;
    background: #1e293b;
    text-decoration: none;
    border: 1px solid #334155;
}

.view-toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.view-toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.view-toggle-btn.active {
    color: #e2e8f0;
    font-weight: 600;
    background: #3b82f6;
    border-color: #3b82f6;
}

/* Days count badge */
.days-badge {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Two-column grid for multi-day boxes (node-detail specific) */
.nodes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

@media (max-width: 900px) {
    .nodes-grid {
        grid-template-columns: 1fr;
    }
}

/* Single box container (node-average specific) */
.node-box-single {
    max-width: 800px;
}
