/* ============================================
   JARVIS GAMING THEME 2025
   Shared design system for all JARVIS pages
   ============================================ */

/* ============================================
   CSS RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   DESIGN TOKENS (CSS Variables)
   ============================================ */
:root {
    /* === BACKGROUND COLORS === */
    --bg-deep: #0a0a12;
    --bg-primary: #12121a;
    --bg-elevated: #1a1a24;
    --bg-card: rgba(26, 26, 38, 0.75);
    --bg-card-solid: #1a1a26;

    /* === ACCENT COLORS (Gaming Neon) === */
    --accent-primary: #00f5d4;
    --accent-primary-glow: rgba(0, 245, 212, 0.4);
    --accent-secondary: #9b5de5;
    --accent-secondary-glow: rgba(155, 93, 229, 0.4);
    --accent-tertiary: #f15bb5;

    /* === STATUS COLORS === */
    --status-online: #00f593;
    --status-online-glow: rgba(0, 245, 147, 0.4);
    --status-warning: #fee440;
    --status-danger: #ff006e;
    --status-danger-glow: rgba(255, 0, 110, 0.4);
    --status-info: #00bbf9;
    --status-dead: #9b5de5;

    /* === TEXT COLORS === */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    /* === BORDER COLORS === */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 245, 212, 0.3);

    /* === SPACING === */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* === BORDER RADIUS === */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* === SHADOWS === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-primary-glow);

    /* === GLOW EFFECTS === */
    --glow-sm: 0 0 15px var(--accent-primary-glow);
    --glow-md: 0 0 30px var(--accent-primary-glow);
    --glow-lg: 0 0 50px var(--accent-primary-glow);

    /* === TRANSITIONS === */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-normal: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);

    /* === TYPOGRAPHY === */
    --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   BODY & HTML
   ============================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 245, 212, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(155, 93, 229, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(241, 91, 181, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    text-align: center;
    margin-bottom: var(--space-xl);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 80px var(--accent-primary-glow);
}

h1 span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    background-clip: text;
    -webkit-background-clip: text;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    background: var(--accent-primary);
    background-clip: text;
    -webkit-background-clip: text;
}

.nav {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-weight: 500;
}

.nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav a.active {
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: var(--glow-sm);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #00d4b8);
    color: var(--bg-deep);
    box-shadow: var(--shadow-sm), 0 0 20px var(--accent-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--glow-md);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--status-danger), #d4004d);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 15px var(--status-danger-glow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 25px var(--status-danger-glow);
}

.btn-warning {
    background: linear-gradient(135deg, var(--status-warning), #e6c200);
    color: var(--bg-deep);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg), var(--glow-sm);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
input, select, textarea {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

input:hover, select:hover, textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-online {
    background: linear-gradient(135deg, rgba(0, 245, 147, 0.2), rgba(0, 245, 147, 0.1));
    color: var(--status-online);
    box-shadow: 0 0 15px rgba(0, 245, 147, 0.3);
}

.status-online::before {
    background: var(--status-online);
    box-shadow: 0 0 8px var(--status-online);
}

.status-offline, .status-inactive {
    background: rgba(96, 96, 112, 0.2);
    color: var(--text-muted);
}

.status-offline::before, .status-inactive::before {
    background: var(--text-muted);
    animation: none;
}

/* ============================================
   STATUS CARDS (Dashboard)
   ============================================ */
.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.status-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: var(--transition-normal);
}

.status-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.status-card.online {
    border-left: 3px solid var(--status-online);
}

.status-card.offline {
    border-left: 3px solid var(--status-danger);
}

.status-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-primary-glow);
}

.status-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ============================================
   PLAYER LIST
   ============================================ */
.player-list {
    max-height: 200px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.list-item:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 245, 212, 0.05);
}

/* ============================================
   LOGIN BOX
   ============================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: var(--space-lg);
}

.login-box {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-light);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.login-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.login-tab {
    flex: 1;
    padding: var(--space-md);
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.login-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.login-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-deep);
    box-shadow: var(--glow-sm);
}

.form-group {
    margin-bottom: var(--space-md);
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
}

/* ============================================
   USER INFO
   ============================================ */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-xs);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-deep);
    box-shadow: var(--glow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px var(--accent-primary-glow); }
    50% { box-shadow: 0 0 40px var(--accent-primary-glow); }
}

/* ============================================
   FOCUS VISIBLE (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-primary-glow);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }

    .header {
        flex-direction: column;
        gap: var(--space-md);
    }

    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .status-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        flex-wrap: wrap;
    }

    h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .status-bar {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: var(--space-lg);
    }
}
