/* Weather Page Styles */
:root {
    --weather-primary: #00d1ff;
    --weather-secondary: #009acb;
    --weather-dark: #0f172a;
    --weather-card: #1e293b;
    --weather-border: rgba(148, 163, 184, 0.3);
    --weather-text: #f1f5f9;
    --weather-text-muted: #94a3b8;
    --weather-success: #10b981;
    --weather-warning: #f59e0b;
    --weather-danger: #ef4444;
}

.weather-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeIn 0.6s ease-in;
}

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

/* Loading State */
.weather-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--weather-text);
}

.weather-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--weather-border);
    border-top: 4px solid var(--weather-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error State */
.weather-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 2rem;
    text-align: center;
    color: var(--weather-text);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.weather-error-container h2 {
    color: var(--weather-danger);
    margin-bottom: 0.5rem;
}

.btn-retry {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--weather-primary);
    color: var(--weather-dark);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 209, 255, 0.3);
}

.btn-retry:hover {
    background: var(--weather-secondary);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 209, 255, 0.5);
}

/* Current Weather Header */
.current-weather-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--weather-card) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-radius: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--weather-border);
    position: relative;
    overflow: hidden;
}

.current-weather-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 209, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.location-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.location-info h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: var(--weather-text);
    font-weight: 700;
}

.coordinates {
    color: var(--weather-text-muted);
    font-size: 0.9rem;
}

.timezone {
    color: var(--weather-text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.location-source {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--weather-primary);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 209, 255, 0.1);
    border-radius: 1rem;
    width: fit-content;
    border: 1px solid rgba(0, 209, 255, 0.3);
}

.location-icon {
    font-size: 1rem;
}

.current-temp-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.temp-main {
    display: flex;
    align-items: flex-start;
    font-weight: 700;
    color: var(--weather-primary);
    text-shadow: 0 0 30px rgba(0, 209, 255, 0.5);
}

.temp-value {
    font-size: 5rem;
    line-height: 1;
}

.temp-unit {
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.temp-toggle {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.25rem;
    border-radius: 2rem;
}

.temp-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--weather-text-muted);
    border-radius: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.temp-toggle button.active {
    background: var(--weather-primary);
    color: var(--weather-dark);
    box-shadow: 0 0 15px rgba(0, 209, 255, 0.5);
}

.temp-toggle button:hover:not(.active) {
    background: rgba(0, 209, 255, 0.2);
    color: var(--weather-text);
}

.current-conditions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.condition-icon {
    font-size: 4rem;
    animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.condition-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--weather-text);
}

.condition-details {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--weather-text-muted);
    font-size: 0.9rem;
}

.detail-icon {
    font-size: 1.2rem;
}

/* Forecast Section */
.forecast-section {
    margin-bottom: 2rem;
}

.forecast-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--weather-text);
    font-weight: 700;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.forecast-card {
    background: var(--weather-card);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 2px solid var(--weather-border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.forecast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--weather-primary), var(--weather-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.forecast-card:hover::before,
.forecast-card.active::before {
    transform: scaleX(1);
}

.forecast-card:hover {
    transform: translateY(-5px);
    border-color: var(--weather-primary);
    box-shadow: 0 10px 30px rgba(0, 209, 255, 0.2);
}

.forecast-card.active {
    border-color: var(--weather-primary);
    background: linear-gradient(135deg, var(--weather-card) 0%, rgba(0, 209, 255, 0.1) 100%);
    box-shadow: 0 0 30px rgba(0, 209, 255, 0.3);
}

.forecast-day-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.day-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--weather-text);
}

.day-date {
    font-size: 0.85rem;
    color: var(--weather-text-muted);
}

.forecast-icon {
    text-align: center;
    font-size: 3rem;
    margin: 0.75rem 0;
}

.forecast-condition {
    text-align: center;
    font-size: 0.9rem;
    color: var(--weather-text-muted);
    margin-bottom: 0.75rem;
}

.forecast-temps {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--weather-text);
}

.temp-high {
    color: var(--weather-warning);
}

