/* Переменные для цветов и градиентов */
:root {
    --gold-gradient: linear-gradient(45deg, #FFD700, #FFA500);
    --text-color-dark: #000;
    --text-color-light: #fff;
    --background-color-dark: #000;
    --shadow-light: rgba(0,0,0,0.3);
    --shadow-dark: rgba(0,0,0,0.4);

    /* Переменные для статусов */
    --status-pending-color: #ffa500; /* Оранжевый */
    --status-completed-color: #28a745; /* Зеленый */
    --status-error-color: #dc3545; /* Красный */
    --status-info-color: #17a2b8; /* Сине-зеленый */
}

/* Общие сбросы и базовые стили */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background: var(--background-color-dark);
    color: var(--text-color-light);
    scroll-behavior: smooth;
    overflow-x: hidden; /* Предотвращает горизонтальную прокрутку */
}

/* Анимация появления страницы */
body.fade-in {
    animation: fadeIn 2s ease-in forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; background: var(--background-color-dark); }
    100% { opacity: 1; background: var(--background-color-dark); }
}

/* Класс для скрытия элементов визуально, но сохранения для скрин-ридеров */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Стили для стартового экрана (index.html) - макет --- */
.start-screen {
    height: 100dvh;
    background: url('../assets/image-bkgr.jpeg') center/cover no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
    position: relative;
    text-align: center;
}

/* Медиа-запросы для стартового экрана */
@media(max-width: 600px) {
    .start-screen {
        justify-content: flex-end;
        padding-bottom: 4rem;
    }
}

@media(min-width: 601px) {
    .start-screen {
        justify-content: center;
    }
}

/* Стили для заголовка (общий заголовок приложения) */
h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px var(--shadow-dark);
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Медиа-запросы для адаптивности h1 */
@media(max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
}

@media(max-width: 400px) {
    h1 {
        font-size: 1.8rem;
    }
}

/* --- Стили для upload.html и results.html (общий фон и общая структура) --- */
.background {
    min-height: 100dvh;
    background: url('../assets/image-bkgr.jpeg') center/cover no-repeat;
    background-size: cover;
    position: relative;
    z-index: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #fff;
}

/* Псевдоэлемент для затемнения фонового изображения */
.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Заголовок внутри секций (например, на upload.html) */
.background h3 { 
    font-size: 1.8rem;
    color: #FFD700;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    text-align: center;
}

/* Форма для социальных сетей (layout для формы на upload.html) */
.social-form { 
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 400px;
}

.social-form input[type="text"],
.social-form input[type="email"] { 
    padding: 0.8rem 1.2rem;
    border: 1px solid #555;
    border-radius: 25px;
    background: #2a2a2a;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.social-form input[type="text"]:focus,
.social-form input[type="email"]:focus { 
    border-color: #FFD700;
}

/* Стиль для поля ввода при ошибке */
.social-form input[style*="border-color: red"] { 
    border-color: red !important;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* Центрирование группы кнопок (layout на upload.html) */
.button-center-group { 
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
}

/* Секция для предварительного просмотра выбранных файлов (layout на upload.html) */
.selected-files-preview-section {
    width: 100%;
    max-width: 1200px; 
    margin: 2rem auto; 
    padding: 1rem;
    text-align: center; 
}

.selected-files-preview-section h2 {
    font-size: 2rem;
    color: #FFD700; 
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

/* Контейнер для пузырей внутри секции предпросмотра (layout на upload.html) */
#selectedFilesPreviewContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem 0;
}

/* --- Стили для results.html (макет) --- */
.header-section {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 2rem;
    width: 100%;
    max-width: 800px;
}

.header-section h1 { /* Переопределение h1 для results.html, чтобы был золотой цвет */
    font-size: 2.5rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 8px var(--shadow-dark);
}

.header-section p {
    font-size: 1.2rem;
    color: #E0E0E0;
    margin-top: 0.5rem;
}

#uploadNewBtn { /* results.html */
    margin-top: 1.5rem;
    animation: none; 
}

/* Контейнер для динамического статуса дозагрузки на results.html */
.dynamic-upload-status-section {
    width: 100%;
    max-width: 600px;
    margin: 1rem auto 2rem auto; 
    padding: 1rem;
    background: rgba(34, 34, 34, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    text-align: center;
}

.dynamic-upload-status-section .status-message {
    margin-bottom: 0.5rem;
}

/* Контейнер для controls на results.html (макет) */
.concatenation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; 
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Стиль для контейнера статуса объединения (компонент-подобный, но специфичен для макета) */
.concatenation-status {
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: bold;
}

/* --- Медиа-запросы для results.html (адаптивность макета) --- */
@media (max-width: 768px) {
    .header-section h1 {
        font-size: 2.5rem;
    }
    .header-section p {
        font-size: 1.1rem;
    }
    .concatenation-controls {
        flex-direction: column;
        gap: 1rem;
    }
    #processSelectedVideosButton {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .header-section h1 {
        font-size: 2rem;
    }
    .header-section p {
        font-size: 1rem;
    }
}
