:root {
    /* Colors - Dark Theme (Default) */
    --bg-primary: #0a0a0c;
    --bg-secondary: #16161a;
    --bg-tertiary: #1e1e24;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #2d2d35;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glass: rgba(22, 22, 26, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Layout */
#wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header & Server Search */
header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

#title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

#server-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    object-fit: cover;
    background: var(--bg-tertiary);
}

#server-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.players {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

#server {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

input[type="text"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.icon {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.light-theme .icon img {
    filter: none;
}

/* Controls & Search */
section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.controls-wrapper {
    flex: 1;
    min-width: 300px;
    display: flex;
    gap: 0.75rem;
}

.utility-icons {
    display: flex;
    gap: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.4rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    width: fit-content;
}

.tab {
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent);
    color: white;
}

/* Table Content */
.table-container {
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
}

tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.03);
}

td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

.table-no { width: 60px; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
.table-id { width: 80px; font-weight: 600; color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.table-name { font-weight: 500; }
.table-ping { width: 100px; font-family: 'JetBrains Mono', monospace; font-weight: 500; }

.table-socials {
    display: flex;
    gap: 0.75rem;
}

.table-socials a img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.table-socials a:hover img {
    opacity: 1;
}

/* Favorites Star */
.table-favorite img {
    width: 20px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.table-favorite img:hover {
    transform: scale(1.2);
}

/* Statistics */
.chart-container {
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: 350px;
}

/* Footer */
.table-footer td {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.table-footer a {
    color: var(--accent);
    font-weight: 600;
}

/* Loader */
.loader {
    background: var(--bg-primary);
    z-index: 10000;
}

.loader-spinner {
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    width: 40px;
    height: 40px;
}

/* Dropdowns (Favorites/History) */
#favorites-menu, #history-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    z-index: 1000;
}

.favorites-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.favorite-item {
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Notifications */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
}

.notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.notification.fadeout {
    animation: fadeOut 0.3s ease-out forwards;
}

.notification-content {
    flex: 1;
    font-size: 0.95rem;
}

.close-notification {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-notification:hover {
    color: var(--text-primary);
}

.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--error); }
.notification.warning { border-left: 4px solid var(--warning); }
.notification.info { border-left: 4px solid var(--accent); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    #wrapper { padding: 1rem; gap: 1rem; }
    header { padding: 1rem; }
    #server { flex-direction: column; }
    #server input { width: 100%; }
    .controls-wrapper { flex-direction: column; }
    .tabs { width: 100%; overflow-x: auto; }
}
