* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #0a0a12; color: #f0f0f7; transition: background 0.3s, color 0.3s; }

:root { --bg-primary: #0a0a12; --bg-secondary: #11111a; --bg-card: #161622; --bg-hover: #1e1e2e; --workspace-bg: #0a0a12; --border-color: rgba(255,255,255,0.08); --text-primary: #f0f0f7; --text-secondary: #b0b0c0; --text-muted: #707080; --accent: #7c3aed; --accent-light: #a78bfa; --input-bg: #1a1a2e; --input-text: #ffffff; }
[data-theme="light"] { --bg-primary: #ffffff; --bg-secondary: #f8f9fc; --bg-card: #ffffff; --bg-hover: #e8e4f8; --workspace-bg: #f8f9fc; --border-color: rgba(0,0,0,0.1); --text-primary: #1a1025; --text-secondary: #5c5070; --text-muted: #8a7e9e; --accent: #7c3aed; --accent-light: #8b5cf6; --input-bg: #f5f3ff; --input-text: #1a1025; }

/* Шапка */
.top-bar { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 24px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); }
.logo { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.logo span { color: var(--accent); }
.top-bar__nav { display: flex; gap: 4px; }
.nav-link { padding: 8px 20px; border-radius: 50px; text-decoration: none; color: var(--text-secondary); cursor: pointer; }
.nav-link:hover { background: var(--bg-hover); }
.nav-link.active { background: var(--accent); color: white; }
.top-bar__right { display: flex; align-items: center; gap: 12px; }

.btn { padding: 8px 18px; border-radius: 50px; font-weight: 600; cursor: pointer; border: none; background: transparent; color: var(--text-primary); }
.btn-outline { border: 1px solid var(--border-color); }
.btn-outline:hover { border-color: var(--accent); background: rgba(124,58,237,0.1); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.dashboard { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 280px; background: var(--bg-secondary); border-right: 1px solid var(--border-color); padding: 20px 16px; }
.workspace { flex: 1; padding: 24px; background: var(--workspace-bg); }

.widget { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.widget__title { font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; color: var(--text-secondary); }
.widget__content { display: flex; flex-direction: column; gap: 8px; }

.radio-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg-primary); border: 1px solid var(--border-color); cursor: pointer; color: var(--text-primary); }
.radio-card.disabled { opacity: 0.4; pointer-events: none; }
.radio-card input { display: none; }
.radio-card.active { border-color: var(--accent); background: rgba(124,58,237,0.15); }
.radio-card.active span { color: var(--accent); }

.select-custom { width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--input-bg); border: 1px solid var(--border-color); color: var(--input-text); font-family: inherit; cursor: pointer; }

.prompt-box { background: var(--bg-card); border-radius: 20px; padding: 20px; border: 1px solid var(--border-color); margin-bottom: 24px; }
.prompt-box__label { font-weight: 600; display: block; margin-bottom: 10px; color: var(--text-primary); }
.prompt-box__input { width: 100%; padding: 14px; border-radius: 16px; background: var(--input-bg); border: 1px solid var(--border-color); color: var(--input-text); font-family: inherit; resize: vertical; min-height: 100px; }

.duration-buttons, .quality-buttons { display: flex; gap: 8px; margin-top: 12px; }
.btn-duration, .btn-quality { padding: 8px 16px; border-radius: 50px; background: var(--bg-primary); border: 1px solid var(--border-color); cursor: pointer; color: var(--text-primary); transition: all 0.2s; }
.btn-duration.active, .btn-quality.active { background: var(--accent); color: white; border-color: var(--accent); }
.btn-duration:hover, .btn-quality:hover { background: var(--bg-hover); }

.preview-area { background: var(--bg-card); border-radius: 24px; padding: 40px; text-align: center; border: 1px solid var(--border-color); min-height: 300px; display: flex; align-items: center; justify-content: center; }

.btn-generate-neon { padding: 14px 32px; font-size: 0.9rem; font-weight: 700; background: linear-gradient(135deg, #7c3aed, #a855f7); color: white; border: none; border-radius: 60px; cursor: pointer; transition: transform 0.2s; }
.btn-generate-neon:hover { transform: translateY(-2px); }
.btn-generate-neon:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.frames-upload { display: none; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.frames-upload.active { display: flex; }
.frame-upload-box { flex: 1; min-width: 180px; min-height: 180px; border: 2px dashed var(--border-color); border-radius: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--bg-primary); transition: all 0.2s; }
.frame-upload-box:hover { border-color: var(--accent); background: var(--bg-hover); }
.frame-upload-box span { color: var(--text-secondary); }

.credits-badge { display: flex; align-items: center; gap: 6px; background: rgba(124,58,237,0.15); padding: 6px 14px; border-radius: 50px; cursor: pointer; transition: 0.2s; }
.credits-badge:hover { background: rgba(124,58,237,0.3); transform: scale(1.02); }

.theme-toggle { background: none; border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 50px; cursor: pointer; color: var(--text-primary); }
.theme-toggle:hover { background: var(--bg-hover); }

.generate-price { font-size: 1rem; font-weight: 700; color: var(--accent-light); }

/* ========== НОВЫЕ КНОПКИ (Перевод, Помощь, Оптимизация) ========== */
.btn-icon {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-icon:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: translateY(-1px);
}
.btn-icon:active {
    transform: translateY(0);
}

/* Модальные окна */
.auth-popup__backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; }
.auth-popup__backdrop.active { display: block; }
.auth-popup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-card); border-radius: 24px; padding: 24px; z-index: 1001; width: 90%; max-width: 400px; border: 1px solid var(--border-color); }
.auth-popup.active { display: block; }
.auth-popup input { width: 100%; padding: 12px; margin: 10px 0; border-radius: 12px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--input-text); font-family: inherit; }
.auth-popup__close { float: right; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-primary); }

