/* 
 * WeatherLink Dashboard - Premium Design System (theme.css)
 * Glassmorphic Dark Space Theme
 */

:root {
    --bg-space: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 50%, #020617 100%);
    --primary: #4facfe;
    --secondary: #00f2fe;
    --dark: #090d16;
    
    /* HSL Rich Tailored Colors for Weather Metrics */
    --color-temp: hsl(14, 88%, 60%);
    --color-temp-glow: rgba(249, 115, 22, 0.3);
    
    --color-humidity: hsl(187, 92%, 53%);
    --color-humidity-glow: rgba(6, 182, 212, 0.3);
    
    --color-wind: hsl(217, 91%, 60%);
    --color-wind-glow: rgba(59, 130, 246, 0.3);
    
    --color-rain: hsl(262, 83%, 68%);
    --color-rain-glow: rgba(139, 92, 246, 0.3);
    
    --color-solar: hsl(43, 96%, 56%);
    --color-solar-glow: rgba(245, 158, 11, 0.3);
    
    --color-dpv: hsl(142, 72%, 48%);
    --color-dpv-glow: rgba(16, 185, 129, 0.3);

    /* Glass System */
    --glass-bg: rgba(15, 23, 42, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    --glass-shadow-hover: 0 12px 40px 0 rgba(0, 0, 0, 0.55);
}

/* Base Body Styles */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-space);
    background-attachment: fixed;
    min-height: 100vh;
    color: #f8fafc;
    padding-bottom: 50px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Glassmorphic Navbar */
.navbar-custom {
    background: rgba(9, 13, 22, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.navbar-custom .navbar-brand {
    color: #ffffff !important;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.navbar-custom .nav-link {
    color: #cbd5e1 !important;
    font-weight: 500;
    padding: 8px 16px !important;
    margin: 0 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.navbar-custom .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05);
}

.navbar-custom .nav-link.active {
    color: #ffffff !important;
    background: rgba(79, 172, 254, 0.15);
    border: 1px solid rgba(79, 172, 254, 0.25);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.1);
}

/* Glassmorphic Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #f8fafc;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-hover);
}

/* Premium Buttons */
.btn-custom {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    color: white !important;
    border-radius: 30px;
    padding: 10px 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.45);
}

.btn-custom:active {
    transform: translateY(0);
}

.btn-outline-custom {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1 !important;
    border-radius: 30px;
    padding: 9px 22px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline-custom:hover, .btn-outline-custom.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Grid Metrics System */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 576px) {
    .metric-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-tile {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.metric-tile:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px 0 var(--accent-glow);
    transform: translateY(-2px);
}

.metric-tile .metric-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    filter: drop-shadow(0 2px 8px var(--accent-glow));
    transition: transform 0.3s ease;
}

.metric-tile:hover .metric-icon {
    transform: scale(1.15);
}

.metric-tile .metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
}

.metric-tile .metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Metric Colors Binding */
.tile-temp {
    --accent-color: var(--color-temp);
    --accent-glow: var(--color-temp-glow);
}
.tile-humidity {
    --accent-color: var(--color-humidity);
    --accent-glow: var(--color-humidity-glow);
}
.tile-wind {
    --accent-color: var(--color-wind);
    --accent-glow: var(--color-wind-glow);
}
.tile-rain {
    --accent-color: var(--color-rain);
    --accent-glow: var(--color-rain-glow);
}
.tile-solar {
    --accent-color: var(--color-solar);
    --accent-glow: var(--color-solar-glow);
}
.tile-dpv {
    --accent-color: var(--color-dpv);
    --accent-glow: var(--color-dpv-glow);
}

/* Active Rain Alerts */
.active-rain-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(147, 51, 234, 0.12) 100%);
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 25px 0 rgba(168, 85, 247, 0.15);
    border-radius: 24px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    animation: rain-pulse 3s infinite alternate ease-in-out;
}

@keyframes rain-pulse {
    0% {
        box-shadow: 0 0 15px 0 rgba(168, 85, 247, 0.1);
        border-color: rgba(168, 85, 247, 0.3);
    }
    100% {
        box-shadow: 0 0 35px 5px rgba(168, 85, 247, 0.35);
        border-color: rgba(168, 85, 247, 0.6);
    }
}

.active-rain-card::after {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 60%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
    transform: skewX(-25deg);
    animation: shine 4s infinite ease-in-out;
}

@keyframes shine {
    100% { left: 250%; }
}

.no-active-events {
    background: rgba(255, 255, 255, 0.015);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 50px 30px;
    text-align: center;
    color: #cbd5e1;
    backdrop-filter: blur(8px);
}

/* Custom Table Styles */
.table-custom {
    background: transparent !important;
    color: #e2e8f0 !important;
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
}

.table-custom thead th {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #94a3b8 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border: none !important;
    padding: 16px 20px !important;
}

.table-custom thead th:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table-custom thead th:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.table-custom tbody tr {
    background: rgba(255, 255, 255, 0.01) !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.table-custom tbody tr:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    transform: scale(1.003);
}

.table-custom tbody td {
    padding: 16px 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    color: #cbd5e1;
    vertical-align: middle;
}

.table-custom tbody tr td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table-custom tbody tr td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Custom Forms */
.form-select, .form-control {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 10px 16px !important;
    transition: all 0.3s ease !important;
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2) !important;
    background-color: rgba(15, 23, 42, 0.75) !important;
}

/* DataTables Overrides for Dark Mode */
.dataTables_wrapper {
    color: #cbd5e1 !important;
}

.dataTables_wrapper .dataTables_length select {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
    margin-left: 10px !important;
    outline: none !important;
    transition: all 0.3s ease !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2) !important;
}

.dataTables_wrapper .dataTables_info {
    color: #94a3b8 !important;
    padding-top: 15px !important;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 15px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    margin: 0 2px !important;
    transition: all 0.2s ease !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(79, 172, 254, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.02) !important;
    color: #64748b !important;
    cursor: default !important;
}

/* Badges Custom styling */
.badge-custom {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-finished {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

/* Navigation tabs custom */
.nav-tabs-custom {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-tabs-custom .nav-link {
    border: none !important;
    color: #94a3b8 !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 24px !important;
    transition: all 0.3s ease !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.nav-tabs-custom .nav-link:hover {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary) !important;
    border-bottom: 2px solid var(--primary) !important;
}

/* Visibilidad de textos mutados en fondos oscuros */
.text-muted {
    color: #94a3b8 !important;
}
.text-muted-light {
    color: #e2e8f0 !important;
    opacity: 0.8;
}

/* DataTables and Pagination overrides for Dark Mode */
.dataTables_wrapper label {
    color: #94a3b8 !important;
    font-size: 0.85rem !important;
    margin-bottom: 8px !important;
}

.dataTables_wrapper .dataTables_filter label input {
    margin-bottom: 0 !important;
}

/* Glassmorphic Pagination for Bootstrap 5 DataTables */
.pagination {
    margin-bottom: 0 !important;
    gap: 4px;
}
.page-item .page-link {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}
.page-item:first-child .page-link,
.page-item:last-child .page-link {
    border-radius: 8px !important;
}
.page-item .page-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
.page-item.active .page-link {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.2) !important;
}
.page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.01) !important;
    color: #64748b !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}
