/* Custom properties for the VoidVPN theme */
:root {
    --bg-void: #0f172a;
    --bg-nebula: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #243248;
    
    --accent-cyan: #38bdf8;
    --accent-cyan-hover: #0ea5e9;
    --accent-green: #10b981;
    --accent-gold: #f59e0b;
    --accent-purple: #a855f7;
    --accent-red: #ef4444;
    
    --text-pure: #f8fafc;
    --text-mute: #94a3b8;
    --text-dark: #64748b;
    
    --border-color: #334155;
    --border-hover: #38bdf8;
    
    --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-void);
    color: var(--text-pure);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Canvas background alignment */
#void-canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Top Navigation */
.top-nav {
    width: 100%;
    max-width: 1120px;
    padding: 16px 24px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    backdrop-filter: blur(8px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-orbit-sm {
    position: relative;
    width: 30px;
    height: 30px;
    border: 1px dashed var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-core-sm {
    width: 12px;
    height: 12px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
}

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-pure);
}

.nav-logo-text span {
    color: var(--accent-cyan);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-pure);
}

.role-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 6px;
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-mute);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-tag {
    background-color: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
    border-color: rgba(56, 189, 248, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    border-radius: 8px;
    background-color: rgba(51, 65, 85, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-pure);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    background-color: var(--border-color);
    border-color: var(--accent-cyan);
    color: var(--text-pure);
}

/* Container layout */
.container {
    width: 100%;
    max-width: 480px;
    padding: 32px 24px 64px 24px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: max-width 0.3s ease;
}

.container.wide-mode {
    max-width: 1120px;
}

.view-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* Header & Orbit Logo styling */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo-orbit {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px dashed var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 20s linear infinite;
}

.logo-core {
    width: 24px;
    height: 24px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

.logo-satellite {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background-color: var(--text-pure);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-pure);
}

.logo-text span {
    color: var(--accent-cyan);
}

/* Hero Content styling */
.hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-pure);
}

.hero-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-mute);
    max-width: 400px;
    margin: 0 auto;
}

/* Control Panel & Buttons */
.control-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn {
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.btn-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.25s ease;
}

.btn-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-pure);
}

.btn-subtitle {
    font-size: 0.85rem;
    color: var(--text-mute);
}

/* Primary Button */
.btn-primary {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary .btn-icon {
    color: var(--accent-cyan);
}

.btn-primary:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    background-color: var(--bg-card-hover);
}

.btn-primary:hover .btn-icon {
    color: var(--accent-cyan);
    transform: scale(1.05);
}

/* Secondary Button */
.btn-secondary {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
}

.btn-secondary .btn-icon {
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-secondary:hover .btn-icon {
    color: var(--accent-cyan);
}

/* Badges */
.badge {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Specs & Footer */
.footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.specs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-dark);
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.dot.active {
    background-color: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-dark);
}

/* ==========================================================
   VIEW 2: UNDER CONSTRUCTION CARD FOR REGULAR USERS
   ========================================================== */
.construction-card {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.construction-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.construction-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-pure);
    letter-spacing: -0.02em;
}

.construction-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-mute);
    max-width: 420px;
}

.user-session-box {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.session-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.session-label {
    color: var(--text-dark);
}

.session-val {
    color: var(--text-pure);
    font-weight: 500;
}

.session-val.mono {
    font-family: var(--font-mono);
}

/* ==========================================================
   VIEW 3: ADMIN DASHBOARD (PROMETHEUS TELEMETRY)
   ========================================================== */
.view-dashboard {
    width: 100%;
    align-items: stretch;
    gap: 24px;
    text-align: left;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 8px;
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-pure);
    margin-top: 4px;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-selector {
    display: inline-flex;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
}

.range-btn {
    background: transparent;
    border: none;
    color: var(--text-mute);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-btn:hover {
    color: var(--text-pure);
}

.range-btn.active {
    background-color: var(--accent-cyan);
    color: var(--bg-void);
}

/* Metric Cards Grid */
.metric-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-mute);
}

.metric-val {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-pure);
    margin: 8px 0 4px 0;
}

.metric-sub {
    font-size: 0.8rem;
    color: var(--text-dark);
    font-family: var(--font-mono);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-pure);
}

.chart-legend {
    font-size: 0.75rem;
    color: var(--text-mute);
    display: flex;
    align-items: center;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
}

.chart-canvas-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.chart-tooltip {
    position: absolute;
    display: none;
    pointer-events: none;
    z-index: 20;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    font-size: 0.75rem;
    font-family: var(--font-sans);
    line-height: 1.4;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.chart-tooltip-time {
    color: var(--text-mute);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    padding-bottom: 2px;
}

.chart-tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.chart-tooltip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-tooltip-name {
    color: var(--text-pure);
    font-weight: 500;
}

.chart-tooltip-val {
    color: var(--text-pure);
    font-weight: 700;
    font-family: var(--font-mono);
    margin-left: auto;
}

/* Top Users List */
.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 10px;
    font-size: 0.85rem;
}

.user-row-name {
    font-weight: 600;
    color: var(--text-pure);
}

.user-row-conns {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 600;
}

.empty-text {
    font-size: 0.85rem;
    color: var(--text-dark);
    text-align: center;
    padding: 40px 0;
}

/* Modal Popup window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 24px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-nebula);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-gold);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-mute);
}

.modal-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background-color: var(--accent-gold);
    color: var(--bg-void);
}

/* Keyboard focus indicators */
.btn:focus-visible,
.modal-btn:focus-visible,
.btn-sm:focus-visible,
.range-btn:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
        box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
    }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .metric-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-controls {
        width: 100%;
        justify-content: space-between;
    }
    .metric-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        gap: 24px;
        padding: 20px 16px 48px 16px;
    }
    .hero-title {
        font-size: 1.6rem;
    }
    .btn {
        padding: 14px 18px;
    }
}