.user-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 320px; background: var(--bg-card); border-radius: 24px; border: 1px solid var(--border-color); z-index: 2000; overflow: hidden; }
.user-modal.active { display: block; }
.user-modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1999; }
.user-modal-backdrop.active { display: block; }
.user-modal-header { padding: 20px; text-align: center; background: linear-gradient(135deg, #7c3aed, #a855f7); color: white; position: relative; }
.user-modal-avatar { width: 70px; height: 70px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 2rem; color: #7c3aed; }
.user-modal-name { font-size: 1.2rem; font-weight: 700; }
.user-modal-email { font-size: 0.8rem; opacity: 0.8; }
.user-modal-stats { display: flex; justify-content: space-around; padding: 16px; border-bottom: 1px solid var(--border-color); }
.user-modal-stat { text-align: center; }
.user-modal-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--accent-light); }
.user-modal-stat-label { font-size: 0.7rem; color: var(--text-muted); }
.user-modal-menu { padding: 8px 0; }
.user-modal-item { padding: 12px 20px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s; color: var(--text-primary); }
.user-modal-item:hover { background: var(--bg-hover); }
.user-modal-item.delete-account { color: #ef4444; border-top: 1px solid var(--border-color); margin-top: 8px; }
.user-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: white; }

.password-wrapper { position: relative; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-secondary); }

/* Аватар пользователя */
.user-icon-wrapper { cursor: pointer; display: flex; align-items: center; justify-content: center; }
.user-icon { cursor: pointer; transition: transform 0.2s; font-size: 1.3rem; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; color: white; }
.user-icon:hover { transform: scale(1.05); background: #6d28d9; }

/* Стили для модального окна недостатка кредитов */
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.95); z-index:10002; display:flex; align-items:center; justify-content:center; }
.modal-content { background:#161622; border-radius:24px; padding:32px; max-width:450px; width:90%; border:1px solid #ef4444; text-align:center; }
.modal-content ul { list-style:none; padding-left:0; }
.modal-content li { padding:6px 0; border-bottom:1px solid #2a2a3a; }
.modal-content li:last-child { border-bottom:none; }
.btn-bonus { width:100%; background:#10b981; border:none; border-radius:12px; padding:12px; margin-top:16px; cursor:pointer; color:white; font-weight:bold; transition: background 0.2s; }
.btn-bonus:hover { background:#059669; }

/* ========== ПОДВАЛ (FOOTER) ========== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 24px 24px;
    margin-top: 60px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand .logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: inline-block;
}
.footer-brand .logo span { color: var(--accent); }
.footer-brand .tagline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 8px;
}
.footer-section h4 {
    color: var(--accent-light);
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 600;
}
.footer-section ul {
    list-style: none;
    padding: 0;
}
.footer-section ul li {
    margin-bottom: 10px;
}
.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-section ul li a:hover {
    color: var(--accent);
}
.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-contacts a,
.footer-contacts span {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-contacts a:hover {
    color: var(--accent);
}
.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================
   ДНЕВНАЯ ТЕМА — ТЁМНЫЙ ТЕКСТ
   ============================================ */

/* Тёмный текст для "0 кред." */
[data-theme="light"] .credits-badge,
[data-theme="light"] .credits-badge span {
    color: #1a1025 !important;
    font-weight: 700;
}

/* Тёмный текст для "Параметры видео" */
[data-theme="light"] .params-header-title {
    color: #1a1025 !important;
    font-weight: 700;
}

/* Адаптивность */
@media (max-width: 768px) {
    .dashboard { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
    .workspace { padding: 16px; }
    .top-bar { flex-wrap: wrap; height: auto; padding: 12px; gap: 10px; }
    .duration-buttons, .quality-buttons { flex-wrap: wrap; }
    .btn-duration, .btn-quality { padding: 6px 12px; font-size: 12px; }
    .user-icon { width: 32px; height: 32px; font-size: 1.1rem; }
    .btn-icon { padding: 4px 10px; font-size: 0.65rem; }
    .site-footer { padding: 32px 16px 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .footer-brand { text-align: center; }
    .footer-contacts { align-items: center; }
    .generator-layout { flex-direction: column; }
    .btn-generate-neon { width: 100%; padding: 16px 32px; font-size: 1rem; }
}/* Дневная тема — тёмный текст */
[data-theme="light"] .prompt-label,
[data-theme="light"] .credits-badge,
[data-theme="light"] .credits-badge span,
[data-theme="light"] .params-header-title {
    color: #1a1025 !important;
}