/* ===================================
   DePLAY Image Compressor - Styles
   Premium Dark Theme with Glassmorphism
   =================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);

    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --error: #ef4444;

    --bg-dark: #0a0a0f;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-solid: #1e293b;
    --bg-elevated: rgba(51, 65, 85, 0.5);

    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --border: rgba(148, 163, 184, 0.15);
    --border-light: rgba(148, 163, 184, 0.25);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--primary-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139, 92, 246, 0.1), transparent);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid var(--border);
}

.header-container {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-toggle:hover {
    background: var(--bg-card-solid);
    border-color: var(--border-light);
}

.lang-active {
    color: var(--primary-light);
}

.lang-inactive {
    color: var(--text-dim);
}

.lang-divider {
    color: var(--text-dim);
}

/* Main */
.main {
    flex: 1;
    padding: var(--space-2xl) 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
}

.badge {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Upload Section */
.upload-section {
    margin-bottom: var(--space-2xl);
}

.upload-area {
    position: relative;
    padding: var(--space-3xl);
    background: var(--bg-card);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-2xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: var(--shadow-glow);
}

.upload-area.drag-over {
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    pointer-events: none;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}

/* Options Panel */
.options-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.option-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.slider {
    flex: 1;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
    box-shadow: 0 0 10px var(--primary-glow);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    min-width: 48px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-light);
    text-align: right;
}

/* Format Buttons */
.format-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.format-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.format-btn:hover {
    background: var(--bg-card-solid);
    color: var(--text);
}

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

/* Results Section */
.results-section {
    animation: fadeIn 0.4s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.results-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-card-solid);
}

/* Results Summary */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.summary-highlight .summary-value {
    color: var(--success);
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Result Item */
.result-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    align-items: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.result-item:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.result-item.processing {
    opacity: 0.7;
}

.result-item.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.result-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-elevated);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
}

.result-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-sizes {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
}

.result-original {
    color: var(--text-muted);
    text-decoration: line-through;
}

.result-arrow {
    color: var(--text-dim);
}

.result-compressed {
    color: var(--success);
    font-weight: 600;
}

.result-percent {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.result-percent.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Progress Bar */
.result-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-sm);
}

.result-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    transition: width var(--transition-normal);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.result-actions {
    display: flex;
    gap: var(--space-sm);
}

.result-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.result-btn svg {
    width: 20px;
    height: 20px;
}

/* Drag Overlay */
.drag-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.drag-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.drag-overlay-content {
    text-align: center;
    color: var(--text);
}

.drag-overlay-content svg {
    width: 80px;
    height: 80px;
    color: var(--primary);
    margin-bottom: var(--space-md);
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.drag-overlay-content p {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Footer */
.footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.875rem;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: var(--space-sm) var(--space-md);
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .badges {
        gap: var(--space-xs);
    }

    .badge {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }

    .upload-area {
        padding: var(--space-xl);
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-text {
        font-size: 1rem;
    }

    .options-panel {
        grid-template-columns: 1fr;
    }

    .result-item {
        grid-template-columns: 60px 1fr;
        gap: var(--space-md);
    }

    .result-thumbnail {
        width: 60px;
        height: 60px;
    }

    .result-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-actions {
        justify-content: stretch;
    }

    .results-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Utility Classes */
[hidden] {
    display: none !important;
}