/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --info-color: #3b82f6;
    --info-dark: #2563eb;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;

    --border-color: #e5e7eb;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box .logo {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.login-box .logo i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.login-box .logo h1 {
    color: white;
    font-size: 1.75rem;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.login-form {
    padding: 2.5rem 2rem;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.75rem;
}

/* Alert messages */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--secondary-color);
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input:hover {
    border-color: var(--primary-light);
}

.login-form .btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.875rem;
    font-size: 1.1rem;
}

/* Demo credentials */
.demo-credentials {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.demo-credentials h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.demo-credentials p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.demo-credentials strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-light);
}

.btn-remove {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
}

.btn-remove:hover {
    background: #fee2e2;
    color: var(--danger-color);
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-links a.active {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.logout-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.logout-btn:hover {
    background: #fee2e2;
    color: var(--danger-color);
}

/* ===== STEP SECTIONS ===== */
.step-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.step-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--text-primary);
}

/* ===== UPLOAD SECTION ===== */
.upload-box {
    margin-top: 1rem;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary-light);
    background: #f0f9ff;
}

.upload-area.highlight {
    border-color: var(--primary-color);
    background: #e0f2fe;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.upload-area h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

#fileInput {
    display: none;
}

/* ===== FILE INFO ===== */
.file-info {
    animation: slideIn 0.3s ease;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.file-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon i {
    font-size: 2rem;
    color: white;
}

.file-details {
    flex: 1;
}

.file-details h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.file-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===== API STATUS ===== */
.api-status {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.status-indicator.success {
    color: var(--secondary-dark);
}

.status-indicator.error {
    color: var(--danger-color);
}

.status-indicator i {
    font-size: 1.25rem;
}

.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== TRANSCRIPTION PROGRESS ===== */
.transcription-progress {
    animation: fadeIn 0.5s ease;
}

.progress-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.progress-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-message {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    min-height: 24px;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.detail-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.detail-item span {
    color: var(--text-secondary);
}

.detail-item span span {
    color: var(--text-primary);
    font-weight: 600;
}

.transcription-controls {
    display: flex;
    justify-content: center;
}

/* ===== RESULT SECTION ===== */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.result-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    flex: 1;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.meta-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.meta-item div {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.meta-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.text-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text-primary);
}

.text-tools {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.result-text {
    padding: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

.placeholder-text {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 3rem;
}

.error-text {
    text-align: center;
    color: var(--danger-color);
    padding: 3rem;
}

.error-text i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.text-paragraph {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: justify;
}

.paragraph-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
    opacity: 0.5;
}

.empty-text {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 3rem;
}

/* ===== INFO SECTION ===== */
.info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.card-icon i {
    font-size: 2.5rem;
    color: white;
}

.info-card h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ===== NOTIFICATIONS ===== */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--info-color);
    position: relative;
    overflow: hidden;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification i {
    font-size: 1.25rem;
}

.notification span {
    flex: 1;
    color: var(--text-primary);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.notification-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.notification-success {
    border-left-color: var(--secondary-color);
}

.notification-success i {
    color: var(--secondary-color);
}

.notification-error {
    border-left-color: var(--danger-color);
}

.notification-error i {
    color: var(--danger-color);
}

.notification-warning {
    border-left-color: var(--warning-color);
}

.notification-warning i {
    color: var(--warning-color);
}

.notification-info {
    border-left-color: var(--info-color);
}

.notification-info i {
    color: var(--info-color);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

/* ===== СТИЛИ ДЛЯ ИСТОРИИ ===== */
.header {
    margin: 2rem 0;
    text-align: center;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.history-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 95%; /* Растягиваем на всю ширину */
    margin-left: auto;
    margin-right: auto;
}

.history-table {
    overflow-x: auto;
    width: 100%;
}

.history-table table {
    width: 100%;
    min-width: 1200px; /* Минимальная ширина таблицы */
    border-collapse: collapse;
    margin-top: 1rem;
}

/* ЧЕРЕДОВАНИЕ ЦВЕТОВ СТРОК - РАБОТАЕТ НА ВСЕХ ЭКРАНАХ */
.history-table tbody tr:nth-child(even) {
    background-color: #f9fafb !important; /* Светло-серый для четных строк */
}

.history-table tbody tr:nth-child(odd) {
    background-color: #ffffff !important; /* Белый для нечетных строк */
}

.history-table tbody tr:hover {
    background-color: #f0f9ff !important; /* Голубой при наведении */
    transition: background-color 0.2s ease;
}

.history-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 1.2rem 0.8rem;
    text-align: left;
    font-weight: 600;
    border: none;
    font-size: 0.95rem;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    min-width: 120px;
}

/* НАСТРАИВАЕМ ШИРИНЫ КОЛОНОК - АДАПТИВНЫЕ */
.history-table td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.95rem;
    word-break: break-word;
}

/* КОЛОНКА "ДАТА" */
.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 140px;
    min-width: 120px;
}

/* КОЛОНКА "НАЗВАНИЕ" - ДЕЛАЕМ ШИРЕ */
.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 280px;
    min-width: 250px;
    max-width: 350px;
}

