/* ========================================
   CYBERX — ADMIN COMMAND CENTER STYLES
   ======================================== */

:root {
    --admin-primary: #00f0ff;
    /* Neon Cyan */
    --admin-secondary: #7b2ff7;
    /* Deep Purple */
    --admin-bg: #030308;
    --admin-card-bg: rgba(10, 15, 25, 0.8);
}

/* Light Theme Admin Support */
html.light-theme .admin-layout { background: #f0f2f5; color: #1a1a2e; }
html.light-theme .admin-sidebar { background: #ffffff; border-color: rgba(0,0,0,0.1); }
html.light-theme .admin-logo { border-color: rgba(0,0,0,0.05); }
html.light-theme .logo-text { color: #1a1a2e !important; }
html.light-theme .admin-link { color: #5e5e7a; }
html.light-theme .admin-link:hover, 
html.light-theme .admin-link.active { background: rgba(0, 240, 255, 0.05); color: var(--admin-primary); }
html.light-theme .admin-topbar { background: #ffffff; border-color: rgba(0,0,0,0.05); color: #1a1a2e; }
html.light-theme .topbar-title, 
html.light-theme .admin-name { color: #1a1a2e; }
html.light-theme .pulse-card, 
html.light-theme .data-card, 
html.light-theme .admin-table-container { background: #ffffff; border-color: rgba(0,0,0,0.05); box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
html.light-theme .pulse-value { color: #1a1a2e; }
html.light-theme .admin-table td { color: #1a1a2e; border-bottom-color: rgba(0,0,0,0.02); }
html.light-theme .admin-table th { background: rgba(0, 240, 255, 0.05); color: var(--admin-primary); }
html.light-theme .pulse-label { color: #5e5e7a; }
html.light-theme .circle-bg { stroke: rgba(0,0,0,0.03); }

.switching-dir *,
.switching-dir {
    transition: none !important;
    animation: none !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0;
    padding: 0;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--admin-bg);
    font-family: 'Rajdhani', sans-serif;
    color: #e0e0f0;
    overflow-x: hidden;
    /* Lock horizontal scrolling */
    scrollbar-gutter: stable;
    /* Prevent layout jump */
}

/* Sidebar - Command Style */
.admin-sidebar {
    width: 260px;
    height: 100vh;
    background: var(--admin-bg);
    border-right: 1px solid rgba(0, 240, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.admin-logo {
    padding: 30px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.05);
}

.logo-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.admin-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.admin-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 15px 25px;
    padding-left: 20px;
    color: #a0a0c0;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
}

.admin-link:hover,
.admin-link.active {
    background: rgba(0, 240, 255, 0.05);
    color: var(--admin-primary);
    border-left-color: var(--admin-primary);
}

.admin-link i {
    font-size: 1.15rem;
    width: 25px;
    text-align: center;
}

.admin-panel {
    display: none;
    animation: panelFade 0.4s ease-out;
}

.admin-panel.active {
    display: block;
}

@keyframes panelFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-admin-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--admin-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999;
}

.admin-link i {
    font-size: 1.1rem;
    width: 25px;
}

/* Main Content area */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    width: calc(100% - 260px);
    min-width: 0;
    /* Fix flexbox overflow issues */
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .admin-main {
    margin-left: 0;
    margin-right: 260px;
}

[dir="rtl"] .admin-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid rgba(0, 240, 255, 0.1);
}

[dir="rtl"] .admin-link {
    text-align: right;
    justify-content: flex-start;
    padding-left: 25px;
    padding-right: 20px;
    border-left: none;
    border-right: 4px solid transparent;
}

[dir="rtl"] .admin-link:hover,
[dir="rtl"] .admin-link.active {
    border-left: none;
    border-right-color: var(--admin-primary);
}

/* Header Command Bar */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    background: var(--admin-card-bg);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(0, 240, 255, 0.05);
    backdrop-filter: blur(20px);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    white-space: nowrap;
}

.primary-highlight {
    color: var(--admin-primary);
}

.server-time {
    font-family: 'Fira Code', monospace;
    color: var(--admin-primary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--admin-primary);
    object-fit: cover;
}

.profile-info {
    line-height: 1.2;
}

.admin-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.admin-role {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dir-toggle {
    background: none;
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--admin-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dir-toggle:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--admin-primary);
}

/* System Pulse Stats */
.pulse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pulse-card {
    background: var(--admin-card-bg);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.pulse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--admin-primary);
    opacity: 0.7;
}

.pulse-card.alert::before {
    background: #ff3860;
}

.pulse-card.secure::before {
    background: #00ff88;
}

.pulse-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8888a0;
}

.pulse-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin: 10px 0;
    color: #fff;
}

/* Visual Data Section */
.data-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.data-card {
    background: var(--admin-card-bg);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--admin-primary);
}

/* Live Node Map Animation */
.node-map {
    height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

/* Circular Progress Centers */
.circular-data {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.circle-svg {
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.circle-val {
    fill: none;
    stroke: var(--admin-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

/* Table - Density Command Style */
.admin-table-container {
    background: var(--admin-card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: rgba(0, 240, 255, 0.05);
    padding: 15px 20px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--admin-primary);
}

.admin-table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.9rem;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-danger {
    background: rgba(255, 56, 96, 0.15);
    color: #ff3860;
}

.badge-success {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
}

.badge-warning {
    background: rgba(255, 221, 87, 0.15);
    color: #ffdd57;
}

/* Responsive */
@media (max-width: 1200px) {
    .data-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.3s,
            opacity 0.3s;
        left: 0;
        right: auto;
    }

    [dir="rtl"] .admin-sidebar {
        transform: translateX(100%);
        left: auto;
        right: 0;
        visibility: hidden;
        opacity: 0;
    }

    .admin-sidebar.active {
        transform: translateX(0) !important;
        visibility: visible;
        opacity: 1;
    }

    [dir="rtl"] .admin-sidebar.active {
        transform: translateX(0) !important;
        visibility: visible;
        opacity: 1;
    }

    .admin-main {
        margin-left: 0;
        padding: 15px;
    }

    [dir="rtl"] .admin-main {
        margin-right: 0;
    }

    .mobile-admin-toggle {
        display: block;
        margin-right: 10px;
    }

    [dir="rtl"] .mobile-admin-toggle {
        margin-right: 0;
        margin-left: 10px;
    }

    .topbar-left h2 {
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* RTL SIDEBAR HIDE/SHOW LOGIC - Removed Redundant Block */
}

@media (max-width: 768px) {
    .pulse-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        padding: 10px 15px;
        margin-bottom: 20px;
    }

    .server-time {
        display: none;
    }
}

@media (max-width: 480px) {
    .admin-profile {
        display: none;
    }

    .admin-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 500px;
        /* Ensure table content is legible */
    }
}