/* ==========================================================================
   SOLAR WEATHER PLATFORM - PREMIUM GLASSMORPHISM SYSTEM
   ========================================================================== */

/* Google Fonts - Inter & Outfit */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Light Theme (Default) variables */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --mesh-color-1: rgba(99, 102, 241, 0.08);
    --mesh-color-2: rgba(244, 63, 94, 0.08);
    --mesh-color-3: rgba(16, 185, 129, 0.08);
    
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: rgba(31, 38, 135, 0.05);
    
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(255, 255, 255, 0.8);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Brand & Accent Colors (Harmony-rich HSL) */
    --primary: hsl(238, 83%, 62%);
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: hsl(340, 82%, 58%);
    --accent: hsl(160, 84%, 39%);
    --accent-glow: rgba(16, 185, 129, 0.2);
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(0, 84%, 60%);
    --info: hsl(199, 89%, 48%);
    
    --sidebar-bg: rgba(255, 255, 255, 0.55);
    --sidebar-border: rgba(255, 255, 255, 0.7);
    --sidebar-active: rgba(99, 102, 241, 0.1);
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --blur-strength: 16px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 100%);
    --mesh-color-1: rgba(99, 102, 241, 0.15);
    --mesh-color-2: rgba(244, 63, 94, 0.12);
    --mesh-color-3: rgba(16, 185, 129, 0.12);
    
    --glass-bg: rgba(17, 24, 39, 0.45);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    
    --card-bg: rgba(24, 31, 48, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --primary: hsl(238, 85%, 66%);
    --primary-glow: rgba(129, 140, 248, 0.3);
    --secondary: hsl(340, 85%, 62%);
    --accent: hsl(160, 84%, 45%);
    --accent-glow: rgba(52, 211, 153, 0.2);
    
    --sidebar-bg: rgba(17, 24, 39, 0.6);
    --sidebar-border: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(129, 140, 248, 0.15);
}

/* Base Reset & Background Mesh */
body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    position: relative;
    transition: background var(--transition-smooth);
}

body::before, body::after, .bg-mesh {
    content: "";
    position: fixed;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
    animation: floatingMesh 25s infinite alternate ease-in-out;
}

body::before {
    top: -10%;
    left: -10%;
    background: var(--mesh-color-1);
}

body::after {
    bottom: -10%;
    right: -10%;
    background: var(--mesh-color-2);
    animation-delay: -5s;
}

.bg-mesh {
    top: 40%;
    left: 60%;
    background: var(--mesh-color-3);
    animation-delay: -12s;
}

@keyframes floatingMesh {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.15); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.4);
}

/* Typography Customizations */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Glass Panel Wrapper */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    transition: var(--transition-smooth);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: 16px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px 0 rgba(31, 38, 135, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    background: rgba(100, 116, 139, 0.1);
    color: var(--primary);
}

/* Sidebar Styling */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    padding: 24px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    margin-bottom: 32px;
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.sidebar-brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.sidebar-link i {
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--primary);
    background: var(--sidebar-active);
}

.sidebar-link.active i {
    transform: scale(1.15);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin-bottom: 16px;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.content-title {
    font-size: 1.75rem;
    margin: 0;
}

.content-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Glass Stats Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin: 8px 0;
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Weather Dashboard Dial Grid */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Pulse Animation for Online Status */
.pulse-online {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: statusPulse 1.8s infinite ease-in-out;
}

.pulse-offline {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--text-muted);
    border-radius: 50%;
}

@keyframes statusPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Progress bar inside table or cards */
.progress-bar-custom {
    height: 6px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transition: width 0.8s ease-in-out;
}

/* Login Page Styling */
.login-page-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 10;
}

/* Premium Buttons styling */
.btn-premium-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition-smooth);
}

.btn-premium-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    background: linear-gradient(135deg, #4f46e5 0%, var(--primary) 100%);
}

.btn-premium-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-premium-secondary:hover {
    transform: translateY(-2px);
    background: rgba(100, 116, 139, 0.1);
    color: var(--primary);
}

.form-control-glass {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    transition: var(--transition-smooth);
}

[data-theme="dark"] .form-control-glass {
    background: rgba(17, 24, 39, 0.3);
}

.form-control-glass:focus {
    background: rgba(255, 255, 255, 0.35);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control-glass:focus {
    background: rgba(17, 24, 39, 0.45);
}

/* Table customizations */
.table-glass {
    color: var(--text-primary);
    margin: 0;
}

.table-glass th {
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--glass-border);
    padding: 16px 24px;
}

.table-glass td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

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

/* Modals glass effect */
.modal-glass .modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    color: var(--text-primary);
    border-radius: 20px;
}

.modal-glass .modal-header {
    border-bottom: 1px solid var(--glass-border);
}

.modal-glass .modal-footer {
    border-top: 1px solid var(--glass-border);
}

/* Responsive Hide sidebar for Mobile and show Toggle */
.mobile-nav {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.3s ease-in-out;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 80px;
    }
    .mobile-nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--sidebar-bg);
        border-bottom: 1px solid var(--sidebar-border);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 99;
        padding: 0 20px;
        align-items: center;
        justify-content: space-between;
    }
    .mobile-nav-toggle {
        font-size: 1.5rem;
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
