:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --card-background: #ffffff;
    --text-color: #333;
    --heading-color: #1f2937;
    --subtle-text: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --background-color: #f9fafb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* --- Journey Screens --- */
.journey-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; text-align: center; overflow: hidden; transition: opacity 0.5s ease; }
.journey-step { display: none; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 600px; }
.journey-step.active { display: flex; animation: fadeIn 0.8s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.welcome-content{ display: flex; justify-content: center; align-items: center; flex-direction: column; }
.welcome-title { font-family: var(--font-primary); font-size: 3rem; font-weight: 700; color: var(--heading-color); line-height: 1.2; margin-bottom: 1rem; }
.welcome-subtitle { font-size: 1.1rem; color: var(--subtle-text); margin-bottom: 2.5rem; max-width: 450px; }
.journey-title { font-family: var(--font-primary); font-size: 2.2rem; font-weight: 600; color: var(--heading-color); margin-bottom: 1rem; }
.journey-subtitle { font-size: 1rem; color: var(--subtle-text); margin-bottom: 2.5rem; }
.choice-cards { display: flex; gap: 2rem; width: 100%; }
.choice-card { flex: 1; background: var(--card-background); padding: 2rem; border-radius: 16px; border: 1px solid var(--border-color); cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.choice-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07); border-color: var(--primary-color); }
.choice-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.choice-card h3 { font-family: var(--font-primary); font-size: 1.25rem; color: var(--heading-color); margin-bottom: 0.5rem; }
.choice-card p { color: var(--subtle-text); font-size: 0.9rem; margin: 0; }
.prepare-list { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2.5rem; text-align: left; width: 100%; max-width: 350px; }
.prepare-item { display: flex; align-items: center; background: var(--card-background); padding: 1rem; border-radius: 12px; border: 1px solid var(--border-color); }
.prepare-icon { font-size: 1.5rem; margin-right: 1rem; }
.prepare-item p { margin: 0; font-weight: 500; color: var(--heading-color); }
.journey-btn { font-family: var(--font-primary); font-size: 1rem; font-weight: 600; color: white; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); padding: 0.8rem 2.5rem; border: none; border-radius: 50px; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.journey-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2); }

