:root {
    /* Enhanced holistic color palette */
    --primary-teal: #2d5a87;
    --secondary-teal: #4a8bb8;
    --accent-teal: #6bb6d6;
    
    --primary-earth: #8b6f47;
    --secondary-earth: #a0845c;
    --accent-earth: #b8976b;
    
    --primary-gold: #d4af37;
    --secondary-gold: #e8c547;
    --accent-gold: #f2d865;
    
    --vata-color: #87ceeb;
    --pitta-color: #ff6b35;
    --kapha-color: #228b22;
    
    /* Background gradients */
    --background-primary: linear-gradient(135deg, #faf8f3 0%, #f0ebe2 25%, #e8ddd4 50%, #f5f1ea 75%, #faf8f3 100%);
    --background-secondary: radial-gradient(circle at 30% 40%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
                            radial-gradient(circle at 70% 80%, rgba(45, 90, 135, 0.08) 0%, transparent 50%),
                            radial-gradient(circle at 20% 90%, rgba(139, 111, 71, 0.06) 0%, transparent 50%);
    
    /* Text colors */
    --text-primary: #2c3e50;
    --text-secondary: #34495e;
    --text-accent: #8b6f47;
    
    /* Sacred geometry colors */
    --mandala-primary: rgba(212, 175, 55, 0.15);
    --mandala-secondary: rgba(45, 90, 135, 0.1);
    --mandala-accent: rgba(139, 111, 71, 0.08);
    
    /* Shadows and depth */
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.15);
    
    /* Legacy compatibility */
    --teal: var(--primary-teal);
    --tan: var(--primary-earth);
    --gold: var(--primary-gold);
    --background: #faf8f3;
    --text: var(--text-primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: var(--background-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-secondary);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.3'%3E%3Ccircle cx='100' cy='100' r='80'/%3E%3Ccircle cx='100' cy='100' r='60'/%3E%3Ccircle cx='100' cy='100' r='40'/%3E%3Ccircle cx='100' cy='100' r='20'/%3E%3Cpath d='M100 20 L100 180 M20 100 L180 100 M141.42 58.58 L58.58 141.42 M58.58 58.58 L141.42 141.42'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='150' height='150' viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%238b6f47' stroke-width='0.3' opacity='0.2'%3E%3Cpolygon points='75,15 95,55 135,55 105,80 115,120 75,95 35,120 45,80 15,55 55,55'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%234a8bb8' opacity='0.15'%3E%3Ccircle cx='20' cy='20' r='2'/%3E%3Ccircle cx='80' cy='80' r='2'/%3E%3Ccircle cx='50' cy='50' r='1'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 400px 400px, 300px 300px, 150px 150px;
    background-position: 0 0, 100px 100px, 200px 50px;
    animation: float 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-10px) translateX(5px); }
    50% { transform: translateY(-5px) translateX(-5px); }
    75% { transform: translateY(-15px) translateX(3px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 40px 0;
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
}

.header::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--mandala-primary) 0%, var(--mandala-secondary) 50%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 1; }
}

h1 {
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--primary-teal);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

h2 {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-accent);
    margin-bottom: 20px;
    font-style: italic;
    letter-spacing: 0.5px;
}

p.intro {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(5px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
}

p.intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold), var(--accent-gold));
}

.language-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    gap: 15px;
}

.language-btn {
    background: linear-gradient(135deg, var(--primary-earth), var(--secondary-earth));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.language-btn:hover::before {
    left: 100%;
}

.language-btn:hover, .language-btn.active {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.prakritis-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.prakriti-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 320px;
    box-shadow: var(--shadow-medium);
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
}

.prakriti-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold), var(--accent-gold));
}

.prakriti-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-heavy);
}

.prakriti-card.vata {
    border-top: 4px solid var(--vata-color);
}

.prakriti-card.vata::before {
    background: linear-gradient(90deg, #87ceeb, #b0e0e6, #87ceeb);
}

.prakriti-card.pitta {
    border-top: 4px solid var(--pitta-color);
}

.prakriti-card.pitta::before {
    background: linear-gradient(90deg, #ff6b35, #ff8c42, #ff6b35);
}

.prakriti-card.kapha {
    border-top: 4px solid var(--kapha-color);
}

.prakriti-card.kapha::before {
    background: linear-gradient(90deg, #228b22, #32cd32, #228b22);
}

.prakriti-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Added to ensure images stay within the circular container */
}

.prakriti-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* We can keep these background colors as fallbacks in case images don't load */
.vata .prakriti-icon {
    background-color: var(--vata-color);
}

.pitta .prakriti-icon {
    background-color: var(--pitta-color);
}

.kapha .prakriti-icon {
    background-color: var(--kapha-color);
}

.prakriti-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-teal);
    font-weight: 400;
    letter-spacing: 0.5px;
    position: relative;
}

