/* Design tokens */
:root {
    --bg: #0e1118;
    --panel: rgba(255, 255, 255, 0.06);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --stroke: rgba(255, 255, 255, 0.10);
    --stroke-soft: rgba(255, 255, 255, 0.06);
    --text: #E6EAF2;
    --muted: #9AA4B2;
    --primary-1: #6366F1;
    --primary-2: #7C3AED;
    --success: #22C55E;
    --warning: #F59E0B;
    --accent: #8B5CF6;
}

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

body {
    font-family: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Background image with overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url('https://i.imgur.com/HNziwlv.png') center/cover no-repeat fixed;
    z-index: -2;
    transform: scale(1.02);
    filter: saturate(1.1) brightness(0.9) contrast(1.05);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(124, 58, 237, 0.12), transparent 60%),
                radial-gradient(1200px 800px at 80% 0%, rgba(99, 102, 241, 0.12), transparent 60%),
                linear-gradient(180deg, rgba(10, 12, 19, 0.86) 0%, rgba(10, 12, 19, 0.92) 40%, rgba(10, 12, 19, 0.96) 100%);
    z-index: -1;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 18, 28, 0.55);
    backdrop-filter: blur(12px) saturate(120%);
    border-bottom: 1px solid var(--stroke);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left .logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-oxide { color: #d7cc2f; }

.logo-monitoring {
    color: var(--text);
    margin-left: 5px;
}

.header-left { display:flex; align-items:center; gap:1rem; }
.header-nav { display:flex; gap:.5rem; }
.header-nav .btn { padding: 0.6rem 1rem; border-radius: 10px; }

.header-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-balance {
    margin-right: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* User menu */
.user-menu { position: relative; }

.user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: rgba(15, 18, 28, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    display: none;
    overflow: hidden;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #E2E8F0;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-secondary[disabled], .btn[style*='display: none'] {
    cursor: default;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-1) 0%, var(--primary-2) 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.steam-login {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.steam-login:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1 0 auto;
}

.content-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Game Header Section */
.game-header {
    background: var(--panel);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--stroke);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.game-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rust-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.game-name { font-size: 1.5rem; font-weight: 700; color: var(--text); }

/* .servers-title removed */

.stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.stat-separator {
    color: #64748B;
    font-weight: 300;
}

/* Search Section */
.search-section {
    margin-bottom: 1rem;
}

.search-bar {
    position: relative;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748B;
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--panel);
    border: 1px solid var(--stroke-soft);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #94A3B8;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Table Controls */
/* .table-controls removed */

/* .btn-table removed */

.btn-add-server {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-add-server:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Servers Table */
.servers-table {
    background: var(--panel);
    border-radius: 16px;
    border: 1px solid var(--stroke);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #A8B0C3;
}
.empty-icon { font-size: 32px; color: #6366F1; }
.empty-title { font-weight: 800; color: #E2E8F0; }
.empty-subtitle { color: #94A3B8; font-size: 0.95rem; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239,68,68,0.95);
    color: #fff;
    padding: .75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.modal-dialog {
    background: #141826;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    width: 95%;
    max-width: 560px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-close {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: #ffffff; }
.modal-body { padding: 1.25rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-row label { color: #AAB3C5; font-size: 0.9rem; }
.form-row input {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #E2E8F0;
}
.form-row input::placeholder { color: #8A93A6; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }
.form-hint { color: #8A93A6; font-size: 0.85rem; margin-top: 0.75rem; }
.form-error { color: #EF4444; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); padding: 0.75rem 1rem; border-radius: 10px; margin-top: 0.75rem; }

@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* Payment modal */
/* Language switch */
.lang-switch { position: relative; }
.lang-btn { background: var(--panel); border:1px solid var(--stroke-soft); color:var(--text); padding:.5rem .75rem; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:.4rem; }
.lang-btn .flag { width: 20px; height: 14px; border-radius:2px; object-fit: cover; }
.lang-dropdown { position:absolute; right:0; top:calc(100% + 8px); background:rgba(15,18,28,.95); border:1px solid var(--stroke); border-radius:12px; display:none; min-width:120px; }
.lang-dropdown a { display:flex; align-items:center; gap:.5rem; padding:.6rem .9rem; color:var(--text); text-decoration:none; }
.lang-dropdown a img { width:20px; height:14px; border-radius:2px; object-fit: cover; }
.lang-dropdown a:hover { background:rgba(255,255,255,.06); }
.pay-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.pay-option { display: flex; align-items: center; gap: 12px; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--stroke-soft); background: var(--panel); cursor: pointer; }
.pay-option:hover { background: rgba(255,255,255,0.08); }
.pay-option .icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255,255,255,0.08); overflow: hidden; }
.pay-option .icon img { width: 100%; height: 100%; object-fit: contain; }
.pay-note { font-size: 0.9rem; color: var(--muted); background: rgba(255,255,255,0.06); border: 1px solid var(--stroke); border-radius: 12px; padding: 0.9rem 1rem; }
.servers-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.servers-table th {
    background: rgba(124, 58, 237, 0.18);
    padding: 1.5rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--text);
    border-bottom: 1px solid var(--stroke);
    white-space: nowrap;
}

.servers-table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--stroke-soft);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-row {
    transition: all 0.3s ease;
}

.server-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.server-row.highlighted {
    background: rgba(99, 102, 241, 0.12);
    border-left: 4px solid #6366F1;
}

.servers-table tbody tr:nth-child(even):not(.highlighted) {
    background: rgba(255, 255, 255, 0.03);
}

.server-name {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.server-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.server-title {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
}

.server-connection {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.country-flag {
    width: 24px;
    height: 18px;
    border-radius: 2px;
}

.server-ip {
    font-family: 'Courier New', monospace;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-icon {
    color: #22C55E;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
}

.play-icon:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: scale(1.1);
}

.play-icon.highlighted {
    color: #FF6B35;
    background: rgba(255, 107, 53, 0.1);
}

.play-icon.highlighted:hover {
    background: rgba(255, 107, 53, 0.2);
}

.server-online {
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    text-align: right;
}

.server-map {
    color: var(--text);
    white-space: nowrap;
}

.server-version {
    font-family: 'Courier New', monospace;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
}

.server-points {
    font-weight: 600;
    color: var(--warning);
    text-align: right;
    white-space: nowrap;
}

/* Sidebar Styles */
/* sidebar removed */

/* share-section removed */

/* social-icons removed */

/* social-btn removed */

.social-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* share-link removed */

/* link-icon removed */

/* link-text removed */

/* copy-btn removed */

/* copy-btn hover removed */

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .servers-table {
        overflow-x: auto;
    }
    
    .servers-table table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
