:root {
    /* Темная цветовая палитра */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #0f0f0f;
    --bg-hover: #1f1f1f;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-accent: #ffffff;
    
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    --border-focus: #4a4a4a;
    
    --accent-primary: #22c55e;
    --accent-secondary: #16a34a;
    --accent-hover: #4ade80;
    
    --success: #22c55e;
    --warning: #ffaa00;
    --error: #ff4444;
    --info: #00aaff;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Заголовок */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    min-height: 48px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    transition: var(--transition);
}

.logo:hover {
    color: var(--accent-primary);
}

.logo img {
    width: 44px;
    height: 44px;
}

.logo-text {
    color: #22c55e;
    font-weight: 700;
    font-size: 32px;
    font-family: 'Lora', 'Times New Roman', serif;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Основной контент */
.main {
    padding: 24px 0;
    flex: 1;
    overflow-y: auto;
}

.page-title {
    text-align: center;
    margin-bottom: 48px;
}

.page-title h1 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.page-title p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Сетка серверов */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

/* Карточка сервера */
.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: var(--transition);
}

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

.server-card:hover::before {
    opacity: 1;
}

.server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    flex-shrink: 0;
    contain: layout style;
}

.server-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    text-align: center;
    flex: 1;
}

.server-status-icon {
    margin-left: 12px;
    flex-shrink: 0;
}

/* Стили для индикатора статуса на странице сервера */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.875rem;
}

.status-indicator.online {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-indicator.online .status-dot {
    background: #22c55e;
    color: #22c55e;
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-indicator.offline .status-dot {
    background: #ef4444;
    color: #ef4444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
}

.status-dot.online {
    background: #22c55e;
    color: #22c55e;
}

.status-dot.offline {
    background: #ef4444;
    color: #ef4444;
}

.status-dot.checking {
    background: #f59e0b;
    color: #f59e0b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


.server-info {
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.server-info-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 2px 0;
    flex-shrink: 0;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.copyable {
    cursor: pointer;
    transition: var(--transition);
}

.copyable:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.server-map {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.server-players {
    color: var(--text-primary);
    font-weight: 700;
}

.server-players.players-high {
    color: #22c55e;
}

.server-players.players-full {
    color: #f59e0b;
}

.server-demos {
    color: var(--text-primary);
    font-weight: 700;
}

/* Кнопка перехода */
.server-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    font-size: 14px;
    width: 100%;
    flex-shrink: 0;
}

.server-link:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* Таблица демо */
.demos-table {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    background: var(--bg-secondary);
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.table-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.table-content {
    overflow-x: auto;
}

.demos-table table {
    width: 100%;
    border-collapse: collapse;
}

.demos-table th,
.demos-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.demos-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demos-table td {
    color: var(--text-primary);
    font-size: 14px;
}

.demos-table tr:hover {
    background: var(--bg-hover);
}

.demo-name {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.demo-map {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
}

.demo-date {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Кнопка скачивания */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.download-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.download-btn svg {
    width: 14px;
    height: 14px;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

/* Загрузка */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Поиск */
.search-container {
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;    
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
}

/* Информация о сервере */
.server-info-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
    overflow: hidden;
}

.server-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    padding: 24px;
}

.server-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Навигация */
.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.back-link:hover {
    color: var(--accent-primary);
}

/* Статистика */
.demos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.demos-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.demos-stats {
    display: flex;
    gap: 16px;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .page-title h1 {
        font-size: 32px;
    }
    
    .page-title p {
        font-size: 16px;
    }
    
    .servers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .server-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        padding: 20px 20px 16px;
        flex-shrink: 0;
    }
    
    .server-info {
        padding: 0 20px 20px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    
    .server-info-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        min-height: 100px;
    }
    
    .demos-table th,
    .demos-table td {
        padding: 12px 16px;
    }
    
    .table-header {
        padding: 20px;
    }
    
    .table-title {
        font-size: 18px;
    }
    
    .demos-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .demos-stats {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .page-title h1 {
        font-size: 28px;
    }
    
    .demos-table th,
    .demos-table td {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .demo-name {
        font-size: 12px;
    }
    
    .server-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Крутые анимации */
@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9) rotateX(15deg);
        filter: blur(4px);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px) scale(1.02) rotateX(0deg);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px) scale(0.95) rotateY(10deg);
        filter: blur(3px);
    }
    50% {
        opacity: 0.8;
        transform: translateX(5px) scale(1.01) rotateY(0deg);
        filter: blur(0.5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotateY(0deg);
        filter: blur(0);
    }
}

/* Убраны лишние анимации */

/* Анимации для карточек серверов */
.server-card {
    animation: slideInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    animation-fill-mode: forwards;
}

.server-card:nth-child(1) { animation-delay: 0.1s; }
.server-card:nth-child(2) { animation-delay: 0.2s; }
.server-card:nth-child(3) { animation-delay: 0.3s; }
.server-card:nth-child(4) { animation-delay: 0.4s; }
.server-card:nth-child(5) { animation-delay: 0.5s; }
.server-card:nth-child(6) { animation-delay: 0.6s; }

/* Анимации для строк таблицы */
.demo-row {
    animation: slideInLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    animation-fill-mode: forwards;
}

.demo-row:nth-child(1) { animation-delay: 0.05s; }
.demo-row:nth-child(2) { animation-delay: 0.1s; }
.demo-row:nth-child(3) { animation-delay: 0.15s; }
.demo-row:nth-child(4) { animation-delay: 0.2s; }
.demo-row:nth-child(5) { animation-delay: 0.25s; }
.demo-row:nth-child(6) { animation-delay: 0.3s; }
.demo-row:nth-child(7) { animation-delay: 0.35s; }
.demo-row:nth-child(8) { animation-delay: 0.4s; }

/* Анимации только для карточек и списка демо */

/* Утилиты */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Скрыть светлую тему */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #111111;
        --bg-tertiary: #1a1a1a;
        --bg-card: #0f0f0f;
        --bg-hover: #1f1f1f;
        
        --text-primary: #ffffff;
        --text-secondary: #a0a0a0;
        --text-muted: #666666;
        --text-accent: #ffffff;
        
        --border-color: #2a2a2a;
        --border-hover: #3a3a3a;
        --border-focus: #4a4a4a;
    }
}
