:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #f1f5f9;
    --border-color-dark: #cbd5e1;
    --text-dark: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;
    --text-gray-500: #64748b;
    --blue-primary: #1e3a8a;
    --blue-hover: #172554;

    /* Status Colors */
    --color-normal: #16a34a;
    --color-normal-bg: #f0fdf4;
    --color-low: #d97706;
    --color-low-bg: #fffbeb;
    --color-warning: #ea580c;
    --color-warning-bg: #fff7ed;
    --color-danger: #dc2626;
    --color-danger-bg: #fef2f2;

    /* Water Gradient Colors */
    --water-normal-start: #2563eb;
    --water-normal-end: #38bdf8;
    --water-low-start: #0891b2;
    --water-low-end: #67e8f9;
    --water-warning-start: #ea580c;
    --water-warning-end: #fbbf24;
    --water-danger-start: #dc2626;
    --water-danger-end: #f97316;

    --transition-speed: 0.5s;
}

.btn__nivel__rio {
    position: fixed;
    z-index: 100;
    left: 60px;
    bottom: 150px;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    background-color: #ffffff;
    border-radius: 99999px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}
/*
.btn__nivel__rio:hover {
    transform: translateX(-50%) scale(1.08);
}

.btn__nivel__rio:active {
    transform: translateX(-50%) scale(0.96);
}*/

.nivel__rio__wrapp__marker {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.nivel__rio__wrapp__marker--back {
    position: absolute;
        width: 105px;
        height: 105px;
        background: #dc2626;
        border-radius: 99999px;
        z-index: 18;
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.nivel__rio__wrapp__marker--back::before {
    content: "";
    display: block;
    width: 77px;
    height: 46px;
    background-color: #dc2626;
    position: absolute;
    top: 89px;
    left: 14px;
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.nivel__rio__nivel__dia {
    position: absolute;
        left: 89px;
        padding: 6px 14px;
        background-color: #003b67;
        border: 3px solid #ffffff;
        color: #ffffff;
        font-weight: 800;
        font-size: 22px;
        border-top-right-radius: 30px;
        border-bottom-right-radius: 30px;
        box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.15);
        white-space: nowrap;
        z-index: 10;
}

.floatModalNivel-rio {
    border: none;
    border-radius: 24px;
    background-color: #f8fafc;
    max-width: 980px;
    width: calc(100% - 2rem);
    margin: auto;
    outline: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.floatModalNivel-rio::backdrop {
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-body-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    max-height: 90dvh;
    scrollbar-width: thin;
}

.card {
    width: 100%;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.card-header-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-gray-500);
    text-transform: uppercase;
}

.card-header-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (min-width: 640px) {
    .card-body {
        grid-template-columns: 1.1fr 0.9fr;
        padding: 1.75rem;
    }
}

.left-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.main-metric-wrapper {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.water-tank {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #f0f9ff;
    border: 1px solid #e0f2fe;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.measurement-scale {
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 7px;
    color: #0284c7;
    font-weight: 800;
    padding: 8px 0;
    z-index: 10;
    user-select: none;
    opacity: 0.7;
}

.water-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height var(--transition-speed) ease-out,
        background var(--transition-speed) ease-out;
}

.buoy-wrapper {
    position: absolute;
    left: 33px;
    transition: bottom var(--transition-speed) ease-out;
    z-index: 20;
}

.buoy-svg {
    width: 24px;
    height: 24px;
    color: #ef4444;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-3px);
    }
}

@keyframes waveMove {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-25%);
    }
    100% {
        transform: translateX(0);
    }
}

.wave-svg {
    position: absolute;
    width: 200%;
    height: 16px;
}

.wave-top {
    top: -12px;
    left: 0;
    opacity: 0.85;
    animation: waveMove 6s ease-in-out infinite;
}

