/* ============================================================
   1. ГЛОБАЛЬНЫЕ НАСТРОЙКИ И ПЕРЕМЕННЫЕ
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;600;700&display=swap');

:root {
    --bg: #0b0e14;
    --card: #161b22;
    --card-hover: #1c2128;
    --accent: #238636;
    --accent-hover: #2ea043;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --border: #30363d;
    --danger: #da3633;
    --danger-hover: #f85149;
    --admin-bg: #0d1117;
}

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

html {
    scrollbar-color: var(--accent) var(--bg);
    scrollbar-width: thin;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* ============================================================
   2. ШАПКА И НАВИГАЦИЯ
   ============================================================ */
.site-header {
    background: #010409;
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav a {
    color: #fff;
    background: #21262d;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    text-transform: uppercase;
}

.nav a:hover {
    background: var(--accent);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

/* ============================================================
   3. КАРТОЧКИ И ОБЩИЕ БЛОКИ
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    word-wrap: break-word;
    overflow: hidden;
}

.card h1, .card h2 {
    color: #fff;
    margin-top: 0;
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

/* Блок IP на главной */
.server-ip {
    text-align: center;
    padding: 40px 20px;
    background: radial-gradient(circle, rgba(35,134,54,0.1) 0%, rgba(11,14,20,0) 70%);
}

.server-ip span {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dim);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.server-ip code {
    display: inline-block;
    font-size: 36px;
    color: #fff;
    background: #000;
    padding: 15px 35px;
    border-radius: 12px;
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(35,134,54,0.3);
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

.server-ip .version {
    margin-top: 20px;
    color: var(--accent);
    font-weight: bold;
    font-size: 18px;
}

/* ============================================================
   4. КНОПКИ (BUTTONS)
   ============================================================ */
.btn-minecraft {
    background: var(--accent);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.btn-minecraft:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35,134,54,0.4);
}

.btn-minecraft.danger {
    background: var(--danger);
}

.btn-minecraft.danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(218,54,51,0.4);
}

.btn-minecraft.small {
    padding: 5px 12px;
    font-size: 11px;
}

/* ============================================================
   5. ФОРМЫ И ИНПУТЫ (INPUTS)
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    background-color: var(--admin-bg) !important;
    border: 1px solid var(--border) !important;
    color: #fff !important;
    padding: 14px 16px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 8px !important;
    margin-bottom: 20px !important;
    font-size: 15px !important;
    outline: none !important;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(35,134,54,0.2) !important;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-dim);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================================
   6. АВАТАРКИ (AVATARS)
   ============================================================ */
.avatar-block {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--admin-bg);
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--accent);
    margin-bottom: 15px;
    background: #000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.mini-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 12px;
    border: 2px solid var(--border);
    background: #000;
}

/* ============================================================
   7. ФОРУМ (FORUM)
   ============================================================ */
.thread-row-card {
    background: var(--admin-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.thread-row-card:hover {
    border-color: var(--accent);
    background: #1c2128;
    transform: translateX(5px);
}

.thread-info a {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.thread-info .meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 5px;
}

.post-item {
    background: #1c2128;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
    position: relative;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.post-content {
    font-size: 16px;
    line-height: 1.7;
    color: #e6edf3;
}

/* ============================================================
   8. АДМИН-ПАНЕЛЬ (ADMIN STYLES)
   ============================================================ */
.admin-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.admin-nav a {
    flex: 1;
    min-width: 140px;
    text-align: center;
    background: #21262d;
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.admin-nav a:hover {
    background: var(--accent);
    border-color: var(--accent-hover);
}

/* Таблицы в админке - ЖЕСТКИЕ СТИЛИ */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    background: var(--admin-bg) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    border: 1px solid var(--border) !important;
}

th {
    background: #21262d !important;
    color: var(--accent) !important;
    padding: 16px 15px !important;
    text-align: left !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-bottom: 2px solid var(--border) !important;
}

td {
    padding: 14px 15px !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 15px !important;
    color: #fff !important;
    vertical-align: middle !important;
}

tr:last-child td {
    border-bottom: none !important;
}

tr:hover td {
    background: rgba(255,255,255,0.03) !important;
}

/* Селекты и кнопки внутри таблиц */
td select {
    margin: 0 !important;
    padding: 6px !important;
    width: auto !important;
    display: inline-block !important;
}

/* ============================================================
   9. ГАЛЕРЕЯ (GALLERY)
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--border);
    transition: 0.3s;
    cursor: pointer;
}

.gallery-grid img:hover {
    border-color: var(--accent);
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* ============================================================
   10. ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ И АЛЕРТЫ
   ============================================================ */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.alert-success {
    background: rgba(35, 134, 54, 0.15);
    border-color: var(--accent);
    color: #7ee787;
}

.alert-error {
    background: rgba(218, 54, 51, 0.15);
    border-color: var(--danger);
    color: #ff7b72;
}

.site-footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a {
    padding: 8px 16px;
    background: #21262d;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fff;
}

.pagination a:hover, .pagination a.active {
    background: var(--accent);
    border-color: var(--accent-hover);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border: 3px solid #fff;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    line-height: 1;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    margin: 0 10px;
    font-size: 14px;
    text-decoration: underline;
}

/* Статусы тикетов */
.status-new { color: #f1e05a; font-weight: bold; }
.status-in_progress { color: #58a6ff; font-weight: bold; }
.status-closed { color: var(--text-dim); text-decoration: line-through; }