:root {
    --bg-color: #0b0f19;
    --nav-bg: rgba(11, 15, 25, 0.85);
    --sidebar-bg: rgba(15, 23, 42, 0.6);
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-bg-hover: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(88, 101, 242, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #5865F2;
    --accent-hover: #4752C4;
    --success: #2ecc71;
    --success-hover: #27ae60;
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --gradient-text: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(88, 101, 242, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(88, 101, 242, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(46, 204, 113, 0.08), transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5%;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.logo { font-size: 24px; font-weight: 800; color: var(--text-main); text-decoration: none; display: flex; align-items: center; gap: 10px; transition: 0.2s;}
.logo:hover { text-shadow: var(--shadow-glow); }

.nav-links { display: flex; gap: 30px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-main); }

.user-info { display: flex; align-items: center; gap: 15px; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); padding: 2px; }

/* Buttons */
.btn {
    background: var(--accent);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--text-muted); box-shadow: none; }
.btn-success { background: var(--success); }
.btn-success:hover { background: var(--success-hover); box-shadow: 0 0 20px rgba(46, 204, 113, 0.3); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); box-shadow: 0 0 20px rgba(231, 76, 60, 0.3); }
.btn-save { background: var(--accent); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: 15px; width: 100%; transition: 0.3s; }
.btn-save:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); transform: translateY(-2px); }

/* Main Layout */
main { flex: 1; padding: 50px 5%; max-width: 1600px; margin: 0 auto; width: 100%; animation: fadeIn 0.5s ease-out; }
h1 { margin-bottom: 10px; font-size: 32px; font-weight: 800; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 24px; margin-bottom: 25px; color: #fff; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; display: flex; align-items: center; gap: 10px;}
.subtitle { color: var(--text-muted); margin-bottom: 40px; font-size: 16px; }

/* Dashboard Cards */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-bottom: 50px; }
.server-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}
.server-card:hover { transform: translateY(-8px); border-color: var(--border-hover); background: var(--card-bg-hover); box-shadow: var(--shadow-glow); }
.server-card.disabled { opacity: 0.6; filter: grayscale(50%); }
.server-card.disabled:hover { opacity: 1; filter: grayscale(0%); }
.server-icon { width: 90px; height: 90px; border-radius: 50%; margin: 0 auto 20px; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 32px; overflow: hidden; border: 2px solid rgba(255,255,255,0.1); box-shadow: inset 0 0 10px rgba(0,0,0,0.5); transition: 0.3s;}
.server-card:hover .server-icon { border-color: var(--accent); }
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-name { font-weight: 700; font-size: 20px; margin-bottom: 20px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings Sidebar Layout */
.settings-container { display: flex; flex: 1; max-width: 1600px; margin: 0 auto; width: 100%; padding: 40px 5%; gap: 40px; }
.settings-sidebar { width: 280px; flex-shrink: 0; }
.server-header { display: flex; align-items: center; gap: 15px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.server-header .server-icon { width: 55px; height: 55px; margin: 0; box-shadow: none; border-color: var(--accent); }
.server-title { font-weight: 700; font-size: 18px; word-break: break-word; line-height: 1.3;}

.menu-list { list-style: none; }
.menu-list li { margin-bottom: 8px; }
.menu-btn {
    width: 100%; text-align: left; background: transparent; border: 1px solid transparent; padding: 14px 16px;
    border-radius: 12px; color: var(--text-muted); font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 12px;
}
.menu-btn:hover { background: rgba(255,255,255,0.05); color: white; }
.menu-btn.active { background: rgba(88, 101, 242, 0.15); color: #fff; border-color: rgba(88, 101, 242, 0.4); box-shadow: inset 4px 0 0 var(--accent); }

/* Settings Content */
.settings-main { flex: 1; min-width: 0;}
.tab-content { display: none; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 40px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-md); }
.tab-content.active { display: block; animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* Forms */
.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 10px; font-weight: 600; color: #cbd5e1; font-size: 14px;}
.form-control {
    width: 100%; padding: 14px 18px; border-radius: 10px; background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.1); color: white; font-size: 15px; transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2), inset 0 2px 4px rgba(0,0,0,0.2); }
textarea.form-control { min-height: 100px; resize: vertical; }

.flex-group { display: flex; gap: 20px; }
.flex-group .form-group { flex: 1; }

/* Toggles */
.toggle-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 20px; background: rgba(0,0,0,0.25); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: 0.2s;}
.toggle-container:hover { border-color: rgba(255,255,255,0.1); background: rgba(0,0,0,0.3); }
.toggle-info h3 { font-size: 16px; margin-bottom: 6px; font-weight: 600;}
.toggle-info p { font-size: 14px; color: var(--text-muted); line-height: 1.4;}

