/* assets/css/style.css */

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #cda45e;
    /* Gold */
    --primary-hover: #d4af37;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --backdrop-blur: 12px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border: var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glass-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Typography & Links */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px rgba(205, 164, 94, 0.4);
}

/* Sidebar */
.sidebar {
    height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #0b1120 0%, #1a2333 100%);
    border-right: var(--glass-border);
    padding: 20px;
    z-index: 1000;
}

.sidebar-logo {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo span {
    color: var(--primary);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(205, 164, 94, 0.1);
    color: var(--primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 2rem;
}

/* Cards & Stats */
.stat-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

/* Forms */
.form-control {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 10px 15px;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(205, 164, 94, 0.1);
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #aa8540 100%);
    border: none;
    color: #000;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e5be6b 0%, #bd9346 100%);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(205, 164, 94, 0.3);
}

/* Tables */
.table-dark-custom {
    background: transparent;
    color: var(--text-muted);
}

.table-dark-custom th {
    color: var(--text-main);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
}

.table-dark-custom td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    vertical-align: middle;
}

/* Status Badges */
.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online,
.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-offline,
.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-maintenance {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Map Container */
#map {
    width: 100%;
    height: 600px;
    border-radius: 12px;
    border: var(--glass-border);
}

/* Login Page Specific */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top right, #1e293b 0%, #0f172a 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}

/* =========================================
   ANIMATIONS & ENHANCED SIDEBAR
   ========================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced Glass Panel for Sidebar */
.sidebar-panel-animated {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Enhanced Alert List Items */
.alert-item {
    position: relative;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    /* Starts hidden for animation */
}

/* Stagger animations for items */
.alert-item:nth-child(1) {
    animation-delay: 0.1s;
}

.alert-item:nth-child(2) {
    animation-delay: 0.2s;
}

.alert-item:nth-child(3) {
    animation-delay: 0.3s;
}

.alert-item:nth-child(4) {
    animation-delay: 0.4s;
}

.alert-item:hover {
    transform: translateX(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

.alert-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--text-muted);
    border-radius: 4px 0 0 4px;
    transition: width 0.3s;
}

.alert-item:hover::before {
    width: 6px;
}

/* Alert Types Styling */
.alert-item.type-danger::before {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.alert-item.type-warning::before {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

.alert-item.type-success::before {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* Icon Pulse for Critical Alerts */
.alert-icon-pulse {
    animation: pulse-red 2s infinite;
    border-radius: 50%;
}

/* Chart Container Polish */
.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

.chart-legend-custom {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Scrollbar styling for lists */
.custom-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.custom-scroll::-webkit-scrollbar {
    width: 5px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Fix Placeholder Color */
::placeholder {
    color: rgba(148, 163, 184, 0.6) !important;
    opacity: 1;
}

:-ms-input-placeholder {
    color: rgba(148, 163, 184, 0.6) !important;
}

::-ms-input-placeholder {
    color: rgba(148, 163, 184, 0.6) !important;
}

/* Fix Table Action Buttons Contrast */
.btn-outline-light {
    color: #cbd5e1 !important;
    /* light gray text */
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.btn-outline-light:hover {
    background: #fff !important;
    color: #0f172a !important;
    /* Dark text on hover */
    border-color: #fff !important;
}


/* Map Professional Enhancements */
.map-container-wrapper {
    position: relative;
    height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.map-sidebar-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    bottom: 20px;
    width: 320px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}