/**
 * Previsão de Chuva - Estilos exclusivos
 * Usado em: page-previsao-de-chuva
 *
 * @package MetSul
 */

:root {
    --pc-primary: #0463a5;
    --pc-secondary: #1E88E5;
    --pc-border-gray: #e8eef3;
}

/* =====================================================
   PAGE CONTAINER
   ===================================================== */

.ms-rainfall-page {
    background: linear-gradient(180deg, #f0f4f8 0%, #e8eef3 100%);
    min-height: 70vh;
    padding-bottom: 60px;
}

/* =====================================================
   HERO
   ===================================================== */

.ms-rainfall-hero {
    background: linear-gradient(135deg, var(--ms-blue-dark, #003377) 0%, #1E88E5 100%);
    padding: 50px 20px 40px;
    text-align: center;
    position: relative;
}

.ms-rainfall-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E") repeat;
    background-size: 80px;
    opacity: 0.5;
}

.ms-rainfall-hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.ms-rainfall-hero__icon {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.ms-rainfall-hero__title {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ms-rainfall-hero__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ms-rainfall-hero .ms-city-search {
    max-width: 480px;
    margin: 0 auto;
}

/* Search Box no Hero (legacy - fallback) */
.ms-rainfall-search {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.ms-rainfall-search__wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.ms-rainfall-search__input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: var(--font-main, "Open Sans", sans-serif);
    transition: box-shadow 0.3s ease;
}

.ms-rainfall-search__input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.ms-rainfall-search__location {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ms-blue-nav, #0066BF);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ms-rainfall-search__location:hover {
    color: var(--ms-orange-cta, #FC7E00);
    transform: translateY(-50%) scale(1.1);
}

.ms-rainfall-search__location.loading {
    animation: ms-spin 1s linear infinite;
    pointer-events: none;
}

@keyframes ms-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.ms-rainfall-search__clear {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ms-rainfall-search__clear.show {
    display: flex;
}

.ms-rainfall-search__clear:hover {
    color: #e74c3c;
}

.ms-rainfall-search__btn {
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 700;
    background: var(--ms-orange-cta, #FC7E00);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(252, 126, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ms-rainfall-search__btn:hover {
    background: #e57200;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 126, 0, 0.5);
}

.ms-rainfall-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

.ms-rainfall-dropdown.show {
    display: block;
}

.ms-rainfall-dropdown__item {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
    font-size: 15px;
    color: #333;
    text-align: left;
}

.ms-rainfall-dropdown__item:last-child {
    border-bottom: none;
}

.ms-rainfall-dropdown__item:hover,
.ms-rainfall-dropdown__item.active {
    background: linear-gradient(90deg, rgba(0, 102, 191, 0.08), transparent);
    color: var(--ms-blue-nav, #0066BF);
}

.ms-rainfall-dropdown__item strong {
    color: var(--ms-blue-nav, #0066BF);
}

/* =====================================================
   CITY HEADER
   ===================================================== */

.ms-rainfall-city {
    background: #fff;
    padding: 18px 20px;
    text-align: center;
    color: var(--ms-blue-dark, #003377);
    font-weight: 700;
    font-size: 22px;
    display: none;
    border-bottom: 3px solid #1E88E5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ms-rainfall-city.show {
    display: block;
}

/* =====================================================
   LOADING
   ===================================================== */

.ms-rainfall-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--ms-blue-nav, #0066BF);
    font-weight: 600;
    display: none;
}

.ms-rainfall-loading.show {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* =====================================================
   FORECAST CONTAINER
   ===================================================== */

.ms-pc-forecast-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: auto;
    max-width: 1200px;
    padding: 30px 20px;
}

/* =====================================================
   CHART
   ===================================================== */

.ms-pc-chart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    border: 1px solid var(--pc-border-gray);
    position: relative;
    overflow: hidden;
}

.ms-pc-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pc-primary), var(--pc-secondary));
}

.ms-pc-chart-container h3 {
    margin: 0 0 20px 0;
    color: var(--pc-primary);
    font-size: 20px;
    font-weight: 600;
}

#previsaoChart {
    position: relative;
    height: 300px;
}

/* =====================================================
   RAIN CARDS
   ===================================================== */

.ms-pc-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.ms-pc-card {
    background: #fff;
    border-radius: 4px;
    padding: 16px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.ms-pc-card:hover,
.ms-pc-card.card-active {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(4, 99, 165, 0.15);
    border-color: var(--pc-primary);
}

.ms-pc-card-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--pc-primary);
    background: rgba(4, 99, 165, 0.08);
    padding: 6px 10px;
    border-radius: 4px;
    width: 100%;
}

.ms-pc-card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-pc-card-icon i {
    font-size: 40px;
    color: var(--pc-primary);
}

.ms-pc-card-icon i.fa-sun-o {
    color: #FFA726;
}

.ms-pc-card-icon i.fa-cloud {
    color: #90CAF9;
}

.ms-pc-card-icon i.fa-tint {
    color: #42A5F5;
}

.ms-pc-card-icon i.fa-bolt {
    color: #FF9800;
}

.ms-pc-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--pc-primary);
}

.ms-pc-card-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
}

.ms-pc-card-category {
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.ms-pc-card-bar {
    height: 6px;
    background: var(--pc-border-gray);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.ms-pc-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pc-primary), var(--pc-secondary));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   DOWNLOAD
   ===================================================== */

.ms-pc-download {
    text-align: center;
    padding: 20px;
}

.ms-pc-btn-download {
    display: inline-block;
    padding: 12px 20px;
    font-size: 18px;
    border: 2px solid #143953;
    color: #143953;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.ms-pc-btn-download:hover {
    background: #ededed;
}

/* =====================================================
   FOOTER NOTE
   ===================================================== */

.ms-pt-footer-note {
    text-align: center !important;
    font-size: 14px;
    padding: 30px 20px;
    color: #666;
    max-width: 700px;
    margin: 0 auto !important;
    line-height: 1.5;
    display: block !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .ms-pc-autocomplete-wrapper {
        width: 100%;
        margin-bottom: 10px;
    }

    .ms-pc-busca {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .ms-pc-btn-buscar {
        width: 100%;
        max-width: 300px;
        margin-left: 0;
    }

    .ms-pc-cards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .ms-pc-card {
        padding: 10px 6px;
        gap: 6px;
    }

    .ms-pc-card-date {
        font-size: 10px;
        padding: 4px 6px;
    }

    .ms-pc-card-icon {
        width: 32px;
        height: 32px;
    }

    .ms-pc-card-icon i {
        font-size: 20px;
    }

    .ms-pc-card-value {
        font-size: 16px;
    }

    .ms-pc-card-category {
        font-size: 8px;
    }

    #previsaoChart {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .ms-pc-card-date {
        font-size: 9px;
    }

    .ms-pc-card-value {
        font-size: 14px;
    }

    .ms-pc-card-category {
        font-size: 7px;
    }

    #previsaoChart {
        height: 200px;
    }
}

.hide {
    display: none !important;
}
