:root {
    --bg-primary: #07090e;
    --bg-card: rgba(18, 22, 32, 0.85);
    --bg-card-hover: rgba(26, 32, 46, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --accent-emerald: #10b981;
    --accent-rose: #ef4444;

    --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #06b6d4 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Glowing Mesh Orbs */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 450px;
    height: 450px;
    background: var(--accent-purple);
    top: -100px;
    left: -100px;
    animation: meshGlow 16s infinite alternate ease-in-out;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-cyan);
    bottom: -150px;
    right: -150px;
    animation: meshGlow 20s infinite alternate-reverse ease-in-out;
}

.bg-glow-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-amber);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    animation: meshGlow 12s infinite alternate ease-in-out;
}

@keyframes meshGlow {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.15) translate(30px, -20px); }
    100% { transform: scale(0.9) translate(-20px, 30px); }
}

.app-container {
    width: 100%;
    max-width: 1120px;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    position: relative;
    z-index: 1;
}

/* Header - Sleek & Minimal */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.logo-icon {
    width: 46px;
    height: 46px;
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.glow-pulse {
    animation: pulseIcon 3s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 6px 28px rgba(139, 92, 246, 0.7); }
}

.brand-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.brand-title span {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 0.25rem;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.btn-ghost-nav {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: var(--transition);
}
.btn-ghost-nav:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.badge-privacy {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Glassmorphism Card Base UI */
.card {
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    transition: var(--transition);
}

.glass-card {
    background: var(--bg-card) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.14) !important;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    padding: 1rem 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.25rem;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
}

.text-purple { color: var(--accent-purple); }
.text-cyan { color: var(--accent-cyan); }
.text-amber { color: var(--accent-amber); }
.text-gold { color: #fbbf24; }

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.35rem;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-primary);
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: fit-content;
}

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

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-header label, .control-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.value-badge {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
    padding: 0.18rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-indigo {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #818CF8 !important;
}

/* AI Photonic HD Netleştirme Feature Box Styling */
.photonic-box, .esobuba-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.15);
}

.text-gradient-indigo, .text-gradient-gold {
    background: linear-gradient(135deg, #818CF8 0%, #C084FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800 !important;
}

.feature-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.45rem;
    line-height: 1.45;
}

input:checked + .slider-indigo, input:checked + .slider-gold {
    background-color: #6366F1;
}

/* Custom Range Input */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: #1e2533;
    outline: none;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Format Options Buttons (3 Columns Grid) */
.format-options.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
}

.format-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    transition: var(--transition);
}

.format-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.03);
}

.format-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.format-name {
    font-weight: 800;
    font-size: 0.84rem;
}

.format-tag {
    font-size: 0.62rem;
    opacity: 0.7;
}

/* Feature Box & Toggle Switch */
.feature-box {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    padding: 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch-label {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #273142;
    transition: .25s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s;
}

input:checked + .slider {
    background-color: var(--accent-purple);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 30px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Custom Select Dropdown */
.custom-select {
    width: 100%;
    background: #181d2a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.custom-select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.custom-select optgroup {
    background: #121620;
    color: var(--accent-purple);
    font-weight: 700;
}

.custom-select option {
    background: #121620;
    color: var(--text-primary);
    font-weight: 400;
}

/* Dropzone Area */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dropzone {
    border: 2px dashed rgba(139, 92, 246, 0.25) !important;
    border-radius: var(--radius-lg);
    padding: 2.75rem 1.5rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-purple) !important;
    background: rgba(139, 92, 246, 0.08) !important;
    transform: translateY(-2px);
}

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

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    font-size: 1.75rem;
    color: var(--accent-purple);
    transition: var(--transition);
}

.pulse-glow {
    animation: dropzonePulse 2.5s infinite ease-in-out;
}

@keyframes dropzonePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 0 14px rgba(139, 92, 246, 0); }
}

.dropzone:hover .upload-icon-wrapper {
    transform: translateY(-4px) scale(1.05);
    background: var(--gradient-brand);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.dropzone h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dropzone-hint {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 1.15rem;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.35rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-brand);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

.btn-sparkle {
    background: var(--gradient-brand);
    position: relative;
    overflow: hidden;
}
.btn-sparkle:after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: rotate(30deg);
    animation: sparkleShimmer 4s infinite;
}

@keyframes sparkleShimmer {
    0% { transform: translate(-100%, -100%) rotate(30deg); }
    30%, 100% { transform: translate(100%, 100%) rotate(30deg); }
}

.btn-success {
    background: var(--accent-emerald);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger-ghost {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-rose);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 0.42rem 0.8rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

/* Batch Action Bar */
.batch-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.35rem;
}

.batch-count {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.batch-actions {
    display: flex;
    gap: 0.65rem;
}

/* File List & File Items (Strict Text Truncation) */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: var(--transition);
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.file-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.file-thumb {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%);
    background-size: 14px 14px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

/* STRICT TEXT OVERFLOW & TRUNCATION */
.file-name {
    font-size: 0.94rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
    margin-bottom: 0.15rem;
}

@media (max-width: 700px) {
    .file-name {
        max-width: 170px;
    }
}

.file-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.saving-badge {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.12rem 0.5rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.72rem;
}

.saving-badge-neutral {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.12rem 0.5rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.72rem;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Progress bar inside file card */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-top: 0.35rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-brand);
    width: 0%;
    transition: width 0.25s ease;
}

/* Comparison Modal & Zoom Controls */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.modal-card.fullscreen {
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-zoom-tools {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
}
.modal-close-btn:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #06080d;
    overflow: auto;
    flex: 1;
    min-height: 480px;
}

.comparison-viewport {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

/* Before / After Slider Fixed Layout */
.comparison-container {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-md);
    user-select: none;
    display: inline-block;
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%);
    background-size: 18px 18px;
    touch-action: none;
    transform-origin: center center;
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.comp-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 650px;
    object-fit: contain;
}

.comp-after-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    will-change: width;
    transform: translateZ(0);
}

.comp-after-wrapper .comp-after {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
}

.comp-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: #ffffff;
    cursor: ew-resize;
    z-index: 10;
    will-change: left;
    transform: translateZ(0);
}

.comp-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    font-size: 0.85rem;
}

.comp-label {
    position: absolute;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    z-index: 15;
    border: 1px solid rgba(255,255,255,0.15);
}
.comp-label-left { left: 12px; }
.comp-label-right { right: 12px; }

/* Utilities */
.hidden { display: none !important; }

.footer {
    text-align: center;
    padding-top: 1.35rem;
    font-size: 0.84rem;
    color: var(--text-muted);
}
.footer a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
}
