/* ===================================
   ARCADE THEME - Gaming Style
   =================================== */

:root {
    color-scheme: dark;

    /* Core Colors */
    --bg: #0d1117;
    --bg-spot-1: rgba(0, 217, 255, 0.15);
    --bg-spot-2: rgba(155, 93, 229, 0.12);
    --surface: #1a1f2e;
    --surface-muted: #151a27;
    --border: rgba(76, 158, 255, 0.15);

    /* Text */
    --text: #ffffff;
    --text-muted: #a0a4b8;

    /* Arcade Gradient Colors */
    --gradient-start: #00d9ff;
    --gradient-mid: #4c9eff;
    --gradient-end: #9b5de5;

    /* Primary Actions */
    --primary: #00d9ff;
    --primary-strong: #4c9eff;

    /* Shadows */
    --shadow-sm: 0 2px 12px rgba(0, 217, 255, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 217, 255, 0.4);
    --shadow-glow: 0 0 30px rgba(76, 158, 255, 0.3);

    /* Font */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ===================================
   BODY & BACKGROUND
   =================================== */

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 20% 20%, var(--bg-spot-1), transparent 50%),
        radial-gradient(circle at 80% 80%, var(--bg-spot-2), transparent 50%),
        linear-gradient(180deg, #0d1117 0%, #1a1f2e 50%, #0d1117 100%);
    color: var(--text);
}

/* Starfield effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60px 70px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 50px 50px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 90px 10px, rgba(255, 255, 255, 0.2), transparent);
    background-size: 200px 200px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 150px 50px;
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

/* ===================================
   NAVBAR
   =================================== */

.navbar {
    background: rgba(13, 17, 23, 0.95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    color: var(--gradient-start) !important;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

.navbar-brand:hover {
    color: var(--gradient-mid) !important;
}

/* ===================================
   NICKNAMES
   =================================== */

.nick {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.nick:hover {
    background: linear-gradient(135deg, var(--gradient-mid), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nick-red {
    color: #ff6b6b !important;
}

.nick-green {
    color: #51cf66 !important;
}

.nick-blue {
    color: var(--gradient-mid) !important;
}

.nick-pink {
    color: #ff6bcf !important;
}

/* ===================================
   FORM CONTROLS
   =================================== */

#messageBox,
.form-control,
.form-select {
    background-color: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
}

#messageBox:focus,
.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    border-color: var(--gradient-mid);
    box-shadow: 0 0 0 3px rgba(76, 158, 255, 0.2);
    outline: none;
}

#messageBox::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text);
    font-weight: 600;
}

.text-muted,
.form-text,
.small.text-muted,
small.text-muted {
    color: var(--text-muted) !important;
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    border: none;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gradient-mid) 0%, var(--gradient-end) 50%, #d946ef 100%);
    box-shadow: 0 6px 24px rgba(155, 93, 229, 0.6);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background-color: var(--surface-muted);
    border-color: var(--gradient-mid);
}

/* ===================================
   ALERTS
   =================================== */

.alert-success {
    background: rgba(81, 207, 102, 0.15);
    border: 1px solid rgba(81, 207, 102, 0.3);
    color: #51cf66;
}

.alert-danger {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.alert-info {
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: var(--gradient-start);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* ===================================
   CARDS & SURFACES
   =================================== */

.card,
.message-container,
.channel-item {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.card:hover,
.channel-item:hover {
    background-color: #222838;
    border-color: var(--gradient-mid);
    box-shadow: var(--shadow-md);
}

/* ===================================
   MESSAGES
   =================================== */

.message {
    background-color: var(--surface);
    border-left: 3px solid transparent;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.message:hover {
    background-color: #1e2433;
    border-left-color: var(--gradient-mid);
}

.message.message-mine {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(76, 158, 255, 0.1));
    border-left-color: var(--gradient-start);
}

.message.system-message {
    background: rgba(155, 93, 229, 0.1);
    border-left-color: var(--gradient-end);
    font-style: italic;
    opacity: 0.85;
}

/* ===================================
   BADGES
   =================================== */

.badge {
    border-radius: 6px;
    font-weight: 700;
    padding: 4px 10px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
    color: white;
}

.badge-success {
    background-color: #51cf66;
    color: white;
}

.badge-danger {
    background-color: #ff6b6b;
    color: white;
}

.badge-info {
    background-color: var(--gradient-mid);
    color: white;
}

/* ===================================
   MODALS
   =================================== */

.modal-content {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.modal-header {
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    border-top: 1px solid var(--border);
}

.modal-title {
    color: var(--text);
}

/* ===================================
   DROPDOWNS
   =================================== */

.dropdown-menu {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    color: var(--text);
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(76, 158, 255, 0.15));
    color: var(--gradient-start);
}

.dropdown-divider {
    border-top-color: var(--border);
}

/* ===================================
   SCROLLBAR
   =================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--gradient-mid), var(--gradient-end));
}

/* ===================================
   LINKS
   =================================== */

a {
    color: var(--gradient-start);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gradient-mid);
    text-decoration: underline;
}

/* ===================================
   ONLINE USERS / CHANNELS LIST
   =================================== */

.user-item,
.channel-list-item {
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-item:hover,
.channel-list-item:hover {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(76, 158, 255, 0.1));
}

.user-item.active,
.channel-list-item.active {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(76, 158, 255, 0.2));
    border-left: 3px solid var(--gradient-mid);
}

/* ===================================
   GAME ELEMENTS
   =================================== */

.game-active {
    background: linear-gradient(135deg, rgba(155, 93, 229, 0.15), rgba(217, 70, 239, 0.15));
    border: 1px solid rgba(155, 93, 229, 0.3);
    border-radius: 12px;
    margin: 12px 0;
}

.game-result {
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================
   COINS DISPLAY
   =================================== */

.coins-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* ===================================
   GLOWING EFFECTS
   =================================== */

.glow {
    box-shadow: var(--shadow-glow);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(76, 158, 255, 0.6);
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
}

.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
