/* styles/ai-assistant.css */
/* Полный набор стилей для страницы AI Ассистента VaPN */

/* ===== CSS Variables ===== */
:root {
    /* Темная тема (по умолчанию) */
    --primary-dark: #0D1B48;
    --primary-light: #4A9DFF;
    --accent: #00FFC5;
    --accent-glow: rgba(0, 255, 197, 0.6);
    --bg-main: #0A0E1F;
    --white: #FFFFFF;
    --text-muted: #B0B8D0;
    --purple-neon: #A855F7;
    --success-color: #69db7c;
    --error-color: #ff6b6b;
    --border-color: rgba(74, 157, 255, 0.2);
    --bg-secondary: rgba(13, 27, 72, 0.3);
    --bg-tertiary: rgba(13, 27, 72, 0.5);
    --shadow-color: rgba(0, 40, 100, 0.2);
    --ai-gradient: linear-gradient(135deg, #9c36b5, #7048e8, #3b5bdb);
}

/* ===== Светлая тема ===== */
body.light-theme {
    --primary-dark: #0D1B48;
    --primary-light: #4A9DFF;
    --accent: #00A2FF;
    --accent-glow: rgba(0, 162, 255, 0.6);
    --bg-main: #F0F5FF;
    --white: #FFFFFF;
    --text-muted: #4A5568;
    --purple-neon: #7C3AED;
    --success-color: #00A2FF;
    --error-color: #ff6b6b;
    --border-color: rgba(74, 157, 255, 0.3);
    --bg-secondary: rgba(255, 255, 255, 0.7);
    --bg-tertiary: rgba(240, 245, 255, 0.5);
    --shadow-color: rgba(13, 27, 72, 0.1);
    --ai-gradient: linear-gradient(135deg, #9c36b5, #7048e8, #4263eb);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

/* ===== КОСМИЧЕСКИЙ ФОН ===== */
html,
body {
    background-color: #0A0E1F;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at 20% 80%, rgba(74, 157, 255, 0.1) 0%, transparent 40%), 
                radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 40%), 
                radial-gradient(circle at 40% 40%, rgba(0, 255, 197, 0.05) 0%, transparent 50%), 
                linear-gradient(135deg, #0A0E1F 0%, #0F1A3A 50%, #1A1F33 100%);
    color: var(--white);
    position: relative;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

body.light-theme {
    background: radial-gradient(circle at 20% 30%, rgba(74, 157, 255, 0.15) 0%, transparent 25%), 
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 25%), 
                radial-gradient(circle at 50% 50%, rgba(0, 255, 197, 0.08) 0%, transparent 30%), 
                linear-gradient(135deg, #E6F0FF 0%, #F0F7FF 30%, #FFFFFF 70%, #F8FAFF 100%);
    color: #1A202C;
}

/* Звезды - слой 1 (мелкие) */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 4s infinite;
}

/* Звезды - слой 2 (средние) */
.stars2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.star2 {
    position: absolute;
    background-color: var(--primary-light);
    border-radius: 50%;
    animation: twinkle 3s infinite;
    animation-delay: 1s;
}

/* Звезды - слой 3 (крупные) */
.stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.star3 {
    position: absolute;
    background-color: var(--accent);
    border-radius: 50%;
    animation: twinkle 5s infinite;
    animation-delay: 2s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
main {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ===== ХЕДЕР ===== */
.main-header {
    position: relative;
    z-index: 10;
    padding: 20px 0;
    border-bottom: 1px solid rgba(74, 157, 255, 0.2);
    background: rgba(13, 27, 72, 0.8);
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    height: 65px;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.logo:hover {
    transform: scale(1.08);
    opacity: 1;
}

.header-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.login-btn {
    background: linear-gradient(135deg, rgba(74, 157, 255, 0.15), rgba(13, 27, 72, 0.25));
    border: 1px solid rgba(74, 157, 255, 0.3);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 197, 0.2), rgba(13, 27, 72, 0.35));
    border-color: var(--accent);
    transform: translateY(-2px);
}

.download-btn {
    background: linear-gradient(135deg, var(--accent), #00D4A3);
    color: #00110D;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    border: none;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 255, 197, 0.3);
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */
.theme-switcher-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: left;
    margin: 5px;
}

.theme-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    background: rgba(13, 27, 72, 0.6);
    color: var(--white);
    border: 1px solid rgba(74, 157, 255, 0.3);
}

.theme-btn:hover {
    background: rgba(74, 157, 255, 0.3);
    transform: scale(1.1);
}

.theme-btn.active {
    background: linear-gradient(135deg, var(--accent), #00D4A3);
    color: #00110D;
    box-shadow: 0 0 15px rgba(0, 255, 197, 0.5);
}

/* Мобильный переключатель */
.mobile-theme-toggle {
    display: none;
}

.theme-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), #00D4A3);
    color: #00110D;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* ===== PROFILE WRAPPER (ОСНОВНОЙ БЛОК) ===== */
.profile-wrapper {
    background: linear-gradient(145deg, rgba(13, 27, 72, 0.85), rgba(20, 35, 90, 0.75));
    border-radius: 28px;
    padding: 50px;
    border: 1px solid rgba(74, 157, 255, 0.25);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* ===== ЗАГОЛОВКИ ===== */
.hero-section {
    margin-bottom: 40px;
}

.hero-content {
    text-align: center;
    padding: 20px;
}

.hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 30px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== AI СПЕЦИФИЧЕСКИЕ СТИЛИ ===== */
.ai-icon-large {
    width: 80px;
    height: 80px;
    background: var(--ai-gradient);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
    box-shadow: 0 10px 30px rgba(156, 54, 181, 0.4);
    animation: float 3s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 10px 20px;
    border-radius: 40px;
    border: 1px solid rgba(156, 54, 181, 0.3);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #69db7c;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(105, 219, 124, 0.7); }
    50% { opacity: 0.7; box-shadow: 0 0 0 10px rgba(105, 219, 124, 0); }
}

.status-text {
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== ЧАТ ===== */
.chat-section {
    margin-bottom: 50px;
}

.chat-container {
    background: rgba(13, 27, 72, 0.3);
    border-radius: 22px;
    padding: 25px;
    border: 1px solid rgba(74, 157, 255, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--ai-gradient);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(13, 27, 72, 0.2);
    border-radius: 18px;
    margin-bottom: 20px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(156, 54, 181, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--ai-gradient);
    border-radius: 3px;
}

/* Сообщения */
.message {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 45px;
    height: 45px;
    background: var(--ai-gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(156, 54, 181, 0.3);
}

.message.user-message .message-avatar {
    background: linear-gradient(135deg, var(--accent), #00D4A3);
}

.message-content {
    max-width: 70%;
    background: rgba(156, 54, 181, 0.1);
    padding: 15px 20px;
    border-radius: 18px;
    border: 1px solid rgba(156, 54, 181, 0.3);
    position: relative;
}

.message.user-message .message-content {
    background: rgba(0, 255, 197, 0.1);
    border-color: rgba(0, 255, 197, 0.3);
}

.message-sender {
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-light);
    font-size: 0.9rem;
}

.message.user-message .message-sender {
    color: var(--accent);
}

.message-text {
    color: var(--white);
    line-height: 1.6;
    font-size: 0.95rem;
}

.message-text p {
    margin-bottom: 10px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, 
.message-text ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message-text li {
    margin-bottom: 5px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 8px;
}

/* Подсказки */
.suggestions-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(156, 54, 181, 0.05);
    border-radius: 15px;
    border: 1px dashed rgba(156, 54, 181, 0.3);
}

.suggestions-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestions-title i {
    color: #f1c40f;
}

.suggestions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-btn {
    background: rgba(156, 54, 181, 0.1);
    border: 1px solid rgba(156, 54, 181, 0.3);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: rgba(156, 54, 181, 0.2);
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: 0 5px 15px rgba(156, 54, 181, 0.2);
}

.suggestion-btn i {
    font-size: 0.9rem;
    color: var(--primary-light);
}

/* Поле ввода */
.chat-input-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: rgba(13, 27, 72, 0.3);
    border: 1px solid rgba(74, 157, 255, 0.2);
    border-radius: 25px;
    padding: 15px 20px;
    color: var(--white);
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(13, 27, 72, 0.5);
}

.chat-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.send-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--ai-gradient);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(156, 54, 181, 0.4);
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(156, 54, 181, 0.6);
}

/* Индикатор печатания */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: rgba(156, 54, 181, 0.1);
    border-radius: 18px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.ai-disclaimer {
    margin-top: 15px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ===== ПОПУЛЯРНЫЕ ТЕМЫ ===== */
.topics-section {
    margin-bottom: 50px;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.topic-card {
    background: rgba(13, 27, 72, 0.3);
    border-radius: 18px;
    padding: 25px 20px;
    text-align: center;
    border: 1px solid rgba(74, 157, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.topic-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 255, 197, 0.1);
}

.topic-icon {
    width: 60px;
    height: 60px;
    background: rgba(156, 54, 181, 0.15);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 28px;
    color: var(--primary-light);
}

.topic-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--white);
}

.topic-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== БЫСТРАЯ ПОДДЕРЖКА ===== */
.quick-support {
    margin-bottom: 30px;
}

.support-content {
    background: rgba(13, 27, 72, 0.3);
    border-radius: 22px;
    padding: 40px 30px;
    text-align: center;
    border: 1px solid rgba(74, 157, 255, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.support-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #69db7c, #51cf66);
}

.support-content h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--white);
}

.support-content p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.support-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.support-btn.primary {
    background: linear-gradient(135deg, var(--accent), #00D4A3);
    color: #00110D;
    box-shadow: 0 5px 20px rgba(0, 255, 197, 0.3);
}

.support-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 197, 0.5);
}

.support-btn.secondary {
    background: rgba(74, 157, 255, 0.1);
    border: 1px solid rgba(74, 157, 255, 0.3);
    color: var(--white);
}

.support-btn.secondary:hover {
    background: rgba(74, 157, 255, 0.2);
    border-color: var(--accent);
    transform: translateY(-3px);
}

/* ===== ФУТЕР ===== */
footer {
    margin-top: 80px;
    background: rgba(13, 27, 72, 0.6);
    border-top: 1px solid rgba(74, 157, 255, 0.25);
    text-align: center;
    padding: 30px;
    color: var(--primary-light);
    font-size: 15px;
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--primary-light), transparent);
}

