* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Шапка - синий фон с золотыми акцентами */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #0032A0;
    color: #FFD600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 2px solid #FFD600;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.header-right {
    justify-content: flex-end;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #FFD600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Language Switcher */
.language-switcher {
    display: flex;
}

.lang-btn {
    padding: 6px 12px;
    background: #FFD600;
    color: #0032A0;
    border: 1px solid #0032A0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.lang-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.lang-btn.active {
    background: #0032A0;
    color: #FFD600;
}

.lang-btn:hover:not(.active) {
    background: #e6c200;
}

.lang-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
    background: #FFD600 !important;
    color: #0032A0 !important;
    border-color: #0032A0 !important;
}

.lang-btn:not(:disabled) {
    background: transparent;
    color: #FFD600;
    border-color: #FFD600;
}

.lang-btn:not(:disabled):hover {
    background: #FFD600;
    color: #0032A0;
}

/* Кнопка справки */
.faq-link {
    color: #FFD600;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #FFD600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.faq-link:hover {
    background: #FFD600;
    color: #0032A0;
}

/* Кнопка бургер-меню */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 3px;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: #FFD600;
    transition: 0.3s;
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s ease;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0032A0;
}

.mobile-menu-header h3 {
    color: #0032A0;
    font-size: 18px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #0032A0;
    cursor: pointer;
    padding: 5px;
}

.mobile-social-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: #0032A0;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.social-link:hover {
    background: #f0f8ff;
}

.social-link span {
    font-weight: 500;
}

.mobile-help-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-link-mobile {
    display: block;
    padding: 12px;
    background: #0032A0;
    color: #FFD600;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.help-link-mobile:hover {
    background: #002080;
    transform: translateY(-1px);
}

/* Оверлей для мобильного меню */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Стили для аутентификации */
#auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    background: #FFD600;
    color: #0032A0;
    border: 1px solid #FFD600;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 600;
}

.auth-btn:hover {
    background: #0032A0;
    color: #FFD600;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.auth-btn.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.auth-btn.danger:hover {
    background: #c82333;
}

.auth-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

#user-info {
    display: flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-email {
    color: #FFD600;
    font-size: 14px;
    white-space: nowrap;
}

.user-actions {
    display: flex;
    gap: 5px;
}

/* Стили для отображения плана */
.plan-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFD600;
    font-size: 14px;
    white-space: nowrap;
}

.plan-badge {
    background: #FFD600;
    color: #0032A0;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.plan-usage {
    font-weight: 500;
}

/* Основной контент */
main {
    margin: 70px 16px 70px;
    max-width: 100%;
}

/* Загрузка файла */
.file-box {
    display: block;
    width: 100%;
    padding: 28px;
    border: 2px dashed #0032A0;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #0032A0;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-box:hover {
    background: #f0f8ff;
    border-color: #0032A0;
    box-shadow: 0 4px 8px rgba(0, 50, 160, 0.2);
}

#up-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

progress {
    width: 100%;
    height: 8px;
    margin: 12px 0;
    border-radius: 4px;
}

/* Настройки */
.settings {
    margin: 24px 0;
}

/* Центрированные заголовки секций */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #0032A0;
    text-align: center;
}

/* Компактные кнопки формата вывода */
.format-buttons {
    margin-bottom: 24px;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.format-btn {
    padding: 12px 24px;
    border: 2px solid #0032A0;
    background: white;
    color: #0032A0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
}

.format-btn.active {
    background: #FFD600;
    color: #0032A0;
    border-color: #0032A0;
}

.format-btn:hover {
    background: #FFD600;
    color: #0032A0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 50, 160, 0.3);
}

/* Тумблер тайм-кодов */
.timestamps-section {
    margin-bottom: 24px;
}

.toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-container input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 160px;
    height: 44px;
    background: #f0f0f0;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #0032A0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.toggle-slider.active {
    background: #0032A0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 76px;
    height: 36px;
    background: #FFD600;
    border-radius: 18px;
    transition: all 0.3s ease;
    left: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-slider.active::before {
    transform: translateX(76px);
}

.toggle-on, .toggle-off {
    font-size: 14px;
    font-weight: 600;
    z-index: 1;
    transition: all 0.3s ease;
}

.toggle-on {
    color: #0032A0;
}

.toggle-off {
    color: #0032A0;
}

.toggle-slider.active .toggle-on {
    color: #FFD600;
}

.toggle-slider.active .toggle-off {
    color: #FFD600;
}

.toggle-slider:not(.active) .toggle-on {
    color: #FFD600;
}

.toggle-slider:not(.active) .toggle-off {
    color: #0032A0;
}

/* Кнопка извлечения текста */
.big-btn {
    width: 100%;
    padding: 20px;
    font-size: 20px;
    background: #0032A0;
    color: #FFD600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.big-btn:hover:not(:disabled) {
    background: #FFD600;
    color: #0032A0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 50, 160, 0.4);
}

.big-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

/* Результат */
textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    font-size: 16px;
    border: 2px solid #0032A0;
    border-radius: 8px;
    background: #fff;
    resize: vertical;
    color: #333;
}

