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

:root {
    --bg-main: #0b0f19;
    --bg-glass: rgba(16, 23, 38, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f4f8;
    --text-muted: #8b9bb4;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    position: relative;
}

/* Background effects */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
}

body::before {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.15);
}

body::after {
    bottom: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.15);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 48px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-links a.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
    border-left: 3px solid var(--accent-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Dashboard Cards */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-title {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.card-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-value.online { color: var(--accent-green); }
.card-value.offline { color: var(--accent-red); }

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.btn-primary {
    background: var(--accent-blue);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Tables */
.table-container {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14px;
    background: rgba(0,0,0,0.2);
}

td {
    font-size: 15px;
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

/* Modals & Forms */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}
.modal.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
}
.form-control:focus {
    border-color: var(--accent-blue);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

/* Bottom Nav (Hidden on Desktop) */
.bottom-nav {
    display: none;
}

/* Mobile Responsiveness (APK-like) */
@media (max-width: 768px) {
    body {
        display: block;
    }
    
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-bottom: 90px; /* Space for bottom nav */
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-main);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-glass);
        padding: 12px 0;
        justify-content: space-around;
        z-index: 999;
    }
    
    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 11px;
        gap: 6px;
        transition: all 0.3s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .bottom-nav a i {
        font-size: 24px;
    }
    
    .bottom-nav a.active {
        color: var(--accent-blue);
    }
    
    .bottom-nav a.active i {
        transform: translateY(-2px);
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .grid-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Responsive Table Wrapper */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Modal full width on mobile */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Make flex rows stack vertically */
    div[style*="display: flex"] {
        flex-wrap: wrap;
    }
    
    div[style*="flex: 1"], div[style*="flex: 2"] {
        flex: 1 1 100% !important;
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Specifically for traffic filter layout */
    .table-container + div#paginationControls {
        flex-direction: column;
        gap: 15px;
    }
}

