:root {
    /* Apple-like adaptive color palette */
    --bg-color: #000000;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --glass-bg: rgba(28, 28, 30, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --radius: 20px;
    --font-family: -apple-system, BlinkMacSystemFont, "Inter", "San Francisco", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    /* Smooth dark theme feel */
    -webkit-font-smoothing: antialiased;
}

/* Dynamic Mesh Background Gradient */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #000;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: drift 18s ease-in-out infinite alternate;
}

.blob.c1 {
    width: 400px;
    height: 400px;
    background: #00509e;
    top: -10%;
    left: -10%;
}

.blob.c2 {
    width: 500px;
    height: 500px;
    background: #14002e;
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.blob.c3 {
    width: 350px;
    height: 350px;
    background: #002244;
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 680px;
    padding: 40px 20px;
    text-align: center;
    z-index: 1;
}

header {
    margin-bottom: 40px;
    animation: fadeInc 0.8s ease backwards;
}

.logo {
    font-size: 48px;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 4px 20px rgba(255,255,255,0.2);
}

h1 {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

header p {
    color: var(--text-secondary);
    font-size: 16px;
    letter-spacing: 0.01em;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    animation: fadeInc 0.8s ease 0.1s backwards;
}

/* Dropzone */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: calc(var(--radius) - 10px);
    padding: 60px 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone:hover, .dropzone.dragover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.02);
}

.icon svg {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

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

.dropzone h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 10px;
}

.dropzone p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Result Panel */
.result-panel {
    padding: 20px;
}

.preview-container {
    width: 100%;
    max-height: 60vh;
    overflow: hidden;
    border-radius: calc(var(--radius) - 8px);
    margin-bottom: 24px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

#result-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    animation: fadeInc 0.6s ease backwards;
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Loader */
.loader {
    padding: 60px 0;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader p {
    color: var(--text-secondary);
    font-size: 15px;
}

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

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

/* Input Field Styles */
.custom-input {
    width: 90%;
    max-width: 400px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.custom-input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
}
.custom-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
