/* ========================================
   Multidisciplinary Clinic Questionnaire Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(6, 182, 212, 0.1) 100%);
    
    --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 -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   Animated Background
   ======================================== */
.bg-animation {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--accent);
    bottom: -100px;
    left: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    top: 20%;
    left: 60%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    width: 0%;
}

.progress-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    min-width: 50px;
    text-align: right;
}

/* ========================================
   Main Container
   ======================================== */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 80px 20px 40px;
}

/* ========================================
   Steps
   ======================================== */
.step {
    display: none;
    animation: fadeIn 0.5s ease;
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.step.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Welcome Screen
   ======================================== */
.welcome-content {
    text-align: center;
    padding: 40px 20px;
}

/* Ensure content is visible even before animations */
.welcome-content > * {
    opacity: 1 !important;
    transform: none !important;
}

.logo-container {
    margin-bottom: 40px;
}

.logo-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    color: var(--primary);
    animation: pulse 2s infinite;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-circle {
    animation: rotate 20s linear infinite;
    transform-origin: center;
}

.logo-cross {
    animation: pulse 2s infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.tagline {
    font-size: 1.1rem;
    color: var(--gray-500);
    font-style: italic;
}

.welcome-text {
    margin-bottom: 40px;
}

.welcome-text h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.welcome-text p {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Info Cards */
.info-cards {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    font-size: 1.5rem;
}

.info-card span {
    font-weight: 500;
    color: var(--gray-700);
}

/* ========================================
   Question Cards
   ======================================== */
.question-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gradient-primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-full);
    margin-right: 12px;
}

.section-header.patient-section .section-badge {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

.section-note {
    font-size: 13px;
    color: var(--gray-500);
    font-style: italic;
}

.question-number {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.question-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 32px;
    line-height: 1.4;
}

.question-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 32px;
}

/* ========================================
   Yes/No Options
   ======================================== */
.yes-no-options {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    justify-content: center;
}

.yes-no-option {
    flex: 1;
    max-width: 200px;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.yes-no-option:hover {
    transform: translateY(-4px);
}

.yes-no-option input:checked + .option-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    box-shadow: var(--shadow-glow);
}

.yes-no-option .option-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.yes-no-option .option-label {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--gray-700);
}

.yes-no-option input:checked + .option-content .option-label {
    color: var(--primary);
}

/* ========================================
   Survey Options (Who is completing)
   ======================================== */
.survey-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.survey-option {
    cursor: pointer;
    transition: transform var(--transition-base);
}

.survey-option:hover {
    transform: translateX(8px);
}

.survey-option input:checked + .option-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    box-shadow: var(--shadow-glow);
}

.survey-option .option-content {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.survey-option .option-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--gray-700);
}

.survey-option input:checked + .option-content .option-label {
    color: var(--primary);
}

/* ========================================
   Three Options (Yes/Somewhat/No)
   ======================================== */
.three-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.three-option {
    cursor: pointer;
    transition: transform var(--transition-base);
}

.three-option:hover {
    transform: translateX(8px);
}

.three-option input:checked + .option-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    box-shadow: var(--shadow-glow);
}

.three-option .option-content {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.three-option .option-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--gray-700);
}

.three-option input:checked + .option-content .option-label {
    color: var(--primary);
}

/* ========================================
   Rating Options (Excellent/Good/Poor)
   ======================================== */
.rating-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.rating-option {
    cursor: pointer;
    transition: transform var(--transition-base);
}

.rating-option:hover {
    transform: translateX(8px);
}

.rating-option input:checked + .option-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    box-shadow: var(--shadow-glow);
}

.rating-option.excellent input:checked + .option-content {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

.rating-option.good input:checked + .option-content {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(251, 191, 36, 0.05) 100%);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
}

.rating-option.poor input:checked + .option-content {
    border-color: var(--error);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(248, 113, 113, 0.05) 100%);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}

.rating-option .option-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.rating-emoji {
    font-size: 2rem;
}

.rating-option .option-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--gray-700);
}

.rating-option.excellent input:checked + .option-content .option-label {
    color: var(--success);
}

.rating-option.good input:checked + .option-content .option-label {
    color: var(--warning);
}

.rating-option.poor input:checked + .option-content .option-label {
    color: var(--error);
}

/* ========================================
   Navigation
   ======================================== */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-submit {
    padding: 18px 40px;
    font-size: 1.1rem;
}

/* ========================================
   Review Summary
   ======================================== */
.review-card {
    max-width: 700px;
}

.review-section {
    margin-bottom: 32px;
}

.review-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.review-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    gap: 16px;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 500;
    color: var(--gray-600);
    flex: 1;
    font-size: 0.95rem;
}

.review-value {
    font-weight: 600;
    color: var(--gray-800);
    text-align: right;
    min-width: 100px;
}

/* ========================================
   Success Screen
   ======================================== */
.success-content {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    color: var(--success);
}

.success-icon svg {
    width: 100%;
    height: 100%;
}

.success-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: drawCircle 0.6s ease forwards;
}

.success-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s ease 0.6s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.success-message {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 32px;
    line-height: 1.7;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   Privacy Footer
   ======================================== */
.privacy-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(10px);
    text-align: center;
    z-index: 100;
    border-top: 1px solid var(--gray-200);
}

.privacy-footer p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 640px) {
    .app-container {
        padding: 72px 16px 80px;
    }
    
    .brand-name {
        font-size: 2rem;
    }
    
    .welcome-text h2 {
        font-size: 1.5rem;
    }
    
    .question-card {
        padding: 24px;
    }
    
    .question-title {
        font-size: 1.25rem;
    }
    
    .info-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .info-card {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .yes-no-options {
        flex-direction: row;
        gap: 12px;
    }
    
    .yes-no-option {
        max-width: none;
    }
    
    .yes-no-option .option-content {
        padding: 16px 24px;
    }
    
    .review-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .review-value {
        text-align: left;
    }
    
    .navigation {
        flex-direction: column-reverse;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .success-title {
        font-size: 2rem;
    }
    
    .success-icon {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 400px) {
    .yes-no-options {
        gap: 8px;
    }
    
    .yes-no-option .option-content {
        padding: 14px 20px;
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-shape {
        animation: none;
    }
}

/* Focus styles */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
