:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success-color: #10b981;
    --font-family: 'Outfit', sans-serif;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 20%);
    background-attachment: fixed;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    padding: 15px 0;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: none;
    list-style: none;
    gap: 25px;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    margin-bottom: 1.2rem;
    font-weight: 800;
}

.hero-content h1 .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2.5rem;
}

.benefit-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.benefit-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Card Wrapper */
.compress-tool-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--glass-shadow);
    max-width: 850px;
    margin: 0 auto;
    transition: all 0.3s ease;
    min-height: 300px;
}

/* Upload */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.icon-upload {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Tool Controls */
.hidden {
    display: none !important;
}

.preview-area {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 20px;
}

.preview-area img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.file-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#fileName {
    font-weight: 600;
    font-size: 1rem;
}

.dims {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.small {
    font-size: 0.85rem;
}

/* Studio Layout */
.studio-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .studio-panel {
        grid-template-columns: 1fr 1fr;
    }
}

.studio-col h4 {
    margin-bottom: 15px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

/* Quick Mode Buttons */
.intent-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.intent-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}

.intent-btn.active,
.intent-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Inputs */
select,
.dark-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 10px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
}

.resize-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resize-inputs span {
    color: var(--text-muted);
}

/* Custom Range */
.styled-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    margin: 10px 0;
}

.styled-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid #fff;
}

.range-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: -5px;
}

.flex-label {
    display: flex;
    justify-content: space-between;
}

/* Enhance Panel */
.enhance-panel {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
}

.slider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Checkbox Toggle */
.switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    font-size: 0.9rem;
}

.switch-label input {
    display: none;
}

.slider-check {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    position: relative;
    transition: .3s;
}

.slider-check:before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked+.slider-check {
    background: var(--success-color);
}

input:checked+.slider-check:before {
    transform: translateX(16px);
}

/* Buttons */
.primary-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glow-effect:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.small-btn {
    width: 100%;
    border-style: dashed;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

/* Stats */
.action-area {
    text-align: center;
}

.stats {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.highlight-green {
    color: var(--success-color);
    font-weight: 700;
}

/* Progress */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--success-color);
    width: 0%;
    transition: width 0.2s;
}

/* Result View */
.result-view {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.comparison-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    min-width: 100px;
}

.stat-box.saved {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-box .val {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

.savings-tag {
    display: inline-block;
    background: var(--success-color);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 25px;
}

/* SEO Content */
.seo-content {
    padding: 50px 0;
    background: #0b1120;
}

.content-grid {
    display: grid;
    gap: 40px;
}

.seo-content h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.seo-content ul {
    padding-left: 20px;
    color: var(--text-muted);
}

/* Footer */
.main-footer {
    background: #020617;
    border-top: 1px solid var(--card-border);
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-links h4 {
    margin-bottom: 20px;
    color: var(--text-main);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.error-msg {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}