/* ═══════════════════════════════════════════════════════════════════════════
   interactive/forecast_map.css  —  light theme for PlantCast
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.fmap-section {
    margin: 0 0 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow);
}

/* ── Section header ──────────────────────────────────────────────────────── */
.fmap-header {
    padding: 24px 28px 18px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1.5px solid var(--border);
    background: var(--bg);
}
.fmap-header-icon { font-size: 32px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.fmap-header-text h2 {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.4px;
}
.fmap-header-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.5;
}

/* ── Body: map + panel ───────────────────────────────────────────────────── */
.fmap-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    min-height: 480px;
}
@media (max-width: 860px) { .fmap-body { grid-template-columns: 1fr; } }

/* ── Map ─────────────────────────────────────────────────────────────────── */
.fmap-map-wrap { position: relative; min-height: 400px; }

#forecastMap {
    width: 100%;
    height: 100%;
    min-height: 400px;
    z-index: 1;
}

.fmap-map-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(23, 43, 61, 0.80);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    transition: opacity 0.4s;
}
.fmap-map-hint.hidden { opacity: 0; }

/* ── Right panel ─────────────────────────────────────────────────────────── */
.fmap-panel-wrap {
    display: flex;
    flex-direction: column;
    border-left: 1.5px solid var(--border);
    background: var(--bg);
    overflow-y: auto;
    max-height: 480px;
}
@media (max-width: 860px) {
    .fmap-panel-wrap { max-height: none; border-left: none; border-top: 1.5px solid var(--border); }
}

/* ── Plant selector ──────────────────────────────────────────────────────── */
.fmap-plant-select-wrap {
    padding: 16px 18px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.fmap-plant-select-wrap label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 7px;
}
.fmap-plant-select {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 36px 9px 12px;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B959E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.fmap-plant-select:focus { border-color: var(--green); }

/* ── Run button ──────────────────────────────────────────────────────────── */
.fmap-run-btn {
    margin: 12px 18px;
    padding: 11px 16px;
    background: linear-gradient(160deg, var(--green) 0%, var(--green-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(76, 203, 112, 0.30);
}
.fmap-run-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(76,203,112,.40); }
.fmap-run-btn:active:not(:disabled) { transform: scale(0.98); }
.fmap-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Result panel ────────────────────────────────────────────────────────── */
#fmapPanel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.fmap-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 22px;
    text-align: center;
    gap: 10px;
    color: var(--text-muted);
}
.fmap-empty-icon { font-size: 36px; opacity: 0.45; }
.fmap-empty p { font-size: 13px; font-weight: 600; line-height: 1.6; margin: 0; }

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.fmap-loader {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}
.fmap-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: fmap-spin 0.8s linear infinite;
}
@keyframes fmap-spin { to { transform: rotate(360deg); } }

/* ── Result card ─────────────────────────────────────────────────────────── */
.fmap-result {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    animation: fmap-fadein 0.3s ease;
}
@keyframes fmap-fadein {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: none; }
}

