:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 2rem;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
}

.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.upload-area {
    border: 2px dashed #e5e7eb;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f5f3ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.upload-text {
    font-weight: 500;
    color: var(--text-color);
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

#fileInput {
    display: none;
}

.preview-container {
    margin-top: 2rem;
    display: none;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.result-container {
    margin-top: 2rem;
    text-align: left;
    display: none;
}

.result-header {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#resultText {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    background-color: #f9fafb;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}