
/* --- Глобальные переменные и сброс стилей --- */
:root {
    --primary-color: #9d4edd;
    --secondary-color: #c77dff;
    --dark-color: #0f0f1a;
    --dark-grey: #1a1a2e;
    --light-color: #f0f0f5;
    --panel-bg: rgba(26, 26, 46, 0.85);
    --gold-color: #ffd700;
    --neon-glow: 0 0 5px var(--primary-color),
                 0 0 10px var(--primary-color),
                 0 0 15px var(--secondary-color);
    --font-family: 'Roboto', sans-serif;
}

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

html, body { height: 100%; }

body {
    font-family: var(--font-family);
    background-color: var(--dark-color);
    color: var(--light-color);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Базовая структура --- */
#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

main {
    flex: 1 0 auto;
    transition: opacity 0.4s ease-in-out;
}

main.fade-out {
    opacity: 0;
}

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

.content-panel {
    background-color: var(--panel-bg);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem 3rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.page-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.8rem;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    filter: drop-shadow(0 0 10px rgba(157, 78, 221, 0.5));
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    color: #fff;
    border-radius: 5px;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn:hover {
    background-color: transparent;
    color: var(--secondary-color);
    box-shadow: var(--neon-glow);
}

/* --- Шапка --- */
header {
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--primary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header .logo {
    font-size: 2rem;
    color: var(--secondary-color);
    text-shadow: var(--neon-glow);
    transition: transform 0.3s ease;
}
.logo-link { text-decoration: none; }
.logo-link:hover .logo { transform: scale(1.05); }
header nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
header nav ul li { margin-left: 25px; }
header nav a {
    color: var(--light-color);
    text-decoration: none;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}
header nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Блок пользователя Steam --- */
.user-area { margin-left: auto; }
.steam-login-button img { height: 35px; transition: filter 0.3s ease; }
.steam-login-button:hover img { filter: brightness(1.2); }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 700; color: #eee; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary-color); }
.logout-button { color: #aaa; text-decoration: none; font-size: 0.8rem; transition: color 0.3s ease; }
.logout-button:hover { color: #ff6b6b; }

/* --- Подвал --- */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid #333;
    background-color: var(--dark-grey);
    flex-shrink: 0;
}
footer a {
    color: var(--secondary-color);
    text-decoration: none;
}
footer a:hover { text-decoration: underline; }

/* --- Главная страница: Hero --- */
#hero {
    min-height: 40vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 0;
    position: relative;
    isolation: isolate;
    background: none;
}
#hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://source.unsplash.com/1600x900/?cyberpunk,neon') no-repeat center center/cover;
    z-index: -2;
}
#hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, rgba(42, 0, 63, 0.85) 0%, transparent 70%);
    z-index: -1;
}
#hero .container {
    background: none;
    padding: 2rem;
}
#hero h2 { font-size: 3rem; text-shadow: var(--neon-glow); }
#hero p { font-size: 1.2rem; color: #ccc; }

