/* ==================== ОБЩИЕ СТИЛИ ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f6df5;
    --primary-dark: #3a56d6;
    --secondary-color: #764ba2;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --info-color: #2196F3;
    --light-bg: #f8f9ff;
    --light-border: #e0e0e0;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #888;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* RTL Support */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .header-content h1 i,
body.rtl .section-header h3 i,
body.rtl .info-tab i,
body.rtl .footer-section h4 i,
body.rtl .queue-item .file-info,
body.rtl .stat-item,
body.rtl .features-list li,
body.rtl .footer-links a,
body.rtl .history-header {
    flex-direction: row-reverse;
}

body.rtl .toggle-label {
    flex-direction: row-reverse;
}

body.rtl .image-overlay {
    left: 10px;
    right: auto;
}

body.rtl .btn-recognize .btn-badge {
    left: -8px;
    right: auto;
}

body.rtl .result-tools {
    left: 10px;
    right: auto;
}

body.rtl .queue-info {
    border-left: none;
    border-right: 4px solid var(--warning-color);
}

body.rtl .notification {
    border-left: none;
    border-right: 4px solid transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    direction: ltr;
    text-align: left;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ==================== ЗАГОЛОВОК ==================== */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px 30px;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.header-content h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-content h1 i {
    margin-right: 10px;
}

body.rtl .header-content h1 i {
    margin-right: 0;
    margin-left: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    text-align: center;
}

.header-controls {
    margin-top: 15px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

/* ==================== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ ==================== */
.language-switcher {
    position: relative;
    display: inline-block;
}

.language-switcher button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: space-between;
}

.language-switcher button i.fa-chevron-down {
    font-size: 0.8rem;
    transition: var(--transition);
}

.language-switcher button:hover i.fa-chevron-down {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    margin-top: 5px;
    border: 1px solid var(--light-border);
}

body.rtl .language-dropdown {
    left: auto;
    right: 0;
}

.language-dropdown.hidden {
    display: none;
}

.language-search {
    padding: 12px 15px;
    border-bottom: 1px solid var(--light-border);
    background: var(--light-bg);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.language-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--light-border);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.language-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 109, 245, 0.1);
}

.language-list {
    padding: 10px 0;
    max-height: 350px;
    overflow-y: auto;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--light-border);
}

.language-item:last-child {
    border-bottom: none;
}

.language-item:hover {
    background: var(--light-bg);
}

.language-item.active {
    background: rgba(79, 109, 245, 0.1);
    border-left: 3px solid var(--primary-color);
}

body.rtl .language-item.active {
    border-left: none;
    border-right: 3px solid var(--primary-color);
}