/* Подвал */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,.1);
    display: flex;
    gap: 8px;
    padding: 8px;
    z-index: 1000;
    border-top: 2px solid #FFD600;
}

#copy, #download-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 600;
}

#copy {
    background: #f8f9fa;
    color: #0032A0;
    border: 1px solid #0032A0;
}

#copy:hover {
    background: #0032A0;
    color: #FFD600;
}

#download-btn {
    background: #0032A0;
    color: #FFD600;
}

#download-btn:hover {
    background: #002080;
    transform: translateY(-1px);
}

/* Стили для подвала с версией */
.version-footer {
    text-align: center;
    margin: 40px 0 20px;
    padding: 15px;
    color: #0032A0;
    font-size: 14px;
    line-height: 1.4;
    border-top: 2px solid #FFD600;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.version-footer div:first-child {
    margin-bottom: 5px;
    font-weight: 500;
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* Стили для уведомлений */
#notification-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.media2text-notification {
    background: #0032A0;
    color: #FFD600;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #FFD600;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-weight: 600;
}

.media2text-notification.show {
    transform: translateX(0);
}

.media2text-notification.success {
    background: #28a745;
    color: white;
}

.media2text-notification.error {
    background: #dc3545;
    color: white;
}

.media2text-notification.warning {
    background: #ffc107;
    color: #212529;
}

/* Стили для индикатора процесса */
.media2text-processing {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.media2text-wave-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0032A0;
    animation: media2text-wave 1.2s ease-in-out infinite both;
}

.media2text-wave-dot:nth-child(1) { animation-delay: -0.32s; }
.media2text-wave-dot:nth-child(2) { animation-delay: -0.16s; }
.media2text-wave-dot:nth-child(3) { animation-delay: 0s; }
.media2text-wave-dot:nth-child(4) { animation-delay: 0.16s; }

@keyframes media2text-wave {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.media2text-status {
    text-align: center;
    color: #0032A0;
    font-weight: 600;
    margin-top: 10px;
}

/* Стиль для кнопки в процессе обработки */
.media2text-btn-processing {
    opacity: 0.7;
    cursor: not-allowed !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .faq-link,
    .header-right .plan-info,
    .header-right #auth-section {
        display: none;
    }

    main {
        margin: 70px 12px 70px;
    }
    
    header {
        padding: 0 8px;
    }
    
    header h1 {
        font-size: 16px;
    }
    
    .file-box {
        padding: 16px;
        font-size: 14px;
    }
    
    .big-btn {
        padding: 16px;
        font-size: 16px;
    }
    
    footer {
        height: 70px;
        padding: 8px 12px;
        flex-wrap: wrap;
    }
    
    #copy, #download-btn {
        flex: 1;
        min-width: 30%;
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .format-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .toggle-slider {
        width: 140px;
        height: 40px;
    }
    
    .toggle-slider::before {
        width: 68px;
        height: 32px;
    }
    
    .toggle-slider.active::before {
        transform: translateX(68px);
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .user-menu {
        flex-direction: column;
        gap: 5px;
    }
    
    .user-actions {
        display: flex;
        gap: 5px;
    }
    
    .auth-btn.small {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .user-email {
        font-size: 12px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .plan-info {
        font-size: 12px;
    }
    
    .plan-badge {
        padding: 3px 6px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    header h1 {
        font-size: 12px;
    }
}
/* ===== CONSENT MODAL ===== */

#consent-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
}

.consent-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.consent-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 24px;
    max-width: 420px;
    width: calc(100% - 32px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    text-align: center;
}

.consent-container p {
    margin-bottom: 16px;
    font-size: 15px;
    color: #333;
}

.consent-container a {
    color: #0032A0;
    font-weight: 600;
    text-decoration: none;
}

.consent-container a:hover {
    text-decoration: underline;
}

#consent-accept-btn {
    margin-top: 12px;
    padding: 12px 20px;
    background: #0032A0;
    color: #FFD600;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

#consent-accept-btn:hover {
    background: #002080;

}
#consent-withdraw-btn {
    display: block;
    margin: 10px auto 0 auto;
    padding: 10px 16px;

    background: transparent;
    color: #0032A0;

    border: 2px solid #0032A0;
    border-radius: 8px;

    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

#consent-withdraw-btn:hover {
    background: rgba(0, 50, 160, 0.08);
}