/* DivineSky Image Reducer & Meesho Catalog Optimizer - Theme System */
:root {
    --bg-main: #ffffff;
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --navy-primary: #0b2545;
    --navy-dark: #05101f;
    --navy-light: #133b6b;
    --blue-royal: #1e56a0;
    --cyan-sky: #06b6d4;
    --cyan-light: #e0f2fe;
    --cyan-glow: rgba(6, 182, 212, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-accent: #bae6fd;
    --success-green: #10b981;
    --success-light: #d1fae5;
    --shadow-sm: 0 4px 6px -1px rgba(11, 37, 69, 0.03), 0 2px 4px -1px rgba(11, 37, 69, 0.02);
    --shadow-md: 0 10px 25px -5px rgba(11, 37, 69, 0.08), 0 8px 10px -6px rgba(11, 37, 69, 0.04);
    --shadow-lg: 0 25px 50px -12px rgba(11, 37, 69, 0.15);
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navbar */
.navbar-custom {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-svg {
    height: 42px;
    width: auto;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--navy-primary);
    text-transform: uppercase;
}

.badge-meesho {
    background: linear-gradient(135deg, var(--blue-royal), var(--cyan-sky));
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px var(--cyan-glow);
}

.nav-link-custom {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--blue-royal);
    background: var(--cyan-light);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-accent);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue-royal);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--navy-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-title span {
    background: linear-gradient(135deg, var(--navy-primary), var(--blue-royal), var(--cyan-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 750px;
    margin: 0 auto 2rem;
}

/* Feature Highlights Bar */
.highlights-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy-primary);
    background: var(--bg-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.highlight-item i {
    color: var(--cyan-sky);
}

/* Upload & Control Workspace */
.workspace-container {
    max-width: 1200px;
    margin: -1.5rem auto 3rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

.workspace-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Presets Bar */
.presets-container {
    background: var(--bg-surface);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.presets-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--navy-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.preset-chip {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.preset-chip:hover {
    border-color: var(--cyan-sky);
    color: var(--navy-primary);
    transform: translateY(-1px);
}

.preset-chip.active {
    background: var(--navy-primary);
    color: white;
    border-color: var(--navy-primary);
    box-shadow: 0 4px 12px rgba(11, 37, 69, 0.2);
}

/* Options Grid */
.options-panel {
    padding: 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

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

.control-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.val-badge {
    background: var(--cyan-light);
    color: var(--navy-primary);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 700;
}

.form-control-custom, .form-select-custom {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background-color: var(--bg-surface);
}

.form-control-custom:focus, .form-select-custom:focus {
    outline: none;
    border-color: var(--cyan-sky);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--cyan-glow);
}

.range-slider-custom {
    width: 100%;
    accent-color: var(--cyan-sky);
    cursor: pointer;
    height: 6px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-switch input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-royal);
    cursor: pointer;
}

/* Upload Dropzone */
.dropzone-area {
    padding: 3.5rem 2rem;
    text-align: center;
    border: 2px dashed #cbd5e1;
    margin: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dropzone-area:hover, .dropzone-area.dragover {
    border-color: var(--cyan-sky);
    background: var(--cyan-light);
    transform: scale(1.005);
}

.dropzone-icon {
    width: 68px;
    height: 68px;
    background: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan-sky);
    font-size: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.dropzone-area:hover .dropzone-icon {
    transform: translateY(-4px);
    color: var(--blue-royal);
}

.dropzone-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 0.4rem;
}

.dropzone-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
}

.btn-upload-trigger {
    background: linear-gradient(135deg, var(--navy-primary), var(--blue-royal));
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(11, 37, 69, 0.25);
    transition: all 0.25 ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-upload-trigger:hover {
    background: linear-gradient(135deg, var(--blue-royal), var(--cyan-sky));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
}

/* Results & Processing Section */
.results-section {
    padding: 1.5rem;
    display: none;
}

.results-section.active {
    display: block;
}

.summary-toolbar {
    background: var(--navy-primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.stat-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

.stat-val.highlight {
    color: #38bdf8;
}

.stat-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-download-all {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.btn-download-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.65rem 1.25rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Image Card Grid */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.image-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 850px) {
    .image-card {
        grid-template-columns: 1fr;
    }
}

.image-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
}

/* Before / After Comparison Slider Container */
.comparison-slider-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    user-select: none;
}

.comparison-slider-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: repeating-conic-gradient(#f8fafc 0% 25%, #e2e8f0 0% 50%) 50% / 16px 16px;
}

.img-after {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    z-index: 2;
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: var(--cyan-sky);
    z-index: 3;
    cursor: ew-resize;
}

.handle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: var(--navy-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider-badge {
    position: absolute;
    top: 10px;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 4;
    text-transform: uppercase;
}

.badge-orig {
    right: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: white;
}

.badge-comp {
    left: 10px;
    background: var(--cyan-sky);
    color: white;
}

/* Card Information & Action Details */
.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.file-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-primary);
    word-break: break-all;
}

.savings-pill {
    background: var(--success-light);
    color: var(--success-green);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.specs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.spec-box {
    display: flex;
    flex-direction: column;
}

.spec-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.spec-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy-primary);
}

.spec-val del {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 0.3rem;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.25rem;
}

.btn-card-download {
    background: var(--navy-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s ease;
    text-decoration: none;
}

.btn-card-download:hover {
    background: var(--blue-royal);
    color: white;
}

.btn-card-remove {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-remove:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Spinner Loader */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    border-radius: var(--radius-xl);
}

.divinesky-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--cyan-light);
    border-top-color: var(--blue-royal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer-custom {
    margin-top: auto;
    background: var(--navy-dark);
    color: #94a3b8;
    padding: 3rem 1.5rem 1.5rem;
    border-top: 1px solid var(--navy-primary);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer-col h4 {
    color: white;
    font-size: 1.05rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-col ul li a:hover {
    color: var(--cyan-sky);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
}