/*
 * MK-PNG-SVG - Premium Image to SVG Converter
 * Copyright (C) 2026 Kazim
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --accent-hover: #059669;
    --background: #0f172a;
    --foreground: #f8fafc;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #1e293b 0%, #0f172a 100%);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border);
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-4px);
}

.drop-zone-content {
    text-align: center;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

#file-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#file-name {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.controls-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.control-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
}

input[type="range"] {
    width: 100%;
}

input[type="number"], select {
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem;
    color: white;
}

.color-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: white;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

input[type="color"] {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.val-badge {
    background: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    width: fit-content;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-2px); }
.btn-accent:disabled { background: #334155; cursor: not-allowed; opacity: 0.5; }

.btn-success { background: #22c55e; color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: white; }
.full-width { width: 100%; }

.result-section {
    animation: fadeInUp 0.5s ease-out;
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-box {
    text-align: center;
}

.preview-container {
    margin-top: 1rem;
    background: #1e293b;
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

img, svg {
    max-width: 100%;
    max-height: 400px;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

footer {
    margin-top: 4rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.preview-container.interactive {
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-container.interactive:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 48px -12px rgba(99, 102, 241, 0.3);
}

.zoom-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.preview-container.interactive:hover .zoom-hint {
    opacity: 1;
}

/* Zoom Modal */
.zoom-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.zoom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.zoom-usage {
    font-size: 0.85rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-close {
    background: transparent;
    border: 1px solid var(--border);
    color: white;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.zoom-viewport {
    flex: 1;
    cursor: grab;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-viewport:active {
    cursor: grabbing;
}

.zoom-content {
    transform-origin: 0 0;
    will-change: transform;
}

.zoom-content svg {
    max-width: none;
    max-height: none;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.hidden { display: none !important; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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