/* auth.css - Стили модальных окон авторизации */

/* === МОДАЛЬНЫЕ ОКНА === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок модалки */
.modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #2a2a2a;
    color: #fff;
}

/* Формы */
.modal-content form {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
    font-size: 13px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid #3a3a3a;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a9a6a;
}

.form-group input::placeholder {
    color: #666;
}

/* Ошибки */
.form-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.form-error:empty {
    display: none;
}

/* Кнопки */
.btn-primary {
    width: 100%;
    background: #2a8a5a;
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #35a570;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: calc(100% - 48px);
    margin: 16px 24px 24px 24px;
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* Футер модалки */
.modal-footer {
    padding: 0 24px 24px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.modal-footer a {
    color: #4a9a6a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.modal-footer a:hover {
    color: #5aaa7a;
}

/* === ПРОФИЛЬ === */
.profile-info {
    padding: 32px 24px 24px;
    text-align: center;
}

.profile-avatar-big {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 16px;
}

.profile-name-big {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.profile-email {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
}

.account-type-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.account-type-badge.guest {
    background: rgba(136, 136, 136, 0.2);
    color: #888;
}

.account-type-badge.registered {
    background: rgba(42, 138, 90, 0.2);
    color: #4a9a6a;
}

.account-type-badge.premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.premium-until {
    font-size: 12px;
    color: #FFD700;
    margin-top: 8px;
}

/* Промокод */
.promocode-section {
    padding: 24px;
    border-top: 1px solid #2a2a2a;
}

.promocode-section.hidden {
    display: none !important;
}

.promocode-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

/* Скрываем предупреждение о шифровании (больше не используется) */
.encryption-warning {
    display: none !important;
}

.encryption-status {
    font-size: 12px;
    color: #888;
    margin-top: 12px;
    padding: 8px;
    background: rgba(74, 154, 106, 0.1);
    border-radius: 6px;
}

/* === УВЕДОМЛЕНИЯ === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    transform: translateX(450px);
    transition: transform 0.3s ease;
    font-size: 14px;
    color: #fff;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #4a9a6a;
    background: linear-gradient(90deg, rgba(74, 154, 106, 0.1), #1a1a1a);
}

.notification.error {
    border-left: 4px solid #ff4444;
    background: linear-gradient(90deg, rgba(255, 68, 68, 0.1), #1a1a1a);
}

.notification.info {
    border-left: 4px solid #4a9aff;
    background: linear-gradient(90deg, rgba(74, 154, 255, 0.1), #1a1a1a);
}

/* === AUTH CONTAINER В САЙДБАРЕ === */
.auth-container {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #2a2a2a;
    position: relative;
    z-index: 10; /* 🔧 ФИКС: Повышаем z-index для кликабельности */
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    z-index: 10; /* 🔧 ФИКС: Гарантируем кликабельность */
}

.login-btn {
    background: transparent;
    border: 1px solid #3a3a3a !important;
    color: #fff;
}

.login-btn:hover {
    background: #2a2a2a;
}

.register-btn {
    background: #2a8a5a;
    color: #fff;
}

.register-btn:hover {
    background: #35a570;
}

/* Profile Button */
.profile-btn {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 10px 12px;
    display: none;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 10; /* 🔧 ФИКС: Гарантируем кликабельность */
}

.profile-btn:hover {
    background: #2a2a2a;
}

.profile-btn.premium {
    border: 2px solid #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 215, 0, 0.02));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.profile-btn.premium:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.25);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.profile-btn.premium .profile-avatar {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.profile-name {
    flex: 1;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-btn.premium .profile-name {
    color: #FFD700;
    font-weight: 600;
}

/* Скроллбар для модалок */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }

    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .form-group input {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    /* 🔧 ФИКС: Усиливаем кликабельность на мобильных */
    .auth-container {
        position: relative;
        z-index: 100;
        pointer-events: auto;
    }
    
    .auth-btn,
    .profile-btn {
        position: relative;
        z-index: 100;
        pointer-events: auto;
        touch-action: manipulation; /* Улучшает отклик на касание */
    }
}
