* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #2ecc71;
    --text: #333;
    --text-light: #777;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px; /* Добавляем недостающую переменную */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--accent);
}

.back-btn {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--accent);
}

.movie-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.movie-header {
    padding: 2rem;
    background: linear-gradient(to right, #3498db, #2c3e50);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.movie-title {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitles-section {
    padding: 2rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.language-list {
    list-style: none;
}

.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.language-item:hover {
    background: #f9f9f9;
    transform: translateX(5px);
}

.language-name {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 500;
}

.language-flag {
    width: 30px;
    height: 20px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--secondary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-accent {
    background: var(--accent);
}

.btn-accent:hover {
    background: #c0392b;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.subtitle-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.subtitle-table th,
.subtitle-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.subtitle-table th {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.subtitle-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subtitle-table tr:hover {
    background-color: #f1f1f1;
}

.controls {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    align-items: center;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.movies-list {
    list-style: none;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.movies-list li {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.movies-list li:last-child {
    border-bottom: none;
}

.movies-list li:hover {
    background: #f9f9f9;
    padding-left: 2rem;
}

.movies-list a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 1.1rem;
    display: block;
    transition: var(--transition);
}

.movies-list a:hover {
    color: var(--secondary);
}

.upload-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 2rem auto;
}

.error-message {
    background: #ffecec;
    color: #e74c3c;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    border-left: 4px solid #e74c3c;
}

/* Стили из HTML файла - НАЧАЛО */
.translation-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.language-form {
    display: contents;
}

.language-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-family: inherit;
    position: relative;
}

.language-btn:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.language-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.language-btn.loading {
    cursor: wait;
}

.language-flag {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.language-name {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.language-native {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.movie-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.subtitles-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Стили для индикатора загрузки */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.loading-description {
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.loading-note {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}
/* Стили из HTML файла - КОНЕЦ */

@media (max-width: 768px) {
    .movie-header {
        padding: 1.5rem;
    }

    .movie-title {
        font-size: 2rem;
    }

    .language-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .language-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .language-grid {
        grid-template-columns: 1fr;
    }
}