/* Custom Styles for Climate Analysis App */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-in-out;
}

/* Card Hover Effects */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Button Enhancements */
.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Form Enhancements */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Card Headers */
.card-header {
    border-radius: 8px 8px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

/* Progress Bar */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Table Enhancements */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.1);
    cursor: pointer;
}

/* Navbar */
.navbar {
    padding: 1rem 2rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Leaflet Map */
#station-map {
    border-radius: 0 0 8px 8px;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* Select2 Customization */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px !important;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Toast Container */
.toast-container {
    z-index: 9999;
}

.toast {
    border-radius: 8px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e0e0e0;
}

[data-bs-theme="dark"] .card {
    background-color: #2d2d2d;
    border-color: #404040;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: #2d2d2d;
    --bs-table-striped-bg: #353535;
    --bs-table-hover-bg: #3d3d3d;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #353535;
    border-color: var(--primary-color);
    color: #e0e0e0;
}

[data-bs-theme="dark"] footer {
    background-color: #2d2d2d !important;
    border-top-color: #404040;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .display-6 {
        font-size: 1.5rem;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.transition-all {
    transition: all 0.3s ease;
}

/* Chart Containers */
canvas {
    max-width: 100%;
}

/* Station Badge */
.station-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* List Group Items */
.list-group-item {
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}

.list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Pre-formatted Text */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

[data-bs-theme="dark"] pre {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

/* Tooltip Customization */
.tooltip-inner {
    background-color: #333;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot.success {
    background-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.3);
}

.status-dot.warning {
    background-color: var(--warning-color);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.status-dot.danger {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

.status-dot.info {
    background-color: var(--info-color);
    box-shadow: 0 0 0 2px rgba(13, 202, 240, 0.3);
}
