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

:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --accent-orange: #f97316;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    overflow-x: hidden;
    line-height: 1.5;
}

.dashboard-wrapper {
    padding: 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* CARDS */
.weather-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 1.25rem;
    height: 100%;
    color: white;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.weather-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.card-label-fixed {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.main-value-fixed {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.main-value-sub {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.main-value-tiny {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.unit-fixed {
    font-size: 1rem;
    margin-left: 2px;
    color: var(--text-muted);
    font-weight: 500;
}

.mm-group {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.mm-val {
    color: white;
    font-weight: 700;
    margin: 0 3px;
}

.mm-time {
    opacity: 0.6;
}

/* THERMOMETER */
.thermometer-track {
    width: 12px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.mercury-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, #ff4444, #ffbb00);
    height: 50%;
    /* Dinámico */
    transition: height 1s ease-in-out;
}

/* WIND ROSE */
.wind-rose-svg {
    width: 140px;
    height: 140px;
}

.wr-grid-circle {
    stroke: rgba(255, 255, 255, 0.1);
    fill: none;
}

.wr-axis {
    stroke: rgba(255, 255, 255, 0.2);
}

.wr-wedge {
    fill: rgba(0, 212, 255, 0.4);
}

.wr-cardinal-lbl {
    fill: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
}

/* WINDMILL Animation */
@keyframes spinMolino {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.wm-wheel-group {
    transform-origin: 40px 20px;
}

/* BAROMETER NEEDLE */
#baro-needle-group {
    transform-origin: 50px 50px;
    transition: transform 1s ease;
}

/* RAIN TUBE */
.rain-tube {
    width: 20px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 4px;
}

.rain-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--accent-blue);
    height: 0%;
    /* Dinámico */
}

/* HUM GAUGE */
.hum-gauge-container {
    height: 150px;
    display: flex;
    gap: 10px;
}

.hum-track {
    width: 8px;
    background: linear-gradient(to top, #38bdf8, #22c55e, #eab308, #ef4444);
    border-radius: 4px;
    position: relative;
}

.hum-indicator {
    position: absolute;
    left: -10px;
    width: 28px;
    height: 3px;
    background: white;
    box-shadow: 0 0 10px white;
    bottom: 50%;
    /* Dinámico */
}

/* UTILS */
.text-orange {
    color: var(--accent-orange);
}

.data-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 15px 0;
}

.x-small {
    font-size: 0.6rem;
}

/* FORECAST SCROLL */
#forecast-container,
#hourly-container {
    padding-bottom: 10px;
}

.forecast-day,
.hourly-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.forecast-day:hover,
.hourly-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.scroll-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 30px;
    height: 60px;
    z-index: 10;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.scroll-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ALERTS */
.animated-blink {
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* --- HIGH FIDELITY GAUGES & METRICS --- */

/* Vertical Gauge System (Temp/Hum) */
.gauge-vertical-container {
    width: 65px;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.gv-track {
    width: 8px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.gv-fill {
    width: 100%;
    background: var(--accent-blue);
    position: absolute;
    bottom: 0;
    transition: height 0.5s ease, background 0.5s ease;
    border-radius: 4px;
}

.gv-label {
    font-size: 9px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
}

/* Temp Gradient */
#temp-gv-fill {
    background: linear-gradient(0deg, #3b82f6 0%, #ef4444 100%);
}

/* Humid Labels Positioning */
.hum-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100px;
    font-size: 8px;
    font-weight: 900;
    opacity: 0.6;
    text-align: right;
    margin-right: 5px;
}

/* Arc Gauge System (Pressure/UV) */
.gauge-arc-wrapper {
    width: 120px;
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-arc-svg {
    width: 100%;
    height: 100%;
}

.arc-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
    stroke-linecap: round;
}

.arc-fill-press {
    fill: none;
    stroke: url(#pressGradient);
    stroke-width: 8;
    stroke-linecap: round;
}

/* Partner Boxes (Ads) */
.partner-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    transition: all 0.3s ease;
}

.partner-box:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Typography Refinements */
.tendency-text {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-green);
    margin-top: 4px;
}

.tendency-text.down {
    color: #f87171;
}

.tendency-text.up {
    color: var(--accent-green);
}

.fidelity-card {
    min-height: 180px;
}

.mm-group-fidelity {
    font-size: 10px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
}

.mm-label {
    color: rgba(255, 255, 255, 0.4);
}

.mm-val-big {
    color: white;
    font-size: 11px;
}

/* Rain Table */
.rain-stats-table {
    width: 100%;
    font-size: 11px;
    font-weight: 800;
    margin-top: 10px;
}

.rain-stats-table td {
    padding: 2px 0;
}

.rain-stats-table .stat-label {
    color: rgba(255, 255, 255, 0.4);
}

.rain-stats-table .stat-val {
    text-align: right;
    color: white;
}

/* General consistency */
.display-3 {
    font-size: 3.5rem;
    letter-spacing: -2px;
}

/* Density Bar visuals */
.density-bar-container {
    width: 12px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.density-bar-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, var(--accent-orange), #fbbf24);
    transition: height 1s ease-in-out;
}

/* KP Forecast visuals */
.kp-forecast-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px;
    font-size: 0.65rem;
    flex: 1;
    text-align: center;
    line-height: 1.2;
}

/* Solar Arc refinements */
.sun-glow {
    filter: drop-shadow(0 0 10px #fbbf24);
}

.sun-time-badge {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

/* Lunar visuals */
.moon-visual-container {
    position: relative;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.moon-phase-img {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 70% 30%, #fff, #888);
    border-radius: 50%;
    box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
}

.moon-phase-img::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    border-radius: 50%;
    left: 40%;
    /* Simple crescent approximation */
    top: 0;
}

/* Agro Icons */
.agro-icon-bg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}


.btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* SOLAR ARC visuals */
.solar-arc-container {
    padding: 20px 0;
    text-align: center;
    position: relative;
}

.solar-arc-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

#solar-sun-group {
    transition: transform 1s ease-out;
}

#solar-progress {
    stroke-dashoffset: 0;
    transition: stroke-dasharray 2s ease-in-out;
}

.mt-n3 {
    margin-top: -1.5rem !important;
}

/* THI / AQI Color Logic */
.text-orange {
    color: var(--accent-orange) !important;
}

.bg-orange {
    background-color: var(--accent-orange) !important;
}

/* Header Centering Refinement */
.navbar {
    position: relative;
}

.header-establishment {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

@media (max-width: 991px) {
    .header-establishment {
        position: static;
        transform: none;
        margin: 10px 0;
        pointer-events: auto;
    }
}

/* Map sizing */
.map-container {
    height: 180px;
    width: 100%;
}

.iframe-map {
    width: 100%;
    height: 100%;
    filter: brightness(0.8) contrast(1.2);
}

/* Scrollbar Hide */
#forecast-container::-webkit-scrollbar,
#hourly-container::-webkit-scrollbar {
    display: none;
}

#forecast-container,
#hourly-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
    cursor: grab;
}

#forecast-container:active,
#hourly-container:active {
    cursor: grabbing;
}

