/* ==========================================================================
   Image Size Under X MB/KB Converter Utility
   Modern Vanilla CSS - Glassmorphism & High-Aesthetic Theme System
   
   Made with ❤️ in 🇳🇵 by Alok - hello@aloks.com.np
   ========================================================================== */

:root {
    /* Color Tokens - Default Dark Mode */
    --bg-body: #0b0f19;
    --bg-card: rgba(18, 24, 38, 0.85);
    --bg-surface: #172033;
    --bg-input: #111827;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(99, 102, 241, 0.5);
    
    /* Brand Accent Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --backdrop-blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-surface: #ffffff;
    --bg-input: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-hover: #6366f1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header & Nav */
.header {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Main Layout */
.main-container {
    max-width: 1200px;
    width: 95%;
    margin: 2rem auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto;
}

/* Control Panel Card */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-preset {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-preset:hover, .btn-preset.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-field {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.select-field {
    cursor: pointer;
}

/* Dropzone Styling */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone-icon {
    font-size: 3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.dropzone-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dropzone-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-input-hidden {
    display: none;
}

/* Action Buttons */
.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Visual Comparison Slider Tool */
.comparison-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comparison-wrapper {
    position: relative;
    width: 100%;
    max-height: 500px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
    user-select: none;
}

.comparison-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    overflow: hidden;
    border-right: 2px solid #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}

.comparison-overlay img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    max-width: none;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 0.9rem;
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
    cursor: ew-resize;
    pointer-events: none;
    z-index: 10;
}

.range-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 20;
}

/* Comparison Info Cards */
.info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.15rem;
    font-weight: 800;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Data Table for Batch Processing */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.batch-table th, .batch-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.batch-table th {
    background: var(--bg-surface);
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.batch-table th:hover {
    color: var(--primary);
}

.batch-table tbody tr:hover {
    background: var(--primary-light);
}

/* Footer & Attribution */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.attribution {
    font-weight: 600;
    color: var(--text-main);
}

.attribution a {
    color: var(--primary);
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

/* Print Friendly Styles */
@media print {
    .header, .dropzone, .btn-primary, .btn-secondary, .footer {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    .card {
        border: none;
        box-shadow: none;
    }
}
