/* historic_predict.css - Matching Top30 section style exactly */

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* Filter Section Styles - Match Top30 exactly */
.historic-filter-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px #808080;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.historic-filter-container > .historic-filter-row:not(:first-child) {
    margin-top: 12px;
}

.historic-filter-row {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.historic-filter-row--right {
    justify-content: flex-end;
}

.historic-filter-item {
    margin-right: 0;
    flex: 0 1 auto;
}

.historic-filter-buttons {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

/* Responsive filter inputs */
@media (max-width: 980px) {
    .historic-dropdown-wide { width: 200px; }
    .historic-search-input { width: 160px; }
}

@media (max-width: 640px) {
    .historic-dropdown-wide { width: 180px; }
    .historic-search-input { width: 140px; }
}

.historic-filter-label,
.historic-location-tn-label {
    color: #000;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.historic-search-input {
    width: 180px;
    padding: 8px;
    border-radius: 2px;
    border: 1px solid #e5e7eb;
    background-color: #fff;
}

.historic-dropdown-wide {
    width: 220px;
    color: #000;
}

.historic-dropdown-extra-wide {
    width: 250px;
    color: #000;
}

/* Button Styles - Match Top30 exactly */
.historic-reset-button {
    background-color: #3DC6C3;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    height: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.historic-reset-button:hover {
    background-color: #3DC6C3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.historic-reset-button:active {
    transform: translateY(1px);
}

.historic-reset-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.historic-refresh-button {
    background-color: #3DC6C3;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    height: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.historic-refresh-button:hover {
    background-color: #3DC6C3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.historic-refresh-button:active {
    transform: translateY(1px);
}

.historic-refresh-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.historic-export-btn {
    background-color: #3DC6C3;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    height: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.historic-export-btn:hover {
    background-color: #3DC6C3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.historic-export-btn:active {
    transform: translateY(1px);
}

/* Summary Container */
.historic-summary-container {
    flex: 1;
    margin-bottom: 20px;
}

/* Table Container */
.historic-table-container {
    margin-top: 20px;
}

/* Data Table Styling */
#historic-predictions-table .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table {
    background-color: #f8fafc;
}

#historic-predictions-table .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table thead tr th {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 700 !important;
    border: 1px solid #bae6fd !important;
    text-align: left !important;
    white-space: pre-line !important;
}

#historic-predictions-table .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table tbody tr td {
    padding: 12px !important;
    text-align: left !important;
    background-color: #fff;
    color: #111827;
    border: 1px solid #e5e7eb !important;
}

#historic-predictions-table .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table tbody tr:nth-child(odd) td {
    background-color: #f9fafb;
}

/* Chart Container */
.historic-chart-container {
    margin-top: 30px;
    background-color: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.historic-chart {
    margin-bottom: 20px;
}

.historic-chart-no-data {
    color: #9ca3af;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.historic-chart-error {
    color: #ef4444;
    text-align: center;
    padding: 20px;
}

/* Utility Classes */
.historic-hidden {
    display: none;
}

.historic-visible {
    display: block;
}

.historic-text-center {
    text-align: center;
}

.historic-text-left {
    text-align: left;
}

.historic-text-right {
    text-align: right;
}

.historic-spacer-small {
    margin-top: 5px;
}

/* Warning and Error Messages */
.historic-error-no-data {
    color: #f59e0b;
    text-align: center;
    padding: 20px;
}

.historic-error-dashboard {
    color: #f59e0b;
    text-align: center;
    padding: 20px;
}

/* Modal Popup Styles - Glass Effect */
.historic-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
}

.historic-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1400px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.historic-modal-header {
    background: linear-gradient(135deg, #3DC6C3 0%, #2ea9a6 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.historic-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.historic-modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.historic-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.historic-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
    background-color: #f9fafb;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .historic-filter-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .historic-modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

@media (max-width: 768px) {
    .historic-filter-item {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .historic-chart-container {
        padding: 12px;
    }

    .historic-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 90vh;
    }

    .historic-modal-header {
        padding: 15px 20px;
    }

    .historic-modal-title {
        font-size: 18px;
    }

    .historic-modal-body {
        padding: 20px;
        max-height: calc(90vh - 70px);
    }
}

@media (max-width: 480px) {
    .historic-chart-container {
        padding: 10px;
    }

    .historic-modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .historic-modal-header {
        border-radius: 0;
        padding: 12px 15px;
    }

    .historic-modal-title {
        font-size: 16px;
    }

    .historic-modal-body {
        padding: 15px;
        max-height: calc(100vh - 60px);
    }
}