footer:hover {
    background: rgba(13, 27, 72, 0.7);
    border-top-color: var(--accent);
}

/* ===== АНИМАЦИИ ===== */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

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

/* ===== СВЕТЛАЯ ТЕМА (дополнительные стили) ===== */
body.light-theme .main-header {
    background: rgba(13, 27, 72, 0.95) !important;
}

body.light-theme .login-btn {
    color: white !important;
}

body.light-theme .profile-wrapper {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(240, 245, 255, 0.75));
}

body.light-theme .message-content {
    color: #1A202C;
}

body.light-theme .message-text {
    color: #1A202C;
}

body.light-theme .chat-input {
    color: #1A202C;
}

body.light-theme .chat-input::placeholder {
    color: #4A5568;
}

body.light-theme .suggestion-btn {
    color: #1A202C;
}

body.light-theme .topic-card h3 {
    color: #1A202C;
}

body.light-theme .support-content h3 {
    color: #1A202C;
}

body.light-theme .support-btn.secondary {
    color: #1A202C;
}

body.light-theme footer {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.85));
    color: var(--primary-dark);
}

body.light-theme footer:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 245, 255, 0.9));
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 36px;
    }
    
    .section-title {
        font-size: 30px;
    }
    
    .profile-wrapper {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .ai-icon-large {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    .chat-messages {
        height: 350px;
        padding: 15px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
    
    .suggestions-grid {
        flex-wrap: wrap;
    }
    
    .suggestion-btn {
        flex: 1 1 auto;
        white-space: normal;
        text-align: left;
        font-size: 0.85rem;
    }
    
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .topic-card {
        padding: 20px 15px;
    }
    
    .support-content {
        padding: 30px 20px;
    }
    
    .support-content h3 {
        font-size: 1.6rem;
    }
    
    .support-buttons {
        flex-direction: column;
    }
    
    .support-btn {
        width: 100%;
        justify-content: center;
    }
    
    .theme-switcher-container {
        position: relative;
    }
    
    .theme-switcher {
        display: none;
    }
    
    .mobile-theme-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px 16px;
    }
    
    .profile-wrapper {
        padding: 20px 15px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .chat-container {
        padding: 15px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .send-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .mobile-theme-toggle {
        bottom: 15px;
        right: 15px;
    }
    
    .theme-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .login-btn:hover,
    .download-btn:hover,
    .suggestion-btn:hover,
    .topic-card:hover {
        transform: none;
    }
    
    .btn:active,
    .login-btn:active,
    .download-btn:active,
    .send-btn:active,
    .suggestion-btn:active,
    .topic-card:active {
        transform: scale(0.98);
    }
}

/* Экстремально маленькие экраны (включая 320x320) */
@media (max-width: 360px), (max-height: 360px) {
    main {
        padding: 12px 10px;
    }

    .profile-wrapper {
        padding: 14px 10px;
    }

    .hero-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 14px;
        line-height: 1.45;
    }

    .chat-container {
        padding: 12px 10px;
    }

    .chat-messages {
        height: 220px;
        padding: 10px;
    }

    .message-content {
        max-width: 90%;
    }

    .message-text {
        font-size: 13px;
    }

    .chat-input-container {
        gap: 8px;
    }

    .chat-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .send-btn {
        width: 40px;
        height: 40px;
    }

    .suggestions-grid {
        gap: 8px;
    }

    .suggestion-btn {
        width: 100%;
        font-size: 13px;
        padding: 10px;
    }

    .topics-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .topic-card {
        padding: 14px 10px;
    }

    .support-content {
        padding: 18px 12px;
    }

    .support-content h3 {
        font-size: 20px;
    }
}

/* =====    (override) ===== */
.star,
.star2,
.star3 {
    display: none !important;
}

.stars,
.stars2,
.stars3 {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
    contain: strict;
}

.stars {
    opacity: 0.45;
    background-image:
        radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.9) 99%, transparent 100%),
        radial-gradient(1px 1px at 78% 22%, rgba(255, 255, 255, 0.85) 99%, transparent 100%),
        radial-gradient(1px 1px at 34% 68%, rgba(255, 255, 255, 0.75) 99%, transparent 100%);
    background-size: 340px 340px, 480px 480px, 620px 620px;
    background-repeat: repeat;
    animation: skyDriftSlow 140s linear infinite;
}

.stars2 {
    opacity: 0.28;
    background-image:
        radial-gradient(1.5px 1.5px at 16% 42%, rgba(74, 157, 255, 0.85) 99%, transparent 100%),
        radial-gradient(1.5px 1.5px at 66% 76%, rgba(74, 157, 255, 0.7) 99%, transparent 100%);
    background-size: 620px 620px, 900px 900px;
    background-repeat: repeat;
    animation: skyDriftMedium 220s linear infinite reverse;
}

.stars3 {
    opacity: 0.22;
    background-image: radial-gradient(2px 2px at 22% 30%, rgba(0, 255, 197, 0.6) 99%, transparent 100%);
    background-size: 1200px 1200px;
    background-repeat: repeat;
    animation: skyDriftFar 320s linear infinite;
}

@keyframes skyDriftSlow {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-72px, -120px, 0); }
}

@keyframes skyDriftMedium {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(60px, -90px, 0); }
}

@keyframes skyDriftFar {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-40px, -56px, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .stars,
    .stars2,
    .stars3 {
        animation: none !important;
        transform: none !important;
    }
}
