/* Giao diện "Trung tâm điều hành" - nền sáng, tông xanh ngọc (teal) + amber.
   Dựa trên Bootstrap 5.3 data-bs-theme="light" (đặt ở thẻ <html> mỗi trang), file này chỉ
   tinh chỉnh thêm màu nền/accent cho các thành phần của hệ thống. */

:root {
    --hydro-teal-dark: #0f3d3a;
    --hydro-teal: #0d9488;
    --hydro-teal-light: #14b8a6;
    --hydro-amber: #d97706;
    --hydro-amber-light: #f59e0b;
    --hydro-ink: #0f2b28;
    --hydro-text-muted: #5b6b6a;
    --hydro-bg: #f3f9f7;
    --hydro-border: #d7e8e4;

    --bs-primary: var(--hydro-teal);
    --bs-primary-rgb: 13, 148, 136;
    --bs-link-color: var(--hydro-teal);
    --bs-link-hover-color: var(--hydro-teal-dark);
}

body {
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(13, 148, 136, 0.06), transparent),
        radial-gradient(ellipse 900px 500px at 100% 0%, rgba(217, 119, 6, 0.05), transparent),
        var(--hydro-bg);
}

/* Navbar: nền xanh ngọc nhạt, chữ đậm màu tối để tương phản tốt */
.app-navbar {
    background: linear-gradient(135deg, #e3f6f2, #d3f0e8 60%, #c9ecdf) !important;
    border-bottom: 1px solid var(--hydro-border);
    box-shadow: 0 1px 6px rgba(15, 61, 58, 0.06);
}
.app-navbar .navbar-brand {
    color: var(--hydro-ink);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.app-navbar .navbar-brand i {
    color: var(--hydro-teal);
}
.app-navbar .nav-link {
    color: var(--hydro-ink);
    font-weight: 600;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .nav-link.active {
    color: var(--hydro-teal-dark);
}
.app-navbar .navbar-toggler {
    border-color: var(--hydro-border);
}

/* Nút / link chính dùng tông teal */
.btn-primary {
    background-color: var(--hydro-teal);
    border-color: var(--hydro-teal);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--hydro-teal-dark);
    border-color: var(--hydro-teal-dark);
}
a, .link-secondary {
    color: var(--hydro-teal);
}
.text-bg-info {
    background-color: var(--hydro-teal-light) !important;
    color: #04211d !important;
}

/* Card: viền nhấn amber phía trên, tiêu đề đậm */
.card {
    border-top: 3px solid var(--hydro-teal-light);
    border-radius: 0.6rem;
    box-shadow: 0 2px 10px rgba(15, 61, 58, 0.06);
}
.card.station-card, .card#stationPanel {
    border-top: 3px solid var(--hydro-amber-light);
}
.card-title, h1, h2 {
    color: var(--hydro-ink);
}

/* Widget tổng quan (overview stat cards) */
.stat-card {
    border-top: 3px solid var(--hydro-amber-light);
    border-radius: 0.6rem;
    background: #fff;
    height: 100%;
}
.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hydro-teal), var(--hydro-amber-light));
    color: #fff;
    font-size: 20px;
    flex: 0 0 auto;
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--hydro-ink);
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--hydro-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stat-trend-up { color: #dc2626; }
.stat-trend-down { color: #16a34a; }

/* Ticker trực tiếp (map.php side panel) */
.ticker-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    margin-right: 6px;
    animation: ticker-blink 1.2s infinite;
}
@keyframes ticker-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}
.ticker-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--hydro-ink);
}
.ticker-flash-up { animation: ticker-flash-up 1.2s ease-out; }
.ticker-flash-down { animation: ticker-flash-down 1.2s ease-out; }
@keyframes ticker-flash-up {
    0% { color: #16a34a; text-shadow: 0 0 8px rgba(22, 163, 74, 0.5); }
    100% { color: var(--hydro-ink); text-shadow: none; }
}
@keyframes ticker-flash-down {
    0% { color: #dc2626; text-shadow: 0 0 8px rgba(220, 38, 38, 0.5); }
    100% { color: var(--hydro-ink); text-shadow: none; }
}

.text-purple {
    color: #7c3aed;
}

.tbl-scroll {
    max-height: 280px;
    overflow-y: auto;
}
.tbl-scroll table thead th {
    position: sticky;
    top: 0;
    background: #fff;
}

.station-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}
.station-card:hover {
    box-shadow: 0 4px 14px rgba(15, 61, 58, 0.14);
    transform: translateY(-2px);
    color: inherit;
}

.auth-card {
    max-width: 380px;
    width: 100%;
}

/* Bản đồ (map.php) */
#map {
    height: 640px;
    border-radius: 0.5rem;
    border: 1px solid var(--hydro-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
#stationPanel {
    max-height: 640px;
    overflow-y: auto;
}
.map-legend {
    background: #fff;
    padding: 8px 10px;
    border: 1px solid var(--hydro-border);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    line-height: 1.6;
}
.archipelago-label {
    background: #fffbeb;
    border: 1px solid #b91c1c;
    color: #b91c1c;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 6px;
}
.map-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 4px currentColor;
}
