/* CSS Custom Properties */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #ffffff;
    --surface: #f8fafc;
    --radius: 12px;
    --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);
    --transition: all 0.2s ease-in-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

.logo svg {
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto;
}

/* Questionnaire Styles */
.questionnaire {
    padding: 40px;
}

.gift-form {
    display: grid;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--background);
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Button Styles */
.submit-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

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

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

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

/* Loading Styles */
.loading {
    padding: 60px 40px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

/* Results Styles */
.results {
    padding: 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 32px;
}

.results-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.results-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.gift-list {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.gift-item {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.gift-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gift-item h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.gift-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Error Styles */
.error {
    padding: 60px 40px;
    text-align: center;
}

.error-icon {
    color: var(--error-color);
    margin-bottom: 24px;
}

.error h3 {
    font-size: 1.5rem;
    color: var(--error-color);
    margin-bottom: 12px;
}

.error p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer Styles */
.footer {
    background: var(--surface);
    padding: 24px 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 32px 24px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .questionnaire,
    .results,
    .loading,
    .error {
        padding: 24px;
    }

    .footer {
        padding: 20px 24px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .submit-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .logo {
        font-size: 20px;
    }

    .results-header h2 {
        font-size: 1.5rem;
    }

    .gift-item {
        padding: 20px;
    }

    .gift-item h3 {
        font-size: 1.2rem;
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation for smooth transitions */
.questionnaire,
.loading,
.results,
.error {
    animation: fadeInUp 0.5s ease-out;
}

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