/* --- Camera Container & Overlays --- */
.camera-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; z-index: 1000; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.camera-container.active { opacity: 1; pointer-events: all; }
.camera-preview { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; flex: 1; overflow: hidden; }
#camera { width: 100%; height: 100%; object-fit: cover; }
.camera-frame { box-sizing: border-box; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 280px; height: 380px; border: 4px solid rgba(255, 255, 255, 0.8); border-radius: 140px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.6); transition: all 0.4s ease; }
.camera-container.active .camera-frame { animation: popInFrame 0.5s ease-out; }
@keyframes popInFrame { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.camera-frame.error { border-color: var(--error-color); animation: shake 0.5s ease-in-out; }
@keyframes shake { 10%, 90% { transform: translate(-51%, -50%); } 20%, 80% { transform: translate(-49%, -50%); } 30%, 50%, 70% { transform: translate(-52%, -50%); } 40%, 60% { transform: translate(-48%, -50%); } }
.camera-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; color: white; z-index: 10; font-family: var(--font-primary); background-color: rgba(10, 5, 20, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.camera-header h2 { font-size: 1.1rem; margin: 0; text-align: center; }
.back-btn { background: none; border: none; color: white; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.5rem; border-radius: 20px; transition: background-color 0.2s; flex-shrink: 0; }
.back-btn:hover { background-color: rgba(255, 255, 255, 0.1); }
.header-placeholder { width: 60px; flex-shrink: 0; }
.flash-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; background: white; opacity: 0; transition: opacity 0.5s; }
.flash-effect.active { opacity: 0.8; }
.countdown-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; justify-content: center; align-items: center; background: rgba(0,0,0,0.3); z-index: 20; }
.countdown-number { font-size: 15vw; font-weight: 700; color: white; text-shadow: 0 0 20px rgba(0,0,0,0.8); animation: countdown-pulse 1s ease-in-out infinite; }
@keyframes countdown-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.9; } }
.loader-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; background-color: rgba(0, 0, 0, 0.85); z-index: 100; }
.loader { width: 50px; height: 50px; border: 5px solid var(--secondary-color); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 1s ease-in-out infinite; }
.loader-text { color: white; font-family: var(--font-primary); margin-top: 1rem; font-size: 1.2rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-message { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: var(--error-color); color: white; padding: 1rem 1.5rem; border-radius: 8px; z-index: 2000; font-weight: 500; box-shadow: 0 4px 15px rgba(0,0,0,0.2); animation: popIn 0.4s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateX(-50%) translateY(15px) scale(0.95); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
.lighting-feedback { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: rgba(0,0,0,0.7); color: var(--warning-color); padding: 0.75rem 1.25rem; border-radius: 50px; z-index: 20; font-weight: 600; font-family: var(--font-primary); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid rgba(255, 152, 0, 0.5); }

/* --- Results Page & Components --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.result-header { text-align: center; margin-bottom: 2.5rem; }
.result-header h1 { font-family: var(--font-primary); }
.result-card { display: flex; gap: 2.5rem; margin-bottom: 3rem; background: var(--card-background); padding: 2.5rem; border-radius: 16px; border: 1px solid var(--border-color); align-items: center; }
.result-image-container { position: relative; max-width: 300px; margin: 0; }
.result-image { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: block; }
.result-badge { position: absolute; top: 15px; right: 15px; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: white; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); }
.result-details { flex: 1; }
.result-details h2 { font-family: var(--font-primary); }
.condition-value { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin: 0.5rem 0 1rem; text-transform: capitalize; }
.condition-description { color: var(--subtle-text); max-width: 600px; }
.detailed-metrics { background-color: var(--background-color); border-radius: 8px; padding: 1rem; margin-top: 1.5rem; font-size: 0.9rem; }
.metric-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border-color); }
.metric-item:last-child { border-bottom: none; }
.metric-label { font-weight: 500; color: var(--heading-color); }
.metric-value { font-weight: 600; color: var(--primary-color); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; margin: 2rem 0; }
.product-card { background: var(--card-background); border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.product-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.product-info h3 { font-family: var(--font-primary); font-size: 1.25rem; color: var(--heading-color); margin-bottom: 0.5rem; }
.product-description { color: var(--subtle-text); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.5; }
.product-section { margin-bottom: 1.2rem; }
.product-section:last-child { margin-bottom: 0; }
.product-section h4 { font-size: 0.9rem; color: var(--heading-color); font-weight: 600; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.product-features { list-style: none; padding: 0; margin: 0; }
.product-features li { position: relative; padding-left: 1.5rem; margin-bottom: 0.4rem; color: var(--subtle-text); font-size: 0.9rem; }
.product-features li:before { content: '✓'; position: absolute; left: 0; color: var(--success-color); font-weight: bold; font-size: 1rem; }
.ingredients-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ingredient-tag { background-color: var(--background-color); color: var(--subtle-text); padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.8rem; font-weight: 500; }
.product-actions { margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
.buy-now-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 0.75rem 1rem; border-radius: 12px; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); color: white; font-family: var(--font-primary); font-weight: 600; text-decoration: none; transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.buy-now-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2); }
.buy-now-btn .btn-icon { margin-right: 0.5rem; }
.reason-why { background-color: #f5f7ff; border-left: 4px solid var(--primary-color); padding: 1rem; margin: 1rem 0; border-radius: 0 8px 8px 0; }
.reason-why h4 { color: var(--primary-color); margin: 0 0 0.25rem 0; font-size: 0.9rem; }
.reason-why p { margin: 0; color: var(--subtle-text); font-size: 0.9rem; }
.actions { display: flex; justify-content: center; gap: 1rem; margin-top: 3rem; flex-wrap: wrap; }
.actions .primary-btn, .actions .secondary-btn { font-family: var(--font-primary); font-size: 1rem; font-weight: 600; padding: 0.8rem 2rem; border-radius: 50px; transition: all 0.3s ease; border: 2px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; }
.actions .primary-btn { background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); color: white; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.actions .primary-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2); }
.actions .secondary-btn { background: var(--card-background); color: var(--primary-color); border-color: var(--primary-color); }
.actions .secondary-btn:hover { transform: translateY(-3px); background: #fdfaff; box-shadow: 0 7px 20px rgba(0, 0, 0, 0.1); }
.page-loader { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #F7FAFC; z-index: 9999; }
.overlay-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* Responsive Design */
@media (max-width: 768px) {
    .choice-cards { flex-direction: column; }
    .welcome-title { font-size: 2.5rem; }
    .journey-title { font-size: 1.8rem; }
    .result-card { flex-direction: column; text-align: center; padding: 1.5rem; }
    .actions { flex-direction: column; }
    .camera-header h2 { font-size: 1rem; }
    .header-placeholder { width: 50px; }
}

body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background: radial-gradient(circle at 15% 25%, rgb(79 209 197 / 0.7), transparent 40%), radial-gradient(circle at 80% 20%, rgb(154 230 180 / 0.7), transparent 40%), radial-gradient(circle at 50% 75%, rgb(251 211 141 / 0.6), transparent 50%); background-size: 250% 250%; background-color: #F7FAFC; animation: moveGradient 25s linear infinite; }
body::after { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; box-shadow: inset 0 0 15vw 10vw #F7FAFC; pointer-events: none; }
@keyframes moveGradient { 0% { background-position: 0% 0%; } 25% { background-position: 100% 0%; } 50% { background-position: 100% 100%; } 75% { background-position: 0% 100%; } 100% { background-position: 0% 0%; } }
.journey-container, .camera-container { position: relative; z-index: 1; background-color: transparent; }