.wave-back {
    top: -8px;
    left: 0;
    opacity: 0.6;
    animation: waveMove 10s ease-in-out infinite -2s;
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-value-container {
    display: flex;
    align-items: baseline;
}

.metric-value {
    font-size: 3rem;
    font-weight: 300;
    color: var(--text-dark);
    letter-spacing: -0.05em;
    line-height: 1;
}

.metric-unit {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    margin-left: 0.15rem;
}

.metric-sub {
    font-size: 0.825rem;
    color: var(--text-gray-500);
    font-weight: 600;
    margin-top: 0.4rem;
}

.status-section {
    margin-top: 1.25rem;
}

.status-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.3s;
}

.details-btn {
    background: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-normal);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    outline: none;
    padding: 10px 10px;
    border: 1px solid var(--color-normal);
    border-radius: 12px;
}

.details-btn:hover {
    color: #fff;
    background-color: var(--color-normal);
}

.details-btn svg {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    transition: transform 0.3s;
}

.details-btn.active svg {
    transform: rotate(90deg);
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.825rem;
    color: var(--text-gray-500);
}

.info-value {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.trend-icon-svg {
    width: 14px;
    height: 14px;
    margin-left: 4px;
}

.history-section {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    margin-top: 20px;
    width: 100%;
}

.history-section.expanded {
    grid-template-rows: 1fr;
    overflow: initial;
}

.history-inner {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 0;
    border: 0 solid transparent;
    transition: padding 0.4s, border-width 0.4s, border-color 0.4s;
}

.history-section.expanded .history-inner {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.history-header-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-header-title svg {
    width: 16px;
    height: 16px;
    color: var(--blue-primary);
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.stat-mini-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.stat-mini-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-mini-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-mini-value span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    margin-left: 0.125rem;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.history-table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.history-table th {
    background-color: #f8fafc;
    color: var(--text-gray-500);
    font-weight: 700;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

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

.status-indicator {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 10px;
    padding: 0.125rem 0.5rem;
    border-radius: 20px;
}

.export-btn {
    background-color: var(--blue-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
}

.export-btn:hover {
    background-color: var(--blue-hover);
}

.history-actions {
    display: flex;
    justify-content: flex-end;
}

.status-low-text {
    color: var(--color-low);
}
.status-normal-text {
    color: var(--color-normal);
}
.status-warning-text {
    color: var(--color-warning);
}
.status-danger-text {
    color: var(--color-danger);
    animation: pulse 2s infinite;
}

.badge-low-text {
    color: var(--color-low);
    background-color: var(--color-low-bg);
}
.badge-normal-text {
    color: var(--color-normal);
    background-color: var(--color-normal-bg);
}
.badge-warning-text {
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
}
.badge-danger-text {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

.water-low-bg {
    background: linear-gradient(
        to top,
        var(--water-low-start),
        var(--water-low-end)
    );
}
.water-normal-bg {
    background: linear-gradient(
        to top,
        var(--water-normal-start),
        var(--water-normal-end)
    );
}
.water-warning-bg {
    background: linear-gradient(
        to top,
        var(--water-warning-start),
        var(--water-warning-end)
    );
}
.water-danger-bg {
    background: linear-gradient(
        to top,
        var(--water-danger-start),
        var(--water-danger-end)
    );
}

.fill-sky-400 {
    fill: var(--water-normal-end);
    transition: fill var(--transition-speed);
}
.fill-sky-300 {
    fill: #7dd3fc;
    transition: fill var(--transition-speed);
}
.fill-cyan-300 {
    fill: var(--water-low-end);
    transition: fill var(--transition-speed);
}
.fill-cyan-200 {
    fill: #a5f3fc;
    transition: fill var(--transition-speed);
}
.fill-orange-400 {
    fill: var(--water-warning-end);
    transition: fill var(--transition-speed);
}
.fill-orange-300 {
    fill: #fde047;
    transition: fill var(--transition-speed);
}
.fill-red-400 {
    fill: var(--water-danger-end);
    transition: fill var(--transition-speed);
}
.fill-red-300 {
    fill: #fca5a5;
    transition: fill var(--transition-speed);
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-notification.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#btn__nivel__rio__dialog__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-gray-500);
    padding: 0.5rem;
    transition: color 0.2s, transform 0.1s;
}

#btn__nivel__rio__dialog__close:hover {
    color: var(--text-dark);
    transform: scale(1.1);
}
