:root {
    --brand-color: #36e27b;
    --brand-hover: #2xc069;
    --brand-dark: #1b733e;

    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    --font-family: 'Spline Sans', sans-serif;
    --radius-full: 9999px;
    --radius-card: 24px;
    --radius-input: 16px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 3rem 1.5rem;
    position: relative;
    overflow-x: hidden;
}

/* Background effects */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(54, 226, 123, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(54, 226, 123, 0.05), transparent 25%);
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Two Column Layout */
.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.form-column {
    flex: 1;
    min-width: 0;
}

.result-column {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Inputs and Selects */
.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-input);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-field:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(54, 226, 123, 0.2);
}

.input-field::placeholder {
    color: var(--text-tertiary);
}

/* Select wrapper for custom down arrow */
.select-wrapper {
    position: relative;
}

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

select.input-field {
    appearance: none;
    padding-right: 2.5rem;
}

select.input-field option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Color Input */
.color-input {
    width: 100%;
    height: 3.5rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.color-input:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(54, 226, 123, 0.2);
    outline: none;
}


/* File Upload Customization */
.file-upload-group {
    margin-bottom: 2rem;
}

.hidden-input {
    display: none;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    border-color: var(--brand-color);
    background: rgba(54, 226, 123, 0.05);
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.file-upload-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
}

.file-name-display {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--brand-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.submit-container {
    display: flex;
    justify-content: center;
    margin-top: auto;
    width: 100%;
}

/* Toggle Switches */
.toggles-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-input);
    border: 1px solid var(--border-color);
}

.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

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

.slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    margin-right: 1rem;
    flex-shrink: 0;
}

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

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

input:focus+.slider {
    box-shadow: 0 0 1px var(--brand-color);
}

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

.toggle-label {
    color: var(--text-primary);
    font-weight: 500;
}


/* Buttons */
.btn-primary {
    display: inline-block;
    width: 100%;
    background-color: var(--brand-color);
    color: var(--bg-dark);
    padding: 1.25rem 2rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    margin-top: 1rem;
    box-shadow: 0 4px 14px 0 rgba(54, 226, 123, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(54, 226, 123, 0.45);
    background-color: #40f286;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #52525b;
    color: #a1a1aa;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-top: 1.5rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

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

/* Progress */
#progressContainer {
    text-align: center;
}

#progressText {
    color: var(--brand-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand-color));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Unified Status Container */
.status-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-card);
}

#progressContent {
    width: 100%;
    text-align: center;
}

#resultContent {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#resultContent h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.image-wrapper {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: var(--radius-card);
    display: flex;
    justify-content: center;
}

#resultImage {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-card);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 800px) {
    .main-layout {
        flex-direction: column;
    }

    .result-column {
        position: static;
        width: 100%;
    }
}

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

    .glass-panel {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }
}