* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Светлая тема */
    --bg-primary-light: #ffffff;
    --bg-secondary-light: #f5f5f5;
    --text-primary-light: #333333;
    --text-secondary-light: #666666;
    --accent-light: #4a90e2;
    --accent-hover-light: #357abd;
    --border-light: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.1);

    /* Темно-синяя тема */
    --bg-primary-dark-blue: #1a2332;
    --bg-secondary-dark-blue: #243447;
    --text-primary-dark-blue: #e8e8e8;
    --text-secondary-dark-blue: #b0b0b0;
    --accent-dark-blue: #5b9bd5;
    --accent-hover-dark-blue: #4a7fb8;
    --border-dark-blue: #2d3e50;
    --shadow-dark-blue: rgba(0, 0, 0, 0.3);

    /* Темная тема */
    --bg-primary-dark: #121212;
    --bg-secondary-dark: #1e1e1e;
    --text-primary-dark: #ffffff;
    --text-secondary-dark: #b0b0b0;
    --accent-dark: #bb86fc;
    --accent-hover-dark: #9d6dd9;
    --border-dark: #333333;
    --shadow-dark: rgba(0, 0, 0, 0.5);

    /* Мягкая тема */
    --bg-primary-soft: #faf8f3;
    --bg-secondary-soft: #f5f1e8;
    --text-primary-soft: #5a4a3a;
    --text-secondary-soft: #8a7a6a;
    --accent-soft: #d4a574;
    --accent-hover-soft: #c49564;
    --border-soft: #e8ddd0;
    --shadow-soft: rgba(90, 74, 58, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    padding: 20px;
}

/* Светлая тема */
body.theme-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary-light);
}

body.theme-light .container {
    background: var(--bg-primary-light);
    box-shadow: 0 10px 40px var(--shadow-light);
}

body.theme-light .upload-area {
    background: var(--bg-secondary-light);
    border-color: var(--border-light);
}

body.theme-light .btn-primary {
    background: var(--accent-light);
}

body.theme-light .btn-primary:hover {
    background: var(--accent-hover-light);
}

body.theme-light .upload-btn {
    background: var(--accent-light);
}

body.theme-light .upload-btn:hover {
    background: var(--accent-hover-light);
}

