* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --error: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.upload-box {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-box:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.upload-box.dragover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    border-style: solid;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-box h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-box p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

#fileInput {
    display: none;
}

.supported-formats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.processing-card,
.result-card,
.error-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.processing-card p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: 30px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.filename {
    font-size: 0.9rem;
    color: var(--text-secondary);
    word-break: break-all;
    margin-top: 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.error-icon {
    width: 80px;
    height: 80px;
    background: var(--error);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 30px;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.result-card h3,
.error-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.result-card p,
.error-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.download-btn,
.new-file-btn,
.retry-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 10px;
}

.download-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    color: white;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.download-btn span {
    font-size: 1.3rem;
    margin-right: 8px;
}

.new-file-btn,
.retry-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.new-file-btn:hover,
.retry-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .upload-box,
    .processing-card,
    .result-card,
    .error-card {
        padding: 40px 20px;
    }

    .download-btn,
    .new-file-btn,
    .retry-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}