.prakriti-card h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.prakriti-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-top: 15px;
}

.start-btn {
    display: block;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    color: white;
    border: none;
    padding: 18px 45px;
    margin: 30px auto 50px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.start-btn:hover::before {
    left: 100%;
}

.start-btn:hover {
    background: linear-gradient(135deg, var(--secondary-teal), var(--accent-teal));
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

/* Quiz styles */
.quiz-container {
    display: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 40px;
    max-width: 900px;
    margin: 30px auto;
    box-shadow: var(--shadow-heavy);
    position: relative;
    border: 1px solid rgba(255,255,255,0.3);
}

.quiz-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--mandala-accent) 0%, var(--mandala-secondary) 30%, transparent 60%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-earth), var(--primary-gold), var(--primary-teal));
    width: 0;
    transition: width 0.5s ease;
    border-radius: 10px;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.question-count {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--teal);
}

.question {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.option {
    background: #fff;
    border: 2px solid var(--tan);
    border-radius: 10px;
    padding: 15px;
    width: 100%;
    max-width: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.option:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.option.selected {
    border-color: var(--teal);
    background-color: rgba(84, 144, 160, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.option-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    margin: 0 auto 12px auto;
    background-color: #f0f0f0;
    transition: opacity 0.3s ease;
    display: block;
    flex-shrink: 0;
}

.option-image:hover {
    opacity: 0.9;
}

/* Styling for fallback images */
.image-fallback .option-image {
    opacity: 0.7;
    border: 2px dashed rgba(139, 111, 71, 0.3);
}

.option-text {
    font-size: 1rem;
    color: var(--text);
    margin-top: auto;
    padding-top: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.nav-btn {
    background-color: var(--teal);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: #477d8c;
}

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Results styles */
.results-container {
    display: none;
    max-width: 900px;
    margin: 20px auto;
    text-align: center;
}

.results-title {
    font-size: 2.5rem;
    color: var(--teal);
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.results-chart-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.pie-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    max-width: 350px;
    overflow: visible;
}

.pie-chart svg {
    width: 100%;
    height: auto;
    transition: all 0.5s ease;
    max-height: 350px;
}

.chart-legend {
    font-size: 14px;
    font-weight: 500;
}

.results-interpretation {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.results-interpretation h3 {
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.results-interpretation p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 15px;
}

.result-prakriti-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.restart-btn {
    display: inline-block;
    background-color: var(--teal);
    color: white;
    border: none;
    padding: 15px 40px;
    margin: 20px auto;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.restart-btn:hover {
    background-color: #477d8c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

/* Logo */
.logo-container {
    display: block;
    width: 280px;
    height: auto;
    margin: 0 auto 30px;
}

.logo-image {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 15px 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .logo-container {
        width: 220px;
        height: auto;
        margin: 0 auto 15px;
    }
    
    .logo-image {
        max-height: 90px;
    }

    .prakritis-info {
        flex-direction: column;
        align-items: center;
    }

    .prakriti-card {
        width: 100%;
        max-width: 320px;
        padding: 15px;
    }

    .quiz-container {
        padding: 15px 10px;
        margin: 10px auto;
    }

    .question {
        font-size: 1.1rem;
        margin-bottom: 15px;
        padding: 0 5px;
    }

    .options {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
    }

    .option {
        max-width: 280px;
        padding: 12px;
        min-height: 180px;
    }

    .option-image {
        max-height: 120px;
        margin-bottom: 8px;
    }

    .option-text {
        font-size: 0.85rem;
        padding: 0 2px;
    }

    .navigation {
        margin-top: 15px;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Additional mobile optimization for very small screens */
@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    p.intro {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .question {
        font-size: 1rem;
        padding: 0 2px;
        margin-bottom: 12px;
    }

    .option {
        max-width: 240px;
        min-height: 160px;
    }

    .option-image {
        max-height: 100px;
    }

    .option-text {
        font-size: 0.8rem;
    }

    .question-count {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .results-title {
        font-size: 1.6rem;
    }

    .results-interpretation h3 {
        font-size: 1.3rem;
    }

    .results-interpretation p {
        font-size: 0.95rem;
    }

    .start-btn, .restart-btn {
        padding: 12px 25px;
        font-size: 1.1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Loading spinner */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(84, 144, 160, 0.3);
    border-radius: 50%;
    border-top-color: var(--teal);
    animation: spin 1s ease-in-out infinite;
}

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

/* Pie chart animation */
@keyframes drawPie {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.pie-chart svg {
    animation: drawPie 1s ease-out forwards;
}