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

/* Design System - Minimal & Cyber Aesthetics */
:root {
    --bg-primary: #07090e;
    --bg-secondary: #0d111b;
    --bg-card: #121724;
    --bg-card-hover: #161d2d;
    --accent-primary: #00f0ff;
    --accent-primary-glow: rgba(0, 240, 255, 0.2);
    --accent-secondary: #00ff87;
    --accent-danger: #ff3e6c;
    --accent-danger-glow: rgba(255, 62, 108, 0.2);
    --accent-warning: #ffb800;
    --text-primary: #f5f6f9;
    --text-secondary: #8a99ad;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-glow: rgba(0, 240, 255, 0.1);
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-speed: 0.25s;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1d263b;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all var(--transition-speed);
}
a:hover {
    color: #fff;
}

/* Login Page (Minimal Grid) */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at center, #0e1322 0%, #07090e 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand-header {
    text-align: center;
    margin-bottom: 25px;
}

.brand-logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 40%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: #090c13;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 11px 14px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-speed);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--border-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--accent-primary);
    color: #07090e;
}
.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 0 12px var(--accent-primary-glow);
}

.btn-danger {
    background: var(--accent-danger);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
    box-shadow: 0 0 12px var(--accent-danger-glow);
}

.btn-success {
    background: var(--accent-secondary);
    color: #07090e;
}
.btn-success:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #182032;
    color: #fff;
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: #202b43;
}

.alert-box {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 13px;
}
.alert-error {
    background: rgba(255, 62, 108, 0.08);
    color: #ff6085;
    border: 1px solid rgba(255, 62, 108, 0.15);
}
.alert-success {
    background: rgba(0, 255, 135, 0.08);
    color: #4dffa6;
    border: 1px solid rgba(0, 255, 135, 0.15);
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* Header bar for Mobile Screens (Hidden on Desktop) */
.mobile-header {
    display: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.3);
}

.mobile-nav-list {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 8px 0;
}

.mobile-nav-item {
    text-align: center;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: var(--text-secondary);
    gap: 4px;
}
.mobile-nav-link svg {
    width: 18px;
    height: 18px;
}
.mobile-nav-link.active {
    color: var(--accent-primary);
}

/* Sidebar styling (Desktop only) */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-logo {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-secondary);
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-speed);
    gap: 10px;
}

.nav-link:hover, .nav-link.active {
    background: #141c2c;
    color: #fff;
}
.nav-link.active {
    color: var(--accent-primary);
    font-weight: 600;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1d263b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent-primary);
}

.username {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-badge {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-danger);
    font-size: 13px;
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    padding: 30px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Grid layout for cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Server Status Monitor Widget */
.status-monitor {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.status-online {
    background: rgba(0, 255, 135, 0.08);
    color: var(--accent-secondary);
    border: 1px solid rgba(0, 255, 135, 0.15);
}

.status-offline {
    background: rgba(255, 62, 108, 0.08);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 62, 108, 0.15);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-online .status-dot {
    background: var(--accent-secondary);
    box-shadow: 0 0 6px var(--accent-secondary);
}
.status-offline .status-dot {
    background: var(--accent-danger);
    box-shadow: 0 0 6px var(--accent-danger);
}

/* Stats Progress Grid */
.stat-circle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.stat-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-circle-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-circle-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Action Controls Grid */
.control-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Simulated Terminal View (Minimal) */
.terminal-card {
    background: #05070a;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    font-family: var(--font-mono);
    height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.terminal-dots {
    display: flex;
    gap: 4px;
}
.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-content {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.4;
    color: #4eff8c;
}

.terminal-line {
    margin-bottom: 4px;
    word-break: break-all;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.terminal-prompt {
    color: var(--accent-primary);
}

.terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
    flex-grow: 1;
}

/* Settings Tables & Forms */
.panel-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.panel-table th, .panel-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.panel-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.panel-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-admin {
    background: rgba(255, 62, 108, 0.08);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 62, 108, 0.15);
}

.badge-user {
    background: rgba(0, 240, 255, 0.08);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 240, 255, 0.15);
}

.badge-pro {
    background: rgba(0, 255, 135, 0.08);
    color: var(--accent-secondary);
    border: 1px solid rgba(0, 255, 135, 0.15);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed);
}

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

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    transform: scale(0.95);
    transition: transform var(--transition-speed);
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 15px 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Responsive Rules & Mobile layout override */
@media (max-width: 768px) {
    .dashboard-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none; /* Hide sidebar completely on mobile */
    }

    .mobile-header {
        display: flex; /* Show mobile header */
    }

    .mobile-nav-bar {
        display: block; /* Show bottom navigation bar */
    }

    .main-content {
        padding: 15px;
        padding-bottom: 80px; /* Safe padding for bottom navbar */
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-title {
        font-size: 19px;
    }

    .dashboard-card {
        padding: 15px;
    }

    .modal-box {
        width: 95%;
    }
}

/* Config Tab Buttons & Sub-tabs */
.config-tab-btn, .game-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 32, 50, 0.6);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.config-tab-btn:hover, .game-tab-btn:hover {
    background: #182032;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}
.config-tab-btn.active, .game-tab-btn.active {
    background: var(--accent-primary) !important;
    color: #07090e !important;
    border-color: var(--accent-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 0 10px var(--accent-primary-glow) !important;
}
.game-tab-btn:disabled, .config-tab-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Spinner Animation */
.animate-spin {
    animation: spin 1s linear infinite;
    transform-origin: center;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
