/* 🌍 Основные стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    background: var(--bg-light);
    color: var(--text);
    text-align: center;
    padding: 2rem;
    margin: 0;
    transition: background 0.3s, color 0.3s;
}

/* Темы по Люшеру */
:root[data-theme='blue'] {
    --primary: #007bff;
    --hover: #0056b3;
    --bg-light: #f0f8ff;
    --drop-border: #007bff;
    --drop-hover: rgba(0, 123, 255, 0.1);
    --drop-text: #007bff;
    --border: #007bff;
    --text: #333;
    --label-color: #664d03;
    --option-bg: #fffbea;
    --option-color: #333;
    --progress-bg: #d0e7ff;
}

:root[data-theme='green'] {
    --primary: #28a745;
    --hover: #1c7c34;
    --bg-light: #e6f5eb;
    --drop-border: #28a745;
    --drop-hover: rgba(40, 167, 69, 0.1);
    --drop-text: #28a745;
    --border: #28a745;
    --text: #333;
    --progress-bg: #c7f3d8;
}

:root[data-theme='red'] {
    --primary: #dc3545;
    --hover: #a71d2a;
    --bg-light: #fbeaea;
    --drop-border: #dc3545;
    --drop-hover: rgba(220, 53, 69, 0.1);
    --drop-text: #dc3545;
    --border: #dc3545;
    --text: #333;
    --progress-bg: #f8c9cd;
}

:root[data-theme='gold'] {
    --primary: #ffc107;
    --hover: #cc9c00;
    --bg-accent: #fff8dc;
    --drop-border: #ffc107;
    --drop-hover: rgba(255, 193, 7, 0.1);
    --drop-text: #856404;
    --bg-light: #fffdf5;
    --border: #ffc107;
    --text: #333;
    --progress-bg: #fff3cd;
}

:root[data-theme='purple'] {
    --primary: #6f42c1;
    --hover: #532c9c;
    --bg-accent: #f6f0fa;
    --drop-border: #6f42c1;
    --drop-hover: rgba(111, 66, 193, 0.12);
    --drop-text: #3d1a6f;
    --bg-light: #fdf7ff;
    --border: #6f42c1;
    --text: #2b2b2b;
    --progress-bg: #e9d7fa;
}