.language-flag {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.language-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.language-name-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ==================== ОСНОВНАЯ ОБЛАСТЬ ==================== */
main {
    padding: 25px;
}

/* ==================== ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМОВ ==================== */
.mode-toggle {
    background: var(--light-bg);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin: 20px 0;
    border: 2px solid var(--light-border);
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 10px 20px;
    background: white;
    border-radius: 50px;
    border: 2px solid var(--light-border);
    transition: var(--transition);
}

.toggle-label:hover {
    border-color: var(--primary-color);
}

.toggle-handle {
    width: 40px;
    height: 20px;
    background: #ddd;
    border-radius: 20px;
    position: relative;
    transition: var(--transition);
}

.toggle-handle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-input:checked + .toggle-label .toggle-handle {
    background: var(--primary-color);
}

.toggle-input:checked + .toggle-label .toggle-handle::after {
    transform: translateX(20px);
}

.toggle-text {
    display: flex;
    gap: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-option {
    transition: var(--transition);
}

.toggle-input:not(:checked) + .toggle-label .toggle-option:first-child,
.toggle-input:checked + .toggle-label .toggle-option:last-child {
    color: var(--primary-color);
}

.toggle-description {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* ==================== ОБЛАСТЬ ЗАГРУЗКИ ==================== */
.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: var(--border-radius-md);
    padding: 50px 20px;
    text-align: center;
    margin: 25px 0;
    transition: var(--transition);
    background: var(--light-bg);
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    background: #eef1ff;
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.upload-area.drag-over {
    background: #e3f2fd;
    border-color: #2196f3;
    border-style: solid;
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: var(--transition);
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
}

.upload-area h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.upload-area p {
    margin: 10px 0;
    color: var(--text-secondary);
}

.formats {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.max-size {
    color: var(--warning-color);
    font-weight: 500;
}

/* ==================== ОЧЕРЕДЬ ФАЙЛОВ ==================== */
.queue-section {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin: 25px 0;
    border: 2px solid var(--light-border);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-border);
}

body.rtl .section-header {
    flex-direction: row-reverse;
}

.section-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.queue-stats {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.queue-container {
    margin: 15px 0;
}

.queue-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.queue-item:hover {
    border-color: var(--primary-color);
    background: white;
}

.queue-item .file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.queue-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.queue-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.queue-empty p {
    font-size: 0.95rem;
}

.queue-controls {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

.queue-info {
    background: #fff9e6;
    border-radius: var(--border-radius-sm);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--warning-color);
    font-size: 0.9rem;
    border-left: 4px solid var(--warning-color);
}

body.rtl .queue-info {
    border-left: none;
    border-right: 4px solid var(--warning-color);
}

.queue-info i {
    font-size: 1.1rem;
}

/* ==================== ПРЕДПРОСМОТР ==================== */
.preview-section {
    margin: 30px 0;
    animation: fadeIn 0.5s ease;
}

.file-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.preview-container {
    border: 2px solid var(--light-border);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-top: 15px;
    background: #fafafa;
}

.image-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius-sm);
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.rtl .image-overlay {
    left: 10px;
    right: auto;
}

.image-wrapper:hover .image-overlay {
    opacity: 1;
}

.btn-overlay {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-overlay:hover {
    background: white;
    transform: scale(1.1);
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--light-border);
}

.control-group {
    display: flex;
    gap: 10px;
}

/* ==================== КНОПКИ ==================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 109, 245, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 20px;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: 2px solid var(--success-color);
}

.btn-success:hover {
    background: #388E3C;
    border-color: #388E3C;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 2px solid var(--danger-color);
}

.btn-danger:hover {
    background: #D32F2F;
    border-color: #D32F2F;
}

.btn-tag {
    background: var(--light-bg);
    color: var(--text-primary);
    border: 1px solid var(--light-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-tool {
    background: transparent;
    border: 1px solid var(--light-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-tool:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-social {
    background: var(--light-bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.btn-social:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-recognize {
    position: relative;
    padding: 16px 45px;
}

.btn-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

body.rtl .btn-badge {
    left: -8px;
    right: auto;
}

/* ==================== НАСТРОЙКИ ==================== */
.settings {
    background: var(--light-bg);
    padding: 25px;
    border-radius: var(--border-radius-md);
    margin: 30px 0;
    border: 2px solid var(--light-border);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item > label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.hint {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

body.rtl .hint {
    margin-left: 0;
    margin-right: auto;
}

.language-select {
    padding: 12px 15px;
    border: 2px solid var(--light-border);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
    cursor: pointer;
}

.language-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 109, 245, 0.1);
}

.quick-languages {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--light-border);
    cursor: pointer;
    transition: var(--transition);
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.radio-option input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-border);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: var(--transition);
}

.radio-option input:checked + .radio-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-option input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.radio-label strong {
    font-weight: 600;
    color: var(--text-primary);
}

.radio-label small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.checkbox-option input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-border);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition);
}

.checkbox-option:hover .checkbox-custom {
    border-color: var(--primary-color);
}

.checkbox-option input:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-option input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ==================== ПРОГРЕСС БАР ==================== */
.action-section {
    margin: 35px 0;
    text-align: center;
}

.progress-container {
    margin-top: 20px;
}

.progress {
    height: 12px;
    background: var(--light-border);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.4s ease;
    position: relative;
}

.progress-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==================== ИСТОРИЯ ==================== */
.history-section {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 25px;
    margin: 30px 0;
    border: 2px solid var(--light-border);
    box-shadow: var(--shadow-sm);
}

.history-container {
    margin-top: 15px;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.history-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.history-empty p {
    font-size: 0.95rem;
}

.history-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 18px;
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
    animation: slideIn 0.5s ease;
}

.history-item:hover {
    border-color: var(--primary-color);
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-header strong {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-header small {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 10px;
    flex-shrink: 0;
}

body.rtl .history-header small {
    margin-left: 0;
    margin-right: 10px;
}

.history-text {
    padding: 12px;
    background: white;
    border-radius: var(--border-radius-sm);
    margin: 10px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-height: 80px;
    overflow-y: auto;
    border: 1px solid var(--light-border);
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.85rem;
}

.history-footer span:first-child {
    color: var(--primary-color);
    font-weight: 500;
}

.history-footer span:nth-child(2) {
    color: var(--text-muted);
}

/* ==================== РЕЗУЛЬТАТ ==================== */
.result-section {
    margin: 40px 0;
    animation: fadeIn 0.5s ease;
}

.result-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    flex-wrap: wrap;
    gap: 15px;
}

.format-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.format-select select {
    padding: 8px 12px;
    border: 2px solid var(--light-border);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
}

.result-content {
    position: relative;
    margin: 20px 0;
}

#resultText {
    width: 100%;
    height: 350px;
    padding: 20px;
    border: 2px solid var(--light-border);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    background: #fafafa;
    font-family: 'Courier New', monospace, 'Segoe UI Emoji', 'Segoe UI Symbol';
    color: var(--text-primary);
    transition: var(--transition);
}

