/* ======== КОМПОНЕНТЫ ======== */

/* --- Утилиты доступности --- */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --- Кнопка CTA (Call to Action) --- */
.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: #00BFFF;
    color: #0a0a0a;
    font-family: 'Russo One', sans-serif;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    margin-top: 40px;
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 191, 255, 0.8);
}

.cta-button.disabled {
    background-color: #333;
    color: #777;
    box-shadow: none;
    pointer-events: none;
    cursor: not-allowed;
}

.cta-subtext {
    font-size: 0.8rem; /* Мелкий текст */
    opacity: 0.7;      /* Делаем его полупрозрачным */
    margin-top: 2px;
}

/* --- Карточка --- */
.card {
    background-color: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid #333;
    padding: 30px 25px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #00BFFF;
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #EAEAEA;
}

.card p {
    color: #A0A0A0;
    line-height: 1.6;
}

.card-link {
    text-decoration: none;
    display: block;
}

.card-link h3 {
    color: #EAEAEA;
}

.card-link p {
    color: #A0A0A0;
}

/* --- Топлайн --- */
.topline {
    position: sticky; /* Фиксируем наверху страницы */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100; /* Выше всего остального контента */
    padding: 15px 0;
    background-color: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
}

.topline-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topline-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #EAEAEA;
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    margin-right: 30px;
}

.topline-logo img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

/* --- НОВЫЕ СТИЛИ ДЛЯ АДАПТИВНОЙ НАВИГАЦИИ --- */
.topline-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

.topline-visible-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    overflow: hidden;
    flex-shrink: 1;
    min-width: 0;
}