/* ── Location card ───────────────────────────────────────────────────────── */
.fmap-location-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
}
.fmap-location-city { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 5px; }
.fmap-location-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    align-items: center;
}
.fmap-zone-badge {
    background: var(--green-tint);
    color: var(--green-deep);
    border: 1px solid var(--green-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 800;
    font-size: 11px;
}

/* ── Can-I-plant status card ─────────────────────────────────────────────── */
.fmap-status-card { border-radius: var(--radius-sm); padding: 12px 13px; border: 1.5px solid; }
.fmap-status-card.status-yes  { background: rgba(76,203,112,.08);  border-color: rgba(76,203,112,.28); }
.fmap-status-card.status-wait { background: rgba(245,158,11,.08);  border-color: rgba(245,158,11,.28); }
.fmap-status-card.status-no   { background: rgba(239,68,68,.07);   border-color: rgba(239,68,68,.22); }
.fmap-status-card.status-risk { background: rgba(251,146,60,.08);  border-color: rgba(251,146,60,.25); }
.fmap-status-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.fmap-status-icon  { font-size: 18px; }
.fmap-status-label { font-size: 14px; font-weight: 800; color: var(--text); }
.fmap-status-sub   { font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 1.5; }

/* ── Section mini-title ──────────────────────────────────────────────────── */
.fmap-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ── Weather pills ───────────────────────────────────────────────────────── */
.fmap-weather-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fmap-weather-pill {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 7px 7px;
    text-align: center;
}
.fmap-weather-pill .wval { font-size: 15px; font-weight: 800; color: var(--text); display: block; }
.fmap-weather-pill .wlbl { font-size: 10px; font-weight: 700; color: var(--text-muted); display: block; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.3px; }

/* ── Frost dates ─────────────────────────────────────────────────────────── */
.fmap-frost-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fmap-frost-pill {
    background: rgba(147,197,253,.12);
    border: 1.5px solid rgba(59,130,246,.18);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
}
.fmap-frost-pill .fval { font-size: 13px; font-weight: 800; color: #1D4ED8; display: block; }
.fmap-frost-pill .flbl { font-size: 10px; font-weight: 700; color: #3B82F6; opacity: 0.7; margin-top: 2px; display: block; text-transform: uppercase; letter-spacing: 0.3px; }

/* ── Planting calendar ───────────────────────────────────────────────────── */
.fmap-events-list { display: flex; flex-direction: column; gap: 4px; }
.fmap-event-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
}
.fmap-event-row.ev-past   { opacity: 0.50; }
.fmap-event-row.ev-today  { border-color: var(--green-border); background: var(--green-tint); }
.fmap-event-row.ev-soon   { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.06); }
.fmap-event-icon  { font-size: 14px; flex-shrink: 0; }
.fmap-event-label { flex: 1; color: var(--text); }
.fmap-event-date  { color: var(--text-muted); white-space: nowrap; font-size: 11px; }

/* ── Stress alerts ───────────────────────────────────────────────────────── */
.fmap-alerts-list { display: flex; flex-direction: column; gap: 4px; }
.fmap-alert-row {
    display: flex; align-items: flex-start; gap: 7px;
    border-radius: var(--radius-sm); padding: 7px 10px;
    font-size: 12px; font-weight: 600; line-height: 1.4; border: 1.5px solid;
}
.fmap-alert-row.sev-low    { background: rgba(76,203,112,.07);  border-color: rgba(76,203,112,.2);  color: var(--green-deep); }
.fmap-alert-row.sev-medium { background: rgba(245,158,11,.08);  border-color: rgba(245,158,11,.22); color: #B45309; }
.fmap-alert-row.sev-high   { background: rgba(239,68,68,.07);   border-color: rgba(239,68,68,.2);   color: #991B1B; }
.fmap-alert-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

/* ── Watering card ───────────────────────────────────────────────────────── */
.fmap-watering-card {
    background: rgba(59,130,246,.06);
    border: 1.5px solid rgba(59,130,246,.18);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
}
.fmap-watering-status { font-weight: 800; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.fmap-watering-msg    { font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 1.4; }

/* ── GDD ──────────────────────────────────────────────────────────────────── */
.fmap-gdd-card {
    background: rgba(251,191,36,.07);
    border: 1.5px solid rgba(251,191,36,.22);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
}
.fmap-gdd-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: #92400E; margin-bottom: 7px; }
.fmap-gdd-progress { height: 6px; background: rgba(251,191,36,.2); border-radius: 3px; margin-bottom: 5px; overflow: hidden; }
.fmap-gdd-bar { height: 100%; background: linear-gradient(90deg, #F59E0B, #FBBF24); border-radius: 3px; transition: width 0.8s ease; }
.fmap-gdd-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: #B45309; }
.fmap-gdd-harvest { font-size: 12px; font-weight: 600; color: #92400E; margin-top: 5px; }

/* ── Error state ─────────────────────────────────────────────────────────── */
.fmap-error {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 28px 22px; text-align: center; gap: 8px;
}
.fmap-error-icon { font-size: 28px; }
.fmap-error p { font-size: 13px; font-weight: 600; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* ── Map marker ──────────────────────────────────────────────────────────── */
.fmap-marker-pin {
    width: 30px;
    height: 30px;
    background: #4CCB70;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,0.22);
    position: relative;
}
.fmap-marker-inner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-size: 12px;
    line-height: 1;
}

/* ── Leaflet attribution: hide the flag emoji added in v1.9 ─────────────── */
.leaflet-attribution-flag {
    display: none !important;
}