.temp-separator {
    color: var(--weather-text-muted);
    margin: 0 0.25rem;
}

.temp-low {
    color: var(--weather-primary);
}

.forecast-details {
    display: flex;
    justify-content: space-around;
    font-size: 0.85rem;
    color: var(--weather-text-muted);
}

.expand-indicator {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--weather-primary);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.forecast-card.active .expand-indicator {
    animation: bounce-arrow 1s ease-in-out infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Hourly Section */
.hourly-section {
    background: var(--weather-card);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--weather-primary);
    box-shadow: 0 10px 40px rgba(0, 209, 255, 0.2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
}

.hourly-section.show {
    max-height: 1000px;
    opacity: 1;
}

.hourly-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--weather-text);
    font-weight: 700;
}

.hourly-chart-container {
    overflow-x: auto;
    overflow-y: hidden;
}

.hourly-scroll {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    min-width: max-content;
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.75rem;
    min-width: 100px;
    border: 1px solid var(--weather-border);
    transition: all 0.3s ease;
}

.hourly-item:hover {
    background: rgba(0, 209, 255, 0.1);
    border-color: var(--weather-primary);
    transform: translateY(-3px);
}

.hour-time {
    font-weight: 600;
    color: var(--weather-text);
}

.hour-icon {
    font-size: 2rem;
}

.hour-temp {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--weather-primary);
}

.hour-condition {
    font-size: 0.8rem;
    color: var(--weather-text-muted);
    text-align: center;
}

.hour-precip,
.hour-wind,
.hour-feels-like {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--weather-text-muted);
}

.no-hourly-data {
    text-align: center;
    color: var(--weather-text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Additional Info */
.additional-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--weather-card);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--weather-border);
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--weather-primary);
    box-shadow: 0 5px 20px rgba(0, 209, 255, 0.15);
    transform: translateY(-2px);
}

.info-card h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--weather-text);
    font-weight: 600;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--weather-border);
    color: var(--weather-text-muted);
}

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

.info-row span:first-child {
    font-weight: 500;
}

.info-row span:last-child {
    color: var(--weather-text);
    font-weight: 600;
}

/* Footer */
.weather-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--weather-card);
    border-radius: 1rem;
    border: 1px solid var(--weather-border);
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-footer p {
    color: var(--weather-text-muted);
    margin: 0;
}

.debug-info {
    font-size: 0.75rem;
    color: var(--weather-warning);
    font-family: monospace;
    background: rgba(245, 158, 11, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.footer-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-refresh,
.btn-location {
    padding: 0.75rem 1.5rem;
    background: var(--weather-primary);
    color: var(--weather-dark);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-refresh:hover,
.btn-location:hover {
    background: var(--weather-secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 209, 255, 0.3);
}

.btn-location {
    background: var(--weather-success);
    animation: pulse-button 2s ease-in-out infinite;
}

@keyframes pulse-button {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .current-weather-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .location-info {
        align-items: center;
    }

    .forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .weather-page {
        padding: 1rem;
    }

    .current-weather-header {
        padding: 1.5rem;
    }

    .temp-value {
        font-size: 4rem;
    }

    .temp-unit {
        font-size: 2rem;
    }

    .forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .hourly-section {
        padding: 1rem;
    }

    .additional-info {
        grid-template-columns: 1fr;
    }

    .weather-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .footer-buttons {
        width: 100%;
        flex-direction: column;
    }

    .btn-refresh,
    .btn-location {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .location-info h1 {
        font-size: 1.5rem;
    }

    .temp-value {
        font-size: 3rem;
    }

    .forecast-grid {
        grid-template-columns: 1fr 1fr;
    }

    .condition-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Scrollbar Styling */
.hourly-chart-container::-webkit-scrollbar {
    height: 8px;
}

.hourly-chart-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.hourly-chart-container::-webkit-scrollbar-thumb {
    background: var(--weather-primary);
    border-radius: 4px;
}

.hourly-chart-container::-webkit-scrollbar-thumb:hover {
    background: var(--weather-secondary);
}
