:root {
    --primary-hue: 250;
    --primary-color: hsl(var(--primary-hue), 80%, 60%);
    --primary-dark: hsl(var(--primary-hue), 80%, 50%);
    --secondary-color: hsl(30, 90%, 60%);
    --bg-dark: hsl(220, 20%, 10%);
    --text-light: hsl(0, 0%, 100%);
    --text-dim: hsl(220, 10%, 70%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: hsl(180, 80%, 60%);
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary-color), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-dim);
    font-size: 1rem;
}

/* Glass Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.card.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.card.active {
    display: block;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Section */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.02);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: var(--primary-color);
}

.drop-zone h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.drop-zone p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 100, 255, 0.3);
}

.btn-large {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 1.1rem;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-weight: 600;
}

.btn-gradient:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 100, 100, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
    border-radius: 8px;
}

.btn-icon:hover {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
}

/* Settings Section */
.file-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.file-details i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.settings-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Range Slider */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#quality-value {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
}

/* Select */
.select-wrapper select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    cursor: pointer;
}

.select-wrapper select option {
    background: #1a1a2e;
    /* Fallback for dropdown background */
    color: #fff;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
}

.toggle-group input {
    display: none;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-dim);
}

.toggle-group input:checked+.toggle-btn {
    background: var(--primary-color);
    color: #fff;
    font-weight: 500;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Progress Section */
.progress-container {
    margin: 2rem 0 1rem;
    text-align: center;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.process-log {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    max-height: 100px;
    overflow-y: auto;
    text-align: left;
}

/* Result Section */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4caf50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

#result-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.stats-comparison {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.stat-box {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    min-width: 120px;
}

.stat-box.highlight {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.stat-box .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.stat-box .value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

.arrow {
    color: var(--text-dim);
}

.reduction-badge {
    text-align: center;
    display: inline-block;
    background: #ff5555;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    margin: 0 auto 2rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(255, 85, 85, 0.3);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }
}