/* КОЛОНКА "ДЛИТЕЛЬНОСТЬ" */
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    width: 110px;
    min-width: 100px;
}

/* КОЛОНКА "РАЗМЕР" */
.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    width: 100px;
    min-width: 90px;
}

/* КОЛОНКА "ПРЕДПРОСМОТР" */
.history-table th:nth-child(5),
.history-table td:nth-child(5) {
    width: 200px;
    min-width: 180px;
    max-width: 250px;
}

/* КОЛОНКА "СТАТУС АНАЛИЗА" */
.history-table th:nth-child(6),
.history-table td:nth-child(6) {
    width: 150px;
    min-width: 130px;
}

/* КОЛОНКА "ДЕЙСТВИЯ" */
.history-table th:nth-child(7),
.history-table td:nth-child(7) {
    width: 400px;
    min-width: 350px;
}

.history-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* Кнопки ОДИНАКОВОГО размера и стиля */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-width: 70px;
    height: 32px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Цвета кнопок */
.btn-text {
    background: #3b82f6;
    color: white;
}

.btn-text:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(37, 99, 235, 0.2);
}

.btn-analyze {
    background: #8b5cf6;
    color: white;
}

.btn-analyze:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(139, 92, 246, 0.2);
}

.btn-result {
    background: #10b981;
    color: white;
}

.btn-result:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(16, 185, 129, 0.2);
}

.btn-download {
    background: #f59e0b;
    color: white;
}

.btn-download:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(245, 158, 11, 0.2);
}

.btn-archive {
    background: #ef4444;
    color: white;
}

.btn-archive:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(239, 68, 68, 0.2);
}

.btn-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    background: #e5e7eb;
    transform: none;
    box-shadow: none;
}

.analysis-badge {
    background: #10b981;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.no-analysis-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.text-preview {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #475569;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Стили для редактирования названия */
.filename-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filename-text {
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
    font-size: 0.9rem;
}

.edit-filename-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.edit-filename-btn:hover {
    opacity: 1;
    color: var(--primary-color);
    background: #f3f4f6;
}

.empty-history {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-history i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.empty-history h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.empty-history p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Стили для модального окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1.25rem;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: #6b7280;
}

.form-hint {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-footer .btn {
    min-width: 140px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .modal {
        width: 95%;
        margin: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .login-container {
        padding: 15px;
    }

    .login-box {
        max-width: 100%;
        margin: 0 15px;
    }

    .login-box .logo {
        padding: 2rem 1.5rem;
    }

    .login-box .logo h1 {
        font-size: 1.5rem;
    }

    .login-form {
        padding: 2rem 1.5rem;
    }

    .login-form h2 {
        font-size: 1.5rem;
    }

    .demo-credentials {
        padding: 1.25rem;
    }

    /* Navigation */
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 15px;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-links a {
        flex: 1;
        justify-content: center;
        min-width: 110px;
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.375rem;
    }

    .step-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }

    .upload-area {
        padding: 3rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .file-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .file-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .upload-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .progress-percent {
        font-size: 1.75rem;
    }

    .progress-details {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
    }

    .result-meta {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .result-actions {
        width: 100%;
        justify-content: center;
    }

    .result-actions .btn {
        flex: 1;
        min-width: 140px;
    }

    .text-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .text-tools {
        align-self: flex-end;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .notification-container {
        left: 15px;
        right: 15px;
        max-width: none;
    }

    /* История на мобильных */
    .history-section {
        padding: 1rem;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .history-table {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .history-table table {
        min-width: 1000px;
    }

    .history-table th {
        padding: 0.8rem 0.6rem;
        font-size: 0.85rem;
    }

    .history-table td {
        padding: 0.8rem 0.6rem;
        font-size: 0.85rem;
    }

    .action-btn {
        min-width: 40px;
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
        height: 28px;
    }

    .action-btn span {
        display: none;
    }

    .action-btn i {
        margin-right: 0;
        font-size: 0.8rem;
    }

    .analysis-badge,
    .no-analysis-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    .legend {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .step-section {
        padding: 1rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .progress-container {
        padding: 1.5rem;
    }

    .result-text {
        padding: 1.5rem;
    }

    .nav-links a {
        min-width: 90px;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .login-box .logo h1 {
        font-size: 1.3rem;
    }

    .login-form h2 {
        font-size: 1.3rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .upload-box,
    .transcription-progress,
    .result-actions,
    .info-section,
    .notification-container {
        display: none !important;
    }

    .step-section {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .result-text {
        max-height: none;
        overflow: visible;
    }

    body {
        background: white;
        color: black;
    }
}