/* Forecast Card Redesign */
.forecast-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 8px;
    min-width: 100px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.forecast-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.f-day-title {
    font-size: 0.7rem;
    font-weight: 800;
    opacity: 0.5;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.f-temp-range {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0;
}

.f-temp-min {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-left: 4px;
}

.f-sub-info {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
}

.f-label-gray {
    color: #888;
    text-transform: uppercase;
    font-size: 0.6rem;
}

.f-rain-prob {
    color: #4db8ff;
}

.f-rain-mm {
    color: #fff;
    font-weight: 700;
}

/* Hourly Card Redesign */
.hourly-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 8px;
    min-width: 85px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.h-time {
    font-size: 0.7rem;
    font-weight: 800;
}

.h-temp {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 2px 0;
}

.h-wind-dir {
    color: #4db8ff;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.h-wind-speed {
    font-size: 0.65rem;
    color: #aaa;
}

.h-wind-gust {
    color: #ff4d4d;
    font-weight: 700;
}

/* Windy Satellite Large Box */
.satellite-box {
    height: 380px !important;
}

.satellite-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 14px 14px;
}

/* --- GURU TABLE STYLES --- */
.guru-container {
    overflow-x: auto;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.guru-table th,
.guru-table td {
    padding: 6px 4px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #e2e8f0;
}

.guru-label {
    background-color: #0f172a;
    position: sticky;
    left: 0;
    z-index: 10;
    text-align: left !important;
    padding-left: 12px !important;
    font-weight: 700;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 120px;
    color: #94a3b8 !important;
}

.row-day {
    background-color: #1a2332;
    font-weight: 700;
    color: #fbbf24 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
    height: 42px;
}

/* --- LANDING PAGE STYLES --- */
.landing-hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.hero-content {
    max-width: 800px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 30%, var(--accent-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.service-grid {
    padding: 4rem 0;
}

.landing-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    cursor: default;
}

.landing-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-10px);
    border-color: var(--accent-green);
}

