/* Flood report styles — prefixed with flood- to avoid conflicts with existing site styles */
/* NOTE: Site uses html { font-size: 10px }, so all sizes use px instead of rem */

/* ============================
   BS5-like utilities (site uses BS3)
   ============================ */
.d-flex { display: flex; }
.d-none { display: none; }
.d-inline-block { display: inline-block; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-baseline { align-items: baseline; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.position-relative { position: relative; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.ms-2 { margin-left: 8px; }
.ms-3 { margin-left: 16px; }
.p-0 { padding: 0; }
.fw-bold { font-weight: 700; }
.fs-4 { font-size: 24px; }
.small { font-size: 85%; }

.text-center { text-align: center; }
.text-white { color: #fff; }
.alert-warning { color: #856404; background-color: #fff3cd; border: 1px solid #ffc107; padding: 12px 20px; border-radius: 4px; }
.list-group { padding-left: 0; margin-bottom: 0; }
.list-group-flush .list-group-item { border-left: 0; border-right: 0; border-radius: 0; }
.list-group-item { padding: 12px 20px; border: 1px solid #e9ecef; }
.col-lg-5, .col-lg-7 { float: left; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; }
@media (min-width: 992px) {
    .col-lg-5 { width: 41.6667%; }
    .col-lg-7 { width: 58.3333%; }
    .d-lg-none { display: none; }
}
@media (max-width: 991px) {
    .col-lg-5, .col-lg-7 { width: 100%; }
}
@media (min-width: 576px) {
    .d-sm-inline { display: inline !important; }
    .d-sm-none { display: none !important; }
}
@media (max-width: 575px) {
    .d-sm-inline { display: none !important; }
    .d-sm-none { display: inline !important; }
}
@media (min-width: 768px) {
    .mt-md-0 { margin-top: 0 !important; }
}

/* ============================
   HERO / EMPTY STATE
   ============================ */
.flood-hero {
    text-align: center;
    padding: 48px 16px 32px;
    max-width: 700px;
    margin: 0 auto;
}
.flood-hero-icon {
    font-size: 56px;
    margin-bottom: 8px;
}
.flood-hero h1 {
    color: #ffaf50;
    font-weight: 700;
    margin-bottom: 8px;
}
.flood-hero-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 24px;
}

/* Feature cards below search */
.flood-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
    text-align: center;
}
.flood-feature {
    padding: 20px 16px;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}
.flood-feature-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.flood-feature h3 {
    font-size: 16px;
    font-weight: 700;
    color: #272727;
    margin-bottom: 5px;
}
.flood-feature p {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .flood-features { grid-template-columns: 1fr; gap: 12px; }
    .flood-hero { padding: 32px 8px 16px; }
}

/* ============================
   SEARCH FORM
   ============================ */
.flood-search-form {
    max-width: 600px;
    margin: 0 auto;
}
.flood-search-row {
    display: flex;
    gap: 0;
}
.flood-search-input-wrap {
    position: relative;
    flex: 1 1 0%;
}
.flood-search-input-wrap .form-control {
    border-radius: 4px 0 0 4px;
}
.flood-search-row .flood-btn-primary {
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
}
.flood-btn-primary {
    background-color: #ffaf50;
    color: #fff;
    border: none;
    font-weight: 600;
}
.flood-btn-primary:hover,
.flood-btn-primary:focus {
    background-color: #f09830;
    color: #fff;
}

/* Inline search on report page */
.flood-search-inline {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}
.flood-search-row-compact .form-control {
    height: 38px;
    font-size: 14px;
}
.flood-search-row-compact .flood-btn-primary {
    height: 38px;
    font-size: 14px;
    padding: 0 16px;
}

@media (max-width: 480px) {
    .flood-search-row { flex-direction: column; gap: 8px; }
    .flood-search-input-wrap .form-control { border-radius: 4px; }
    .flood-search-row .flood-btn-primary { border-radius: 4px; }
}

/* ============================
   CARDS — PRIMARY vs SECONDARY
   ============================ */
.flood-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    background: white;
}
.flood-card-primary {
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.flood-card-secondary {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.flood-card-header {
    background-color: #272727;
    color: white;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    padding: 12px 20px;
    font-size: 15px;
}

/* Lighter header for secondary cards */
.flood-card-header-light {
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    padding: 10px 20px;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
}

.flood-card-body {
    padding: 16px 20px;
}

/* ============================
   FLOOD ZONE GRID (standalone report)
   ============================ */
.flood-zone-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.flood-zone-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 10px;
    border: 2px solid transparent;
}
.flood-zone-item-safe {
    background: #f0faf2;
    border-color: #c3e6cb;
}
.flood-zone-item-danger {
    background: #fdf0f0;
    border-color: #f5c6cb;
}
.flood-zone-item-label {
    font-weight: 700;
    font-size: 18px;
    color: #272727;
    margin-bottom: 4px;
}
.flood-zone-item-status {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.flood-zone-item-icon-safe { color: #28a745; }
.flood-zone-item-icon-danger { color: #dc3545; }
.flood-zone-item-desc {
    font-size: 11px;
    color: #6c757d;
    margin-top: 3px;
}

@media (max-width: 480px) {
    .flood-zone-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================
   WATER LEVEL
   ============================ */
.flood-station-info {
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px;
}
.flood-water-level {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
}
.flood-water-level-value {
    font-size: 40px;
    font-weight: 700;
    color: #272727;
    line-height: 1;
}
.flood-water-level-value small {
    font-size: 16px;
    font-weight: 400;
    color: #6c757d;
}
.flood-water-level-trend {
    font-size: 16px;
    font-weight: 600;
}
.flood-spa-badge {
    display: inline-block;
    font-size: 14px;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: 600;
    color: white;
}
.flood-spa-badge-normal { background-color: #28a745; }
.flood-spa-badge-info { background-color: #5bc0de; }
.flood-spa-badge-warning { background-color: #f0ad4e; }
.flood-spa-badge-danger { background-color: #dc3545; }

/* Water gauge */
.flood-gauge-container {
    position: relative;
    height: 32px;
    background-color: #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    margin: 8px 0;
}
.flood-gauge-fill {
    height: 100%;
    border-radius: 16px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-weight: 600;
    font-size: 14px;
    color: white;
}
.flood-gauge-normal { background: linear-gradient(90deg, #28a745, #5cb85c); }
.flood-gauge-spa1 { background: linear-gradient(90deg, #28a745, #ffc107); }
.flood-gauge-spa2 { background: linear-gradient(90deg, #ffc107, #fd7e14); }
.flood-gauge-spa3 { background: linear-gradient(90deg, #fd7e14, #dc3545); }

.flood-gauge-markers {
    position: relative;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

/* ============================
   MAP
   ============================ */
#flood-map {
    height: 420px;
    border-radius: 0 0 12px 12px;
    z-index: 1;
}

/* ============================
   HISTORICAL EVENTS
   ============================ */
.flood-event-flooded { border-left: 4px solid #dc3545; }
.flood-event-safe { border-left: 4px solid #28a745; }

/* ============================
   TREND INDICATORS
   ============================ */
.flood-trend-up { color: #dc3545; }
.flood-trend-down { color: #28a745; }
.flood-trend-stable { color: #6c757d; }

/* ============================
   RECOMMENDATIONS & REASONS
   ============================ */
.flood-recommendation-list,
.flood-reason-list {
    margin: 0;
    padding-left: 20px;
}
.flood-recommendation-list li,
.flood-reason-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}
.flood-reason-list {
    font-size: 14px;
    color: #555;
}

/* ============================
   ADDRESS HEADER
   ============================ */
.flood-address-header {
    padding: 16px 0 4px;
}
.flood-address-header h2 {
    color: #272727;
    margin: 0 0 2px;
    font-size: 22px;
    font-weight: 700;
}
.flood-address-meta {
    font-size: 14px;
    color: #999;
}
.flood-meta-sep {
    margin: 0 6px;
}

/* ============================
   RISK BANNER (separated from address)
   ============================ */
.flood-risk-banner {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.flood-risk-banner-success { background-color: #d4edda; color: #155724; }
.flood-risk-banner-warning { background-color: #fff3cd; color: #856404; }
.flood-risk-banner-danger { background-color: #f8d7da; color: #721c24; }
.flood-risk-banner-secondary { background-color: #e2e3e5; color: #383d41; }

/* Flood-scoped badges (avoid BS3/BS5 naming conflicts) */
.flood-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}
.flood-badge-danger { background-color: #dc3545; }
.flood-badge-success { background-color: #28a745; }

/* Disclaimer */
.flood-disclaimer {
    font-size: 13px;
    color: #6c757d;
    padding: 12px 20px;
}

/* ============================
   MOBILE SECTION NAV
   ============================ */
.flood-section-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
    margin-bottom: 12px;
    scrollbar-width: none;
}
.flood-section-nav::-webkit-scrollbar { display: none; }
.flood-section-nav-item {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.flood-section-nav-item:hover {
    background: #ffaf50;
    color: white;
    text-decoration: none;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    #flood-map { height: 300px; }
    .flood-risk-banner { font-size: 14px; padding: 6px 16px; }
    .flood-address-header { padding: 16px; }
    .flood-address-header h2 { font-size: 18px; }
    .flood-water-level-value { font-size: 32px; }
}

/* ============================
   ADDRESS SUGGEST DROPDOWN
   ============================ */
.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.suggest-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active {
    background-color: #fff8ef;
}
.suggest-name {
    font-weight: 600;
    font-size: 15px;
    color: #272727;
}
.suggest-label {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================
   LEAFLET OVERRIDES
   ============================ */
.leaflet-mapy-logo img {
    height: 24px;
}
/* Fix layer control: reset site's ez-checkbox styling and prevent scrollbar */
.leaflet-control-layers-list,
.leaflet-control-layers-scrollbar {
    overflow-y: visible !important;
    max-height: none !important;
}
.leaflet-control-layers .ez-checkbox {
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    background: none !important;
    vertical-align: middle !important;
}
.leaflet-control-layers .ez-checkbox input {
    display: inline-block !important;
    visibility: visible !important;
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    position: static !important;
    opacity: 1 !important;
    vertical-align: middle !important;
}
.leaflet-control-layers label {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    cursor: pointer !important;
}
.leaflet-control-layers label span {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

/* ============================
   INLINE BADGE FOR OFFER DETAIL
   ============================ */
.flood-zone-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}
.flood-zone-badge-danger { background-color: #f8d7da; color: #721c24; }
.flood-zone-badge-warning { background-color: #fff3cd; color: #856404; }
.flood-zone-badge-success { background-color: #d4edda; color: #155724; }