:root[data-theme='skyblue'] {
    --primary: linear-gradient(135deg, #7fbcff, #4a91e2);
    --hover: linear-gradient(135deg, #5caeff, #2b7bd2);
    --drop-border: #4a91e2;
    --drop-hover: rgba(74, 145, 226, 0.12);
    --drop-text: #2a4d8c;
    --bg-light: #f0f8ff;
    --text: #222;
    --border: #4a91e2;
    --progress-bg: #e0f1ff;
}

:root[data-theme='mintgreen'] {
    --primary: linear-gradient(135deg, #a8edea, #61e294);
    --hover: linear-gradient(135deg, #85dbcc, #4dbf81);
    --drop-border: #61e294;
    --drop-hover: rgba(97, 226, 148, 0.1);
    --drop-text: #1b4f3a;
    --bg-light: #f5fffb;
    --text: #2b2b2b;
    --border: #61e294;
    --progress-bg: #dbfef1;
}

:root[data-theme='sunset'] {
    --primary: linear-gradient(135deg, #ffb88c, #de6262);
    --hover: linear-gradient(135deg, #f88e6b, #c24e4e);
    --drop-border: #de6262;
    --drop-hover: rgba(222, 98, 98, 0.12);
    --drop-text: #802f2f;
    --bg-light: #fff5f2;
    --text: #2f2f2f;
    --border: #de6262;
    --progress-bg: #ffe0d9;
}

:root[data-theme='business-navy'] {
    --primary: linear-gradient(135deg, #4b6cb7, #182848);
    --hover: linear-gradient(135deg, #3f5db5, #12213b);
    --drop-border: #4b6cb7;
    --drop-hover: rgba(75, 108, 183, 0.1);
    --drop-text: #12213b;
    --bg-light: #eef1f7;
    --text: #1a1a1a;
    --border: #4b6cb7;
    --progress-bg: #dce4f4;
}

:root[data-theme='edu-peach'] {
    --primary: linear-gradient(135deg, #ffecd2, #fcb69f);
    --hover: linear-gradient(135deg, #ffe0b2, #f89b82);
    --drop-border: #fcb69f;
    --drop-hover: rgba(252, 182, 159, 0.15);
    --drop-text: #a64c2e;
    --bg-light: #fffaf5;
    --text: #333;
    --border: #fcb69f;
    --progress-bg: #ffe8dd;
}

/* 📦 Контейнер */
.container {
    background: white;
    max-width: 640px;
    margin: auto;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.top-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 1.5rem;
    color: var(--text);
    margin: 0;
}

.language-container {
    position: relative;
    margin-top: 1rem;
}

.toggle-lang {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-lang:hover {
    background: var(--hover);
}

.lang-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    width: 220px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: opacity 0.3s ease, transform 0.3s ease;
    top: 100%;
    left: 0;
}

.lang-dropdown.open {
    display: block;
    opacity: 1;
    transform: scaleY(1);
}

.lang-btn {
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text);
}

.lang-btn:hover {
    background: #f0f0f0;
}

.upload-box {
    width: 100%;
    box-sizing: border-box;
    border: 2px dashed var(--drop-border);
    border-radius: 10px;
    padding: 30px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    background: var(--bg-light);
    color: var(--drop-text);
}

.upload-box:hover {
    background: var(--drop-hover);
    border-color: var(--hover);
}

.upload-box.disabled {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease-in-out;
}

.upload-box p {
    margin: 0;
    font-size: 16px;
    color: inherit;
}

.upload-box input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    border-radius: 6px;
    width: 100%;
    margin-top: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: var(--hover);
}

.file-download {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.file-download:hover {
    background: var(--hover);
}

/* 🏷️ Метка */
label[for="compressionMethod"] {
    display: block;
    text-align: left;
    margin: 15px 0 5px;
    font-weight: bold;
    color: var(--label-color, #333); /* 🔧 Управляется темой */
}

/* 🔽 Селектор */
#compressionMethod {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid var(--border, #007bff);
    border-radius: 6px;
    background: var(--bg-light, #f5f5f5);
    color: var(--text, #333);
    transition: border 0.3s, background 0.3s;
    outline: none;
}

/* 🎨 Стили для option */
#compressionMethod option {
    background: var(--option-bg, #fff);
    color: var(--option-color, #333);
}

.theme-btn.skyblue {
    background-image: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
    border: none;
}

.theme-btn.mintgreen {
    background-image: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
}

.theme-btn.sunset {
    background-image: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
    border: none;
}

.theme-btn.business-navy {
    background-image: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
    border: none;
}

.theme-btn.edu-peach {
    background-image: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: none;
}
/* Обёртка прогресс-бара */
.progress {
    height: 10px;
    width: 100%;
    background: var(--progress-bg, #e0e0e0); /* Цвет фона можно переопределить в теме */
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

/* Сам прогресс-блок */

.progress {
    height: 10px;
    width: 100%;
    background: var(--progress-bg, #e0e0e0);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

/* Основной бар */
.progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary);
    border-radius: 6px 0 0 6px;
    transition: width 0.5s ease-in-out;
}

/* Анимация во время загрузки */
.progress-bar.loading {
    animation: progressGradient 1s linear infinite;
    background: linear-gradient(
            135deg,
            var(--primary) 25%,
            rgba(255, 255, 255, 0.3) 50%,
            var(--primary) 75%
    );
    background-size: 200% 100%;
}

/* Движение градиента */
@keyframes progressGradient {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Отступ между кнопкой и списком файлов */
#fileContainer {
    margin-top: 1.5rem;
}

/* Каждая загрузка/карточка */
.file-entry {
    margin-bottom: 1.5rem;
}

/* Карточка файла */
.file-card {
    background: var(--bg-light, #f9f9f9);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    text-align: left;
    color: var(--text);
}

/* Название файла */
.file-card .file-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Инфострока */
.file-info-row {
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: var(--text);
}

/* Ссылка на скачивание */
.file-card .file-download {
    display: inline-block;
    margin-top: 10px;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
}

.file-card .file-download:hover {
    background: var(--hover);
}
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0px 0 var(--primary);
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 20px 6px var(--primary);
        transform: scale(1.03);
        filter: brightness(1.2);
    }
    100% {
        box-shadow: 0 0 0px 0 var(--primary);
        transform: scale(1);
        filter: brightness(1);
    }
}

.upload-btn.attention {
    animation: pulseGlow 1.5s ease-in-out infinite;
    transition: all 0.3s ease-in-out;
}