.landing-card i {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.client-portal-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.client-login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.btn-agro {
    background: var(--accent-green);
    color: black;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 100px;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.btn-agro:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    background: #4ade80;
    color: black;
}

.btn-outline-agro {
    border: 2px solid var(--accent-green);
    color: var(--accent-green) !important;
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 100px;
    transition: all 0.3s ease;
    background: transparent;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-agro:hover {
    background: var(--accent-green);
    color: black !important;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.floating-icon {
    animation: float 3s ease-in-out infinite;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .landing-card {
        padding: 1.5rem;
    }
}


.row-hour {
    background-color: #273549;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.7rem;
}

.cell-filled {
    font-weight: 800;
    border-radius: 2px;
}

.wind-cell-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.wind-arrow {
    font-size: 1rem;
    font-weight: bold;
    display: block;
}

.wind-dir-text {
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.8;
    text-transform: uppercase;
}

.cell-cloud {
    font-size: 0.7rem;
}

.cell-rain {
    color: #38bdf8 !important;
    font-weight: bold;
    border-right: 1px solid rgba(255, 255, 255, 0.02);
}

.cell-rain.has-rain {
    background-color: rgba(56, 189, 248, 0.1);
    color: #fff !important;
}

.prob-bar-container {
    height: 16px;
    width: 4px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 auto;
    border-radius: 1px;
    position: relative;
}

.prob-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #38bdf8;
    border-radius: 1px;
}

.prob-text {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-bottom: 1px;
}

/* Windguru Fidelity Container */
.windguru-fidelity {
    background: #f8f9fa;
    /* Matches official Windguru background */
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.windguru-mask {
    position: relative;
    overflow: hidden;
    height: 310px;
    /* Cropped height to show only data */
}

.windguru-mask iframe {
    margin-top: -38px;
    /* Hide internal title */
    height: 400px;
    width: 100%;
}

/* History Page Specific Table Styles */
.history-table {
    border-collapse: separate;
    border-spacing: 0;
}

.history-table thead th {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-table tbody td {
    padding: 1.2rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table .h5 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    padding-bottom: 0px;
}

/* NAVBAR REFINEMENTS */
.navbar-nav .nav-link {
    font-size: 0.75rem !important;
    letter-spacing: 0.5px;
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
}

.header-establishment {
    margin-right: 1.5rem;
    margin-left: 1.5rem;
}

.header-establishment .h5 {
    font-size: 0.85rem !important;
}

.header-establishment .small {
    font-size: 0.6rem !important;
}

.header-establishment .x-small {
    font-size: 0.5rem !important;
}

@media (max-width: 1400px) {
    .header-establishment {
        display: none !important;
        /* Hide on smaller desktops to avoid collision with menu */
    }
}

.map-container {
    width: 100%;
    height: 100%;
    min-height: 250px;
    background: #1e293b;
}