/* --- Стили для ОБЫЧНЫХ ссылок в видимой части --- */
.topline-visible-nav > a {
    color: #A0A0A0;
    text-decoration: none;
    font-size: 1rem;
    padding: 5px 10px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.topline-visible-nav > a:hover,
.topline-visible-nav > a:active {
    color: #fff;
    text-shadow: 0 0 5px #00BFFF;
    border-bottom-color: #00BFFF;
}


/* --- Стили для КНОПКИ (.cta-button) в видимой части --- */
.topline .cta-button {
    /* Адаптируем размер и отступы для топлайна */
    padding: 8px 20px;
    font-size: 0.9rem;
    margin: 0 0 0 30px;
}

/* --- Выпадающее меню и Гамбургер --- */
.menu-toggle {
    display: none; /* Изначально скрыт, будет показан через JS */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
    margin-left: 30px; /* Отступ от видимого меню */
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #EAEAEA;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Анимация иконки гамбургера */
.menu-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Контейнер выпадающего меню (эти стили остаются для мобильной версии) */
.topline-nav-wrapper {
    box-sizing: border-box;
    display: flex;
    position: absolute;
    top: 75px;
    right: 20px;
    border: 0 solid #333;
    width: 300px;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    z-index: 105;

    transition: all 0.3s ease;
    max-height: 0;
    padding: 0;
}

.topline-nav-wrapper.is-open {
    padding: 20px 0;
    max-height: calc(100vh - 86px);
    border-width: 1px;
}

.topline-nav-wrapper .topline-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.topline-nav-wrapper .topline-nav a {
    color: #A0A0A0;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 20px;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: none;
}

.topline-nav-wrapper .topline-nav a:hover,
.topline-nav-wrapper .topline-nav a:active {
    color: #fff;
    text-shadow: 0 0 5px #00BFFF;
    background-color: rgba(0, 191, 255, 0.1);
    border-bottom-color: transparent;
}

.topline-nav-wrapper .topline-cta {
    margin-top: 0;
    padding: 8px 20px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 250px;
}

/* --- Заголовок страницы --- */
.page-header-container {
    padding-top: 40px;
    padding-bottom: 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    text-align: center;
}

.page-header-container h1 {
    font-size: 3rem;
    margin: 0;
}

/* --- Формы --- */
.form-group {
    margin-bottom: 25px;
}

.form-group label, .form-label {
    display: block;
    margin-bottom: 8px;
    color: #A0A0A0;
    font-family: 'Russo One', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.form-input {
    max-width: 418px;
    width: 100%;
    padding: 12px 15px;
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: 5px;
    color: #EAEAEA;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #00BFFF;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.form-textarea {
    width: 100%;
    min-height: 150px;
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: 5px;
    color: #EAEAEA;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #00BFFF;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.form-control-plaintext {
    background-color: #0a0a0a;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 5px;
    text-align: left;
    min-height: 150px;
    max-height: 200px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    overflow-y: scroll;
}
.form-control-plaintext::-webkit-scrollbar { width: 3px; }
.form-control-plaintext::-webkit-scrollbar-button { display: none; }
.form-control-plaintext::-webkit-scrollbar-track { background-color: transparent; }
.form-control-plaintext::-webkit-scrollbar-thumb { background: #333; }

/* --- Модальное окно --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.is-visible {
    display: flex;
}

.modal-content {
    background-color: #1A1A1A;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #A0A0A0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close-btn:hover {
    color: #fff;
}

/* --- Сообщения Django --- */
.messages-list {
    list-style-type: none;
    padding: 0;
    margin-top: 20px;
}

.message-item {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    text-align: left;
}

.message-item.success {
    background-color: rgba(57, 255, 20, 0.1);
    border-left: 4px solid #39FF14;
}

.message-item.error {
    background-color: rgba(229, 57, 53, 0.1);
    border-left: 4px solid #E53935;
}

/* --- Плейсхолдеры --- */
.no-achievements, .no-events-placeholder {
    background-color: #1A1A1A;
    border: 1px dashed #333;
    padding: 40px;
    border-radius: 8px;
    color: #A0A0A0;
    text-align: center;
}

/* --- XP --- */
.profile-xp-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #39FF14;
    font-family: 'Russo One', sans-serif;
    letter-spacing: 1px;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid #333;
    background: rgba(10, 10, 10, 0.9);
    padding: 40px 0;
    margin-top: auto;
}

.site-footer__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #7C7C7C;
    font-size: 0.95rem;
}

.site-footer__links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.site-footer__links a {
    color: #A0A0A0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.site-footer__links a:hover {
    color: #00BFFF;
}

@media (max-width: 600px) {
    .site-footer__container {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer__links {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Notifications --- */
/* (удалено в пользу toast-stack) */

/* --- НОВЫЕ СТИЛИ ДЛЯ ТОСТОВ --- */
.toast-stack {
    position: fixed;
    top: 100px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    z-index: 240;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 191, 255, 0.25);
    background: rgba(26, 26, 26, 0.95);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #EAEAEA;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.toast__icon {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #39FF14, #0CE067);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
}

.toast__body {
    flex: 1;
}

.toast__body p {
    margin: 0;
}

.toast__close {
    background: transparent;
    border: none;
    color: rgba(234, 234, 234, 0.65);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.toast__close:hover,
.toast__close:focus-visible {
    color: #EAEAEA;
    outline: none;
}

.toast--success {
    border-color: rgba(57, 255, 20, 0.35);
    background: rgba(14, 42, 18, 0.9);
}

.toast--success .toast__icon {
    background: linear-gradient(180deg, #39FF14, #0CE067);
}

.toast--error {
    border-color: rgba(255, 59, 59, 0.35);
    background: rgba(48, 12, 14, 0.92);
}

.toast--error .toast__icon {
    background: linear-gradient(180deg, #FF3B3B, #FF7A3D);
    box-shadow: 0 0 12px rgba(255, 59, 59, 0.4);
}

.toast--warning {
    border-color: rgba(255, 193, 7, 0.35);
    background: rgba(49, 36, 9, 0.92);
}

.toast--warning .toast__icon {
    background: linear-gradient(180deg, #FFC107, #FF9900);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.35);
}

.toast--info {
    border-color: rgba(0, 191, 255, 0.35);
    background: rgba(9, 30, 46, 0.92);
}

.toast--info .toast__icon {
    background: linear-gradient(180deg, #00BFFF, #0077C0);
    box-shadow: 0 0 12px rgba(0, 191, 255, 0.35);
}

@media (max-width: 768px) {
    .toast-stack {
        right: 16px;
        top: 88px;
        width: min(320px, calc(100vw - 16px));
    }
}
