:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --success-color: #10b981;
    --error-color: #ef4444;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.logo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

main {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: #f3f4f6;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background: #ede9fe;
    transform: scale(1.02);
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.drop-zone h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.drop-zone p {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.file-info {
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Preview Section */
.preview-section {
    animation: fadeIn 0.5s ease;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

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

.preview-box h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.image-wrapper {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--background);
    aspect-ratio: 4/5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arrow-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-arrow {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
    animation: slideRight 1.5s ease-in-out infinite;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Error Message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--error-color);
}

.error-message svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.error-message p {
    font-size: 0.875rem;
}

/* Buttons */
.button-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    color: white;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .arrow-container {
        transform: rotate(90deg);
        margin: 1rem 0;
    }

    .process-arrow {
        animation: slideDown 1.5s ease-in-out infinite;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        width: 3rem;
        height: 3rem;
    }
}

@keyframes slideDown {
    0%, 100% {
        transform: translateY(0) rotate(90deg);
    }
    50% {
        transform: translateY(10px) rotate(90deg);
    }
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.7;
}