.switch { position: relative; display: inline-block; width: 54px; height: 28px; flex-shrink:0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; border: 1px solid rgba(255,255,255,0.1);}
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: var(--text-muted); transition: .4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3);}
input:checked + .slider { background-color: rgba(46, 204, 113, 0.2); border-color: var(--success); }
input:checked + .slider:before { transform: translateX(26px); background-color: var(--success); box-shadow: 0 0 10px var(--success); }

/* Alerts */
.alert { padding: 16px 20px; border-radius: 12px; margin-bottom: 30px; display: flex; align-items: center; gap: 12px; font-weight: 500; animation: fadeInDown 0.4s ease;}
.alert.success { background: rgba(46, 204, 113, 0.1); color: var(--success); border: 1px solid rgba(46, 204, 113, 0.2); }
.alert.error { background: rgba(231, 76, 60, 0.1); color: var(--danger); border: 1px solid rgba(231, 76, 60, 0.2); }

/* Logs Table */
.logs-container { overflow-x: auto; margin-top: 20px; border-radius: 12px; border: 1px solid var(--border-color); }
.logs-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.logs-table th, .logs-table td { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.logs-table th { background: rgba(0,0,0,0.3); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px;}
.logs-table th:nth-child(1), .logs-table td:nth-child(1) { white-space: nowrap; width: 10%; }
.logs-table th:nth-child(2), .logs-table td:nth-child(2) { white-space: nowrap; width: 25%; }
.logs-table th:nth-child(4), .logs-table td:nth-child(4) { white-space: nowrap; width: 15%; }
.logs-table tr:hover { background: rgba(255,255,255,0.02); }
.logs-table tr:last-child td { border-bottom: none; }
.log-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.1); }
.log-action-ban { color: #e74c3c; background: rgba(231, 76, 60, 0.15); border: 1px solid rgba(231, 76, 60, 0.3);}
.log-action-kick { color: #e67e22; background: rgba(230, 126, 34, 0.15); border: 1px solid rgba(230, 126, 34, 0.3);}
.log-action-warn { color: #f1c40f; background: rgba(241, 196, 15, 0.15); border: 1px solid rgba(241, 196, 15, 0.3);}
.log-action-settings { color: #3498db; background: rgba(52, 152, 219, 0.15); border: 1px solid rgba(52, 152, 219, 0.3);}
.log-action-info { color: #2ecc71; background: rgba(46, 204, 113, 0.15); border: 1px solid rgba(46, 204, 113, 0.3);}
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 20px;}
.pagination button { padding: 8px 16px; }

/* Animations */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .settings-container { flex-direction: column; padding: 20px; gap: 20px;}
    .settings-sidebar { width: 100%; display: flex; flex-direction: column;}
    .menu-list { display: flex; overflow-x: auto; padding-bottom: 10px; gap: 10px;}
    .menu-list li { margin: 0; white-space: nowrap;}
    .menu-btn { width: auto; padding: 10px 16px;}
    nav { padding: 16px 5%; }
    .nav-links { display: none; }
}