#resultText:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.result-tools {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.rtl .result-tools {
    left: 10px;
    right: auto;
}

.result-content:hover .result-tools {
    opacity: 1;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--light-border);
}

.stats {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.stat-item span {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==================== ИНФОРМАЦИЯ ==================== */
.info-section {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 25px;
    margin: 30px 0;
    border: 2px solid var(--light-border);
    box-shadow: var(--shadow-sm);
}

.info-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-border);
}

.info-tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.info-tab:hover {
    color: var(--primary-color);
    background: var(--light-bg);
}

.info-tab.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.tip-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--light-border);
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.tip-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: white;
    font-size: 1.5rem;
}

.tip-card h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.features-list {
    list-style: none;
}

.features-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--light-border);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list i {
    color: var(--success-color);
    margin-top: 3px;
    flex-shrink: 0;
}

.features-list strong {
    color: var(--text-primary);
}

.faq-item {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--light-border);
}

.faq-item h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== ФУТЕР ==================== */
footer {
    background: var(--light-bg);
    padding: 30px;
    color: var(--text-secondary);
    border-top: 1px solid var(--light-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section p {
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

body.rtl .footer-links a:hover {
    transform: translateX(-5px);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--light-border);
    font-size: 0.9rem;
}

.footer-tech {
    margin-top: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.version {
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==================== УВЕДОМЛЕНИЯ ==================== */
#notificationsContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.rtl #notificationsContainer {
    left: 20px;
    right: auto;
}

.notification {
    padding: 15px 20px;
    border-radius: var(--border-radius-sm);
    background: white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    border-left: 4px solid transparent;
}

body.rtl .notification {
    border-left: none;
    border-right: 4px solid transparent;
}

.notification-success {
    border-left-color: var(--success-color);
}

body.rtl .notification-success {
    border-right-color: var(--success-color);
}

.notification-error {
    border-left-color: var(--danger-color);
}

body.rtl .notification-error {
    border-right-color: var(--danger-color);
}

.notification-info {
    border-left-color: var(--info-color);
}

body.rtl .notification-info {
    border-right-color: var(--info-color);
}

.notification-warning {
    border-left-color: var(--warning-color);
}

body.rtl .notification-warning {
    border-right-color: var(--warning-color);
}

.language-notification {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

body.rtl .language-notification {
    animation: slideInLeft 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.notification i {
    font-size: 1.3rem;
}

.notification-success i {
    color: var(--success-color);
}

.notification-error i {
    color: var(--danger-color);
}

.notification-info i {
    color: var(--info-color);
}

.notification-warning i {
    color: var(--warning-color);
}

/* ==================== АНИМАЦИИ ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

body.rtl @keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* ==================== ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ ==================== */
.hidden {
    display: none !important;
}

/* ==================== АДАПТИВНОСТЬ ==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: var(--border-radius-md);
    }
    
    header {
        padding: 20px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .result-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
    
    .queue-controls {
        flex-direction: column;
    }
    
    .queue-controls button {
        width: 100%;
    }
    
    .preview-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .language-switcher {
        width: 100%;
    }
    
    .language-switcher button {
        width: 100%;
    }
    
    .language-dropdown {
        width: 100%;
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
        max-height: 70vh;
    }
    
    body.rtl .language-dropdown {
        left: 0;
        right: 0;
    }
    
    .language-dropdown:not(.hidden) {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .info-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 14px 30px;
        font-size: 1rem;
    }
    
    .history-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==================== УБИРАЕМ РАМКУ В НАСТРОЙКАХ ==================== */

/* Убираем стандартную рамку браузера у fieldset в настройках */
.settings-grid fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px 0;
    background: none;
}

/* Стили для легенды (заголовка) в настройках */
.settings-grid legend {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Убираем подпись "Буквальный режим: Ctrl+L" если она есть в поле */
.mode-hint {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}