:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --background: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.05) 50%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.gradient-text {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
}

.converter-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.converter-card.drag-over {
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
}

.icon-container {
    width: 80px;
    height: 80px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.upload-area:hover .icon-container {
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.2);
}

.upload-icon {
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

p {
    color: var(--text-muted);
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.header-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: var(--text-muted);
}

.github-icon {
    opacity: 0.8;
}

.editor-area {
    animation: slideUp 0.5s ease-out;
}

.loading-container {
    padding: 2rem 0;
    text-align: center;
}

.loader-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

.loader-bar {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
    border: 1px solid var(--glass-border);
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.loader-text {
    font-weight: 600;
    color: var(--text);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.preview-box {
    position: relative;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
}

.badge {
    position: absolute;
    top: -10px;
    left: 20px;
    background: #1e293b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--glass-border);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

#qualityValue {
    color: var(--primary);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.btn-download {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}

.footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
    
    .gradient-text {
        font-size: 3rem;
    }
    
    .converter-card {
        padding: 1.5rem;
    }
}