/* --- Главная страница: Серверы --- */
#servers { padding-top: 2rem; text-align: center; }
.server-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:2rem;margin-top:2rem}
.server-card-link{text-decoration:none;color:inherit}
.server-card{background:var(--dark-grey);padding:2rem;border-radius:8px;border:1px solid #333;height:100%;transition:transform .3s ease,box-shadow .3s ease,border-color .3s ease}
.server-card:hover{transform:translateY(-5px);border-color:var(--primary-color);box-shadow:0 10px 20px rgba(0,0,0,.2),0 0 10px var(--primary-color)}
.server-card h3{color:var(--primary-color);margin-bottom:1rem}

/* --- Страница новостей --- */
.news-navigation{display:flex;flex-wrap:wrap;justify-content:center;gap:1rem;margin-bottom:2rem;padding-bottom:1rem;border-bottom:1px solid #333}
.news-navigation a{text-decoration:none;color:#ccc;padding:.5rem 1rem;border-radius:5px;transition:all .3s ease;border:1px solid transparent}
.news-navigation a:hover{color:#fff;background-color:var(--dark-grey)}
.news-navigation a.active{color:var(--secondary-color);border-color:var(--primary-color);box-shadow:0 0 5px var(--primary-color)}
.news-list{display:grid;grid-template-columns:1fr;gap:1.5rem}
.news-item-link{text-decoration:none;color:inherit;display:block;border-radius:8px;transition:background-color .3s ease}
.news-item-link:hover{background-color:rgba(255,255,255,0.05)}
.news-item{display:flex;align-items:stretch}
.news-thumbnail-wrapper{flex-shrink:0;width:200px;min-height:150px}
.news-thumbnail{width:100%;height:100%;object-fit:cover;border-radius:8px 0 0 8px}
.news-content{padding:1rem 1.5rem;display:flex;flex-direction:column}
.news-content h3{color:var(--secondary-color);margin-bottom:.5rem}
.news-date{font-size:.8rem;color:#aaa;margin-bottom:.8rem;display:block}
.news-item-link.news-item-right .news-item{flex-direction:row}
.news-item-link.news-item-left .news-item{flex-direction:row-reverse}
.news-item-link.news-item-left .news-thumbnail{border-radius:0 8px 8px 0}
.news-item-link.news-item-left .news-content{text-align:right}
.news-item-link.news-item-banner .news-item{flex-direction:column}
.news-item-link.news-item-banner .news-thumbnail-wrapper{width:100%;height:200px}
.news-item-link.news-item-banner .news-thumbnail{border-radius:8px 8px 0 0}

/* --- Страница одной статьи (новости/сервера) --- */
.article-full{}
.article-banner{width:100%;height:40vh;background-size:cover;background-position:center;box-shadow:inset 0 -100px 80px -50px var(--dark-color);border-radius:12px 12px 0 0}
.article-header-wrapper{padding:0 1rem}
.article-header{text-align:center;padding:3rem 0;border-bottom:1px solid #333}
.article-header h1{font-size:2.8rem;color:var(--secondary-color)}
.article-date{color:#aaa}
.article-content{padding:3rem 0;font-size:1.1rem;line-height:1.8}
.article-footer{text-align:center;padding:2rem 0}

/* --- Страница донатов --- */
.donation-category-group { margin-bottom: 3rem; }
.donation-category-group h3 { font-size: 1.8rem; color: var(--secondary-color); border-bottom: 1px solid #444; padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
.donation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.donation-card { background: var(--dark-grey); border-radius: 8px; border: 1px solid #333; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.donation-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.donation-card-header { padding: 1.5rem; border-bottom: 1px solid #444; }
.donation-card-header h4 { font-size: 1.3rem; color: var(--primary-color); }
.donation-card-body { padding: 1.5rem; flex-grow: 1; color: #ccc; }
.donation-card-footer { padding: 1.5rem; border-top: 1px solid #444; display: flex; justify-content: space-between; align-items: center; }
.donation-price { font-size: 1.5rem; font-weight: 700; color: var(--gold-color); }
.donation-period { font-size: 0.9rem; color: #aaa; font-weight: 400; }

/* --- Стили для админ-панели --- */
.admin-login-body{display:flex;justify-content:center;align-items:center;height:100vh}
.login-container{width:100%;max-width:400px;padding:2rem}
.login-form{background:#2a2a2a;padding:2rem;border:1px solid var(--primary-color);border-radius:5px;box-shadow:var(--neon-glow)}
.login-form h2{text-align:center;margin-bottom:1.5rem}
.login-form input{width:100%;padding:.8rem;margin-bottom:1rem;background:#1a1a1a;border:1px solid #444;color:#fff;border-radius:3px}
.login-form button{width:100%;padding:.8rem;border:none;background:var(--primary-color);color:#fff;cursor:pointer;border-radius:3px;font-size:1rem}
.login-form .error{color:#ff6b6b;margin-bottom:1rem;text-align:center}
.admin-body{padding:2rem}
.admin-container{max-width:1200px;margin:auto}
.admin-header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:2rem;gap:1rem}
.btn-add{background-color:var(--primary-color)}
.btn-logout{background-color:#c94c4c}
.admin-table{width:100%;border-collapse:collapse;overflow-x:auto;display:block}
.admin-table th,.admin-table td{padding:1rem;border:1px solid #444;text-align:left;white-space:nowrap}
.admin-table th{background:#2a2a2a}
.admin-table .actions a{margin-right:10px;color:var(--secondary-color)}
.manage-form label{display:block;margin-top:1rem;margin-bottom:.5rem}
.manage-form input,.manage-form textarea,.manage-form select{width:100%;padding:.8rem;background:#2a2a2a;border:1px solid #444;color:#fff;border-radius:3px}
.manage-form .form-actions{margin-top:2rem}
.btn-cancel{background:#555}

/* --- Стили для редактора --- */
.editor-toolbar{background:#2a2a2a;padding:.5rem;border:1px solid #444;border-bottom:none;border-radius:5px 5px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px;}
.editor-toolbar button{background:#444;color:#fff;border:1px solid #555;padding:5px 10px;cursor:pointer}
.editor-content{min-height:250px;padding:1rem;border:1px solid #444;background:#1a1a1a;color:#fff;border-radius:0 0 5px 5px;line-height:1.6}
.editor-content:focus{outline:none;border-color:var(--primary-color)}
.preview-box{margin-top:1rem;padding:1rem;border:1px dashed #444;min-height:50px}
.editor-toolbar select { background: #444; color: #fff; border: 1px solid #555; padding: 5px; margin-right: 5px; border-radius: 3px; vertical-align: middle; }
.editor-toolbar .editor-placeholder { color: #aaa; }
.editor-toolbar .color-picker-label { vertical-align: middle; margin-left: 5px; }
.editor-toolbar input[type="color"] { vertical-align: middle; width: 28px; height: 28px; padding: 2px; border: 1px solid #555; border-radius: 3px; background: #444; cursor: pointer; }
.editor-separator { display: inline-block; width: 1px; height: 20px; background: #555; margin: 0 8px; vertical-align: middle; }

/* --- Медиа-запросы для адаптивности --- */
@media(max-width:768px){
    .container{padding:0 1rem}
    .content-panel{padding:1.5rem}
    header .header-container { flex-direction: column; gap: 1rem; }
    header nav { order: 3; }
    .user-area { order: 2; }
    .news-item{flex-direction:column}
    .news-thumbnail-wrapper{width:100%;height:200px}
    .news-thumbnail{border-radius:8px 8px 0 0}
    .news-item-link.news-item-left .news-item,.news-item-link.news-item-right .news-item{flex-direction:column}
    .news-item-link.news-item-left .news-thumbnail{border-radius:8px 8px 0 0}
    .article-header h1{font-size:2rem}
}
/* --- Стили для карточек донатов с периодами --- */
.donation-card-body {
    padding-bottom: 0.5rem;
}
.donation-card-periods {
    padding: 1rem 1.5rem;
    border-top: 1px solid #444;
}
.donation-period-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #3a3a5a;
}
.donation-period-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.period-info .period-name {
    display: block;
    font-weight: 700;
    color: #eee;
}
.period-info .period-price {
    font-size: 1.1rem;
    color: var(--gold-color);
}
.buy-button:disabled {
    background-color: #555;
    border-color: #666;
    cursor: not-allowed;
}
.no-periods {
    text-align: center;
    color: #888;
    padding: 1rem 0;
}
/* --- Стили для страниц статуса оплаты --- */
.payment-status-page {
    text-align: center;
    padding: 2rem 0;
}
.payment-icon {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 2rem;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.payment-icon.success {
    color: #2ecc71;
    border: 5px solid #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}
.payment-icon.fail {
    color: #e74c3c;
    border: 5px solid #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}
.payment-status-page p {
    font-size: 1.1rem;
    color: #ccc;
    max-width: 600px;
    margin: 1rem auto;
}
/* --- Стили для Доски Почёта (Новая версия) --- */
.honor-category-panel {
    padding: 2rem;
    margin-bottom: 2rem;
}

.honor-category-title {
    font-size: 2.2rem; /* Увеличили размер */
    font-weight: 700;
    color: var(--secondary-color);
    text-align: center; /* Центрируем заголовок */
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dark-grey);
}

.honor-grid {
    display: grid;
    grid-template-columns: 1fr; /* Одна колонка по умолчанию */
    gap: 1.5rem;
}

/* Это и есть "панелька в панельке" */
.honor-card {
    background: var(--dark-grey);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.honor-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.honor-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.honor-avatar {
    width: 60px; /* Уменьшили аватар */
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
    object-fit: cover; /* Гарантирует, что аватар не будет искажен */
}

.honor-nickname {
    font-size: 1.4rem; /* Увеличили ник */
    font-weight: 700; /* Сделали жирным */
    color: #eee;
}

.honor-card-body {
    padding-top: 1rem;
    border-top: 1px solid #3a3a5a;
}

.honor-description {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.5;
}

/* Для больших экранов снова делаем 2 колонки */
@media (min-width: 992px) {
    .honor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
