:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-label {
    display: block;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--surface);
}

.upload-label:hover,
.upload-label.drag-over {
    border-color: var(--primary-color);
    background-color: #f1f5f9;
}

.upload-label svg {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-label span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-label small {
    color: var(--text-secondary);
}

.image-preview {
    position: relative;
    margin-top: 1rem;
}

.image-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
}

.remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.3s ease;
}

.remove-image:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.prompt-section {
    margin-bottom: 2rem;
}

.prompt-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.prompt-section input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.analyze-btn {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.analyze-btn:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-section h2 {
    margin-bottom: 1rem;
}

.result-text {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.copy-btn {
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.hidden {
    display: none !important;
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.large {
    width: 2rem;
    height: 2rem;
    border-width: 3px;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.loading-content .spinner {
    margin: 0 auto 1rem;
    border-color: var(--border);
    border-top-color: var(--primary-color);
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .upload-label {
        padding: 2rem;
    }
}