/* Global CSS variables for design system */
:root {
    --bg-color: #0b0c10;
    --text-primary: #f0f2f5;
    --text-secondary: #94a3b8;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --secondary: #10b981;
    --secondary-glow: rgba(16, 185, 129, 0.15);
    --accent: #a855f7;
    --glass-bg: rgba(30, 41, 59, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover-border: rgba(255, 255, 255, 0.15);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Stunning background decorations */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(100px);
    -webkit-backdrop-filter: blur(100px);
    z-index: -1;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    z-index: -2;
    pointer-events: none;
}

.orb-1 {
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 80%);
}

.orb-2 {
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 80%);
}

/* Navbar styles */
.navbar {
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 12, 16, 0.7);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

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

.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--secondary);
}

/* Main Layout */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.4;
}

/* Converter Card */
.converter-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition-smooth);
}

/* Dropzone Styles - Ultra Compact Bar */
.dropzone {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.dropzone-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.icon-wrapper {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.dropzone:hover .icon-wrapper {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--primary-glow);
}

.upload-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.dropzone:hover .upload-icon {
    color: var(--primary);
}

.dropzone-text {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropzone h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.dropzone-hint {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 0;
}

/* Control Panel */
.control-panel {
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
    margin-top: 2rem;
    animation: fadeIn 0.4s ease;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.panel-title i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.btn-clear:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.settings-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.settings-group label i {
    width: 16px;
    height: 16px;
}

/* Custom Dropdown Styling */
.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: var(--transition-smooth);
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.75rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Range Slider Styling */
.label-with-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#qualityVal {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 10px 0;
}

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

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

/* Number Input Styling */
.number-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.number-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Dimension & File Size Badges */
.badge-dim {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-size {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
}

.badge-arrow {
    color: var(--primary);
    font-weight: bold;
    margin: 0 0.15rem;
}

/* Resize Live Summary Box */
.resize-summary-box {
    margin-top: 0.75rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

.summary-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.summary-value {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value.highlight {
    color: #818cf8;
    font-weight: 700;
}

.summary-arrow {
    color: var(--primary);
    display: flex;
    align-items: center;
}

.summary-arrow i {
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-hover-border);
}

.btn-secondary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.2);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Batch Actions & Queue Status */
.batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.queue-status {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Queue Container & Items */
.queue-container {
    margin-top: 2.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
    animation: fadeIn 0.4s ease;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-smooth);
}

.queue-item:hover {
    border-color: var(--glass-hover-border);
    background: rgba(15, 23, 42, 0.65);
}

.thumbnail-preview {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.item-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.status-waiting { color: var(--text-secondary); }
.status-converting { color: var(--primary); }
.status-completed { color: var(--secondary); }
.status-error { color: #ef4444; }

.item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px var(--primary-glow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.feature-icon i {
    width: 24px;
    height: 24px;
}

.feature-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Footer styling */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Custom Toggle Switch */
.toggle-checkbox {
    display: none;
}

.toggle-label {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid var(--glass-border);
    display: inline-block;
}

.toggle-label::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--text-primary);
    top: 2px;
    left: 2px;
    transition: var(--transition-smooth);
}

.toggle-checkbox:checked + .toggle-label {
    background-color: var(--primary);
}

.toggle-checkbox:checked + .toggle-label::after {
    left: 26px;
    background-color: #fff;
}

/* Custom Color Picker Input */
.color-picker-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    background: none;
    cursor: pointer;
    padding: 0;
    transition: var(--transition-smooth);
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--border-radius-sm) - 1px);
}

.color-picker-input::-moz-color-swatch {
    border: none;
    border-radius: calc(var(--border-radius-sm) - 1px);
}

.color-picker-input:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

/* Helper Utility Classes */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Progress bar inside queue items */
.progress-container {
    grid-column: 1 / -1;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: -0.5rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transition: width 0.15s ease-out;
}

/* Responsive adjustment */
@media (max-width: 640px) {
    .queue-item {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }
    .item-controls {
        grid-column: 1 / -1;
        justify-content: flex-end;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 0.5rem;
    }
    .hero-title {
        font-size: 2.25rem;
    }
    .converter-card {
        padding: 1.5rem;
    }
}

/* Debug Console Styling */
.debug-console {
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    user-select: none;
    transition: var(--transition-smooth);
}

.debug-header:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--glass-hover-border);
}

.debug-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.debug-title i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.debug-body {
    margin-top: 0.75rem;
    background: rgba(11, 12, 16, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.80rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.log-entry {
    line-height: 1.4;
    word-break: break-all;
    border-left: 2px solid var(--text-secondary);
    padding-left: 0.5rem;
}

.log-info {
    color: var(--text-secondary);
    border-color: var(--text-secondary);
}

.log-success {
    color: var(--secondary);
    border-color: var(--secondary);
}

.log-error {
    color: #ef4444;
    border-color: #ef4444;
}

.log-warn {
    color: #f59e0b;
    border-color: #f59e0b;
}