body.theme-light .progress-fill {
    background: linear-gradient(90deg, var(--accent-light), #357abd);
}

/* Темно-синяя тема */
body.theme-dark-blue {
    background: linear-gradient(135deg, #1a2332 0%, #2d3e50 100%);
    color: var(--text-primary-dark-blue);
}

body.theme-dark-blue .container {
    background: var(--bg-primary-dark-blue);
    box-shadow: 0 10px 40px var(--shadow-dark-blue);
}

body.theme-dark-blue .upload-area {
    background: var(--bg-secondary-dark-blue);
    border-color: var(--border-dark-blue);
}

body.theme-dark-blue .btn-primary {
    background: var(--accent-dark-blue);
}

body.theme-dark-blue .btn-primary:hover {
    background: var(--accent-hover-dark-blue);
}

body.theme-dark-blue .upload-btn {
    background: var(--accent-dark-blue);
}

body.theme-dark-blue .upload-btn:hover {
    background: var(--accent-hover-dark-blue);
}

body.theme-dark-blue .progress-fill {
    background: linear-gradient(90deg, var(--accent-dark-blue), #4a7fb8);
}

body.theme-dark-blue .animated-title {
    background: linear-gradient(45deg, var(--accent-dark-blue), #7bb3e8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Темная тема */
body.theme-dark {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: var(--text-primary-dark);
}

body.theme-dark .container {
    background: var(--bg-primary-dark);
    box-shadow: 0 10px 40px var(--shadow-dark);
}

body.theme-dark .upload-area {
    background: var(--bg-secondary-dark);
    border-color: var(--border-dark);
}

body.theme-dark .btn-primary {
    background: var(--accent-dark);
}

body.theme-dark .btn-primary:hover {
    background: var(--accent-hover-dark);
}

body.theme-dark .upload-btn {
    background: var(--accent-dark);
}

body.theme-dark .upload-btn:hover {
    background: var(--accent-hover-dark);
}

body.theme-dark .progress-fill {
    background: linear-gradient(90deg, var(--accent-dark), #9d6dd9);
}

body.theme-dark .animated-title {
    background: linear-gradient(45deg, var(--accent-dark), #d4a5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Мягкая тема */
body.theme-soft {
    background: linear-gradient(135deg, #faf8f3 0%, #e8ddd0 100%);
    color: var(--text-primary-soft);
}

body.theme-soft .container {
    background: var(--bg-primary-soft);
    box-shadow: 0 10px 40px var(--shadow-soft);
}

body.theme-soft .upload-area {
    background: var(--bg-secondary-soft);
    border-color: var(--border-soft);
}

body.theme-soft .btn-primary {
    background: var(--accent-soft);
}

body.theme-soft .btn-primary:hover {
    background: var(--accent-hover-soft);
}

body.theme-soft .upload-btn {
    background: var(--accent-soft);
}

body.theme-soft .upload-btn:hover {
    background: var(--accent-hover-soft);
}

body.theme-soft .progress-fill {
    background: linear-gradient(90deg, var(--accent-soft), #c49564);
}

body.theme-soft .animated-title {
    background: linear-gradient(45deg, var(--accent-soft), #e8b894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.animated-title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #4a90e2, #5b9bd5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes titleGlow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

.theme-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.theme-btn {
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.theme-btn.active {
    background: currentColor;
    color: white;
    transform: scale(1.15);
}

.upload-area {
    border: 3px dashed;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.upload-area:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.upload-area.dragover {
    border-style: solid;
    transform: scale(1.02);
    background: rgba(74, 144, 226, 0.1);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.upload-area h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.upload-area p {
    margin: 10px 0;
    opacity: 0.8;
}

.upload-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent-light);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    margin: 15px 0;
    transition: all 0.3s ease;
    text-decoration: none;
}

.upload-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.4);
}

.file-info {
    font-size: 0.9em;
    opacity: 0.7;
}

.files-list {
    margin: 30px 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: var(--bg-secondary-light);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.file-name {
    flex: 1;
    margin-right: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.file-status.pending {
    background: #ffd700;
    color: #333;
}

.file-status.processing {
    background: #4a90e2;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.file-status.success {
    background: #4caf50;
    color: white;
}

.file-status.error {
    background: #f44336;
    color: white;
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-light);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #616161;
    transform: translateY(-2px);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.progress-container {
    margin: 30px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-secondary-light);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-light), var(--accent-dark-blue));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.progress-text {
    font-weight: 600;
    font-size: 1.1em;
}

.results {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.result-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.result-item img {
    width: 100%;
    height: auto;
    display: block;
}

.result-item .download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.result-item .download-btn:hover {
    background: rgba(76, 175, 80, 1);
    transform: scale(1.1);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    opacity: 0.7;
}

/* Адаптивность */
@media (max-width: 768px) {
    .animated-title {
        font-size: 1.8em;
    }

    .container {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .results {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Применение тем */
body.theme-light .file-item {
    background: var(--bg-secondary-light);
}

body.theme-dark-blue .file-item {
    background: var(--bg-secondary-dark-blue);
}

body.theme-dark .file-item {
    background: var(--bg-secondary-dark);
}

body.theme-soft .file-item {
    background: var(--bg-secondary-soft);
}

body.theme-light .progress-bar {
    background: var(--bg-secondary-light);
}

body.theme-dark-blue .progress-bar {
    background: var(--bg-secondary-dark-blue);
}

body.theme-dark .progress-bar {
    background: var(--bg-secondary-dark);
}

body.theme-soft .progress-bar {
    background: var(--bg-secondary-soft);
}

body.theme-light footer {
    border-color: var(--border-light);
    color: var(--text-secondary-light);
}

body.theme-dark-blue footer {
    border-color: var(--border-dark-blue);
    color: var(--text-secondary-dark-blue);
}

body.theme-dark footer {
    border-color: var(--border-dark);
    color: var(--text-secondary-dark);
}

body.theme-soft footer {
    border-color: var(--border-soft);
    color: var(--text-secondary-soft);
}

/* Применение цветов текста для разных тем */
body.theme-dark-blue .upload-area h2,
body.theme-dark-blue .upload-area p,
body.theme-dark-blue .file-name {
    color: var(--text-primary-dark-blue);
}

body.theme-dark .upload-area h2,
body.theme-dark .upload-area p,
body.theme-dark .file-name {
    color: var(--text-primary-dark);
}

body.theme-soft .upload-area h2,
body.theme-soft .upload-area p,
body.theme-soft .file-name {
    color: var(--text-primary-soft);
}

body.theme-light .upload-area h2,
body.theme-light .upload-area p,
body.theme-light .file-name {
    color: var(--text-primary-light);
}

