/* =========================================================
   ГЛОБАЛЬНЫЕ СТИЛИ И ПЕРЕМЕННЫЕ
========================================================= */
:root {
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --badge-bg: #e0e7ff;
    --badge-text: #4338ca;
}

body { 
    font-family: Arial, sans-serif; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    background: #f8fafc; 
}

/* =========================================================
   ШАПКА (НАВИГАЦИЯ И ПРОФИЛЬ)
========================================================= */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 10px; border-bottom: 1px solid #ccc; }
nav a { margin-right: 20px; text-decoration: none; color: #0066cc; font-weight: bold; cursor: pointer; }
nav a.active { color: #000; cursor: default; }

#user-panel { display: none; align-items: center; gap: 15px; font-size: 14px; }
.balance-badge { background: #48bb78; color: white; padding: 4px 8px; border-radius: 12px; font-weight: bold; }
.btn-logout { background: #e2e8f0; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }

/* Кастомное меню языков интерфейса */
.lang-dropdown { position: relative; display: inline-block; margin-right: 20px; }
.lang-btn { background: transparent; border: 1px solid #cbd5e0; border-radius: 4px; padding: 5px 10px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.lang-btn:hover { background: #edf2f7; }
.lang-content { display: none; position: absolute; right: 0; background-color: white; min-width: 100px; box-shadow: 0px 4px 6px rgba(0,0,0,0.1); border-radius: 4px; z-index: 100; overflow: hidden; border: 1px solid #e2e8f0; margin-top: 5px; }
.lang-content div { color: #2d3748; padding: 10px 15px; text-decoration: none; display: block; cursor: pointer; font-size: 14px; }
.lang-content div:hover { background-color: #edf2f7; }
.show-dropdown { display: block; }

/* =========================================================
   МОДАЛЬНЫЕ ОКНА (АВТОРИЗАЦИЯ)
========================================================= */
#auth-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
.auth-box { background: white; padding: 30px; border-radius: 8px; width: 300px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.auth-box input { width: 100%; padding: 10px; margin-bottom: 15px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
.auth-box button { width: 100%; padding: 10px; background: #0066cc; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; margin-bottom: 10px; }
.auth-box button.alt { background: #edf2f7; color: #2d3748; }

#service-container { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: none; }

/* =========================================================
   UI-КОМПОНЕНТЫ ПРИЛОЖЕНИЯ (Озвучка, Клонирование и тд)
========================================================= */
.tts-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-top: 15px; }
@media (max-width: 768px) { .tts-grid { grid-template-columns: 1fr; } }

.tts-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 15px;
}

.tts-label {
    display: inline-block; background: var(--badge-bg); color: var(--badge-text);
    padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; margin-bottom: 10px;
}

.tts-input, .tts-select, .tts-textarea {
    width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 14px; box-sizing: border-box; color: var(--text-main);
    transition: border-color 0.2s;
}
.tts-input:focus, .tts-textarea:focus, .tts-select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.tts-textarea { resize: vertical; }

.tts-row { display: flex; gap: 15px; margin-bottom: 15px; }
.tts-row > div { flex: 1; }

.tts-btn {
    width: 100%; padding: 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: bold;
    cursor: pointer; transition: opacity 0.2s; display: flex; justify-content: center; align-items: center; gap: 8px;
}
.tts-btn:hover { opacity: 0.9; }
.tts-btn:disabled { background: #94a3b8; cursor: not-allowed; }

.status-box {
    background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; font-family: monospace; font-size: 13px; color: var(--text-main); min-height: 40px;
}

/* Всплывающие подсказки [i] */
.tooltip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: var(--text-muted); color: white;
    border-radius: 50%; font-size: 11px; font-weight: bold; margin-left: 5px;
    cursor: help; position: relative;
}
.tooltip-icon:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 6px 10px; border-radius: 4px; font-size: 12px;
    white-space: pre-wrap; width: max-content; max-width: 220px; z-index: 10; font-weight: normal; text-transform: none;
}