@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600&display=swap");

:root {
    --metal-dark: #0a1628;
    --metal-blue: #1a2f4a;
    --metal-cyan: #2d4a5c;
    --accent-teal: #00d9ff;
    --accent-green: #00ff88;
}

* { padding: 0; margin: 0; box-sizing: border-box; }

body {
    font-family: "Barlow", sans-serif;
    background: linear-gradient(135deg, var(--metal-blue) 0%, var(--metal-cyan) 50%, #3d5a6b 100%);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 160px;
    padding-bottom: 100px;
}


.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 15px 40px;
}


.card {
    background: linear-gradient(135deg, var(--metal-dark) 0%, var(--metal-blue) 50%, var(--metal-cyan) 100%);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,217,255,0.2);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,217,255,0.35);
}


.card h4 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--accent-green);
    font-weight: 600;
    border-bottom: 2px solid rgba(0,255,136,0.3);
    padding-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    transition: color 0.2s;
}
.card h4:hover { color: var(--accent-teal); }

.card-toggle-icon {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.card.collapsed .card-toggle-icon { transform: rotate(-90deg); }

.card-body {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}
.card.collapsed .card-body { max-height: 0; opacity: 0; }


.mainWeatherCard {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    text-align: center;
    overflow: hidden;
    min-height: 400px;
    transition: background-image 0.5s ease;
}
.mainWeatherCard > * {
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}
.locationInfo { margin-bottom: 20px; }
.cityName {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    margin-bottom: 8px;
    font-weight: 600;
}
.date { font-size: 1rem; opacity: 0.9; }

.currentWeather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}


.weatherIconDisplay img {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.7));
    width: clamp(70px, 18vw, 100px) !important;
    height: auto !important;
}

.tempInfo { text-align: left; }
.weatherDeg {
    font-size: clamp(3.5rem, 12vw, 5rem);
    font-weight: 600;
    line-height: 1;
}
.weatherCondition {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-top: 8px;
    opacity: 0.95;
}


.gridInfo, .windInfo, .marineInfo, .astroInfo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    text-align: left;
}
.gridInfo p, .windInfo p, .marineInfo p, .astroInfo p {
    background: rgba(0,217,255,0.10);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(0,255,136,0.12);
    transition: background 0.2s, border-color 0.2s;
}
.gridInfo p:hover, .windInfo p:hover, .marineInfo p:hover, .astroInfo p:hover {
    background: rgba(0,217,255,0.18);
    border-color: rgba(0,255,136,0.3);
}
.gridInfo p strong, .windInfo p strong, .marineInfo p strong, .astroInfo p strong {
    font-size: 1.05rem;
    color: var(--accent-green);
}


.analytics-cta {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(0,217,255,0.15);
}
.analytics-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0,217,255,0.18), rgba(0,255,136,0.12));
    border: 1px solid rgba(0,255,136,0.35);
    border-radius: 20px;
    color: white;
    font-family: "Barlow", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    text-decoration: none;
    transition: all 0.25s ease;
}
.analytics-btn:hover {
    background: linear-gradient(135deg, rgba(0,217,255,0.32), rgba(0,255,136,0.22));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,255,136,0.28);
}
.analytics-btn i { color: var(--accent-green); }


.hourlyCard { overflow: hidden; }
.hourlyInfo {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.hourlyInfo::-webkit-scrollbar { display: none; }


.hourItem {
    flex: 0 0 calc(25vw - 14px);
    min-width: 72px;
    max-width: 90px;
    background: rgba(0,217,255,0.12);
    border-radius: 14px;
    text-align: center;
    padding: 10px 6px 8px;
    scroll-snap-align: start;
    border: 1px solid rgba(0,255,136,0.22);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.hourItem:hover {
    transform: scale(1.04) translateY(-2px);
    background: rgba(0,217,255,0.22);
    border-color: rgba(0,255,136,0.5);
    box-shadow: 0 6px 20px rgba(0,217,255,0.22);
}
.hourItem:active { transform: scale(0.97); }

.hour {
    font-weight: 600;
    color: var(--accent-teal);
    font-size: 0.75rem;
    white-space: nowrap;
}


.hourIcon img {
    width: 34px !important;
    height: 34px !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.hourTemp {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-green);
}
.hourRain {
    font-size: 0.68rem;
    opacity: 0.85;
    white-space: nowrap;
}
.hourTapHint {
    font-size: 0.55rem;
    color: rgba(0,217,255,0.4);
    border-top: 1px solid rgba(0,217,255,0.12);
    padding-top: 4px;
    width: 100%;
    text-align: center;
    transition: color 0.2s;
}
.hourItem:hover .hourTapHint { color: rgba(0,255,136,0.65); }


.forecastInfo { display: flex; flex-direction: column; gap: 12px; }
.forecastDay {
    background: rgba(0,217,255,0.10);
    padding: 12px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(0,255,136,0.12);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.forecastDay:hover {
    background: rgba(0,217,255,0.2);
    border-color: rgba(0,255,136,0.35);
    transform: translateX(3px);
}
.forecastDayName {
    font-size: 1rem;
    font-weight: 600;
    min-width: 80px;
    color: var(--accent-teal);
}


.forecastIcon img {
    width: 38px !important;
    height: 38px !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.forecastTemps { display: flex; gap: 10px; font-size: 1rem; }
.forecastMax { font-weight: 700; color: #ffb347; }
.forecastMin { opacity: 0.65; }
.forecastRain { font-size: 0.85rem; opacity: 0.85; }
.forecastTapHint {
    font-size: 0.62rem;
    color: rgba(0,217,255,0.45);
    flex-shrink: 0;
    transition: color 0.2s;
}
.forecastDay:hover .forecastTapHint { color: rgba(0,255,136,0.65); }


.navArrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10,22,40,0.7);
    border: 2px solid rgba(0,217,255,0.5);
    color: white;
    font-size: 2rem;
    padding: 15px 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 5px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}
.navArrow:hover {
    background: rgba(26,47,74,0.9);
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(0,255,136,0.5);
}
.prevArrow { left: 5px; }
.nextArrow { right: 5px; }

.favDots {
    position: absolute;
    bottom: 15px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 5;
}
.dot {
    width: 8px; height: 8px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transition: all 0.3s;
}
.dot.active {
    background: var(--accent-green);
    width: 12px; border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,255,136,0.6);
}

.notAvailable { text-align: center; opacity: 0.7; font-style: italic; padding: 20px; }


@media (min-width: 768px) {
    .dashboard { max-width: 800px; }
    .currentWeather { gap: 30px; }
    .gridInfo, .windInfo, .marineInfo, .astroInfo { grid-template-columns: repeat(2,1fr); }
    .hourlyInfo {
        scrollbar-width: thin;
        scrollbar-color: rgba(0,217,255,0.5) rgba(255,255,255,0.1);
    }
    .hourlyInfo::-webkit-scrollbar { display: block; height: 8px; }
    .hourlyInfo::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 4px; }
    .hourlyInfo::-webkit-scrollbar-thumb { background: rgba(0,217,255,0.5); border-radius: 4px; }
}
@media (min-width: 1024px) { .dashboard { max-width: 900px; } }
@media (max-width: 768px)  { body { padding-top: 135px; padding-bottom: 100px; } }
@media (max-width: 480px)  {
    body { padding-top: 110px; padding-bottom: 90px; }

    .hourItem {
        flex: 0 0 calc(25vw - 12px);
        min-width: 68px;
    }
}
@media (min-width: 600px) {
    .hourItem {
        flex: 0 0 80px;
        max-width: 80px;
    }
}