/* ============================================================
   AI PLANT QUIZ MASTER — Premium CSS
   Modern, Immersive Quiz Experience
   ============================================================ */

:root {
    --primary: #00A651;
    --primary-dark: #006b33;
    --primary-light: #00d46a;
    --accent: #66BB6A;
    --gold: #f59e0b;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-green: linear-gradient(135deg, #00A651 0%, #00d46a 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 24px 72px rgba(0, 0, 0, 0.2);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Body & Background --- */
.quiz-body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.quiz-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-leaf {
    position: absolute;
    font-size: 24px;
    color: var(--primary);
    opacity: 0.15;
    animation: floatLeaf 20s infinite ease-in-out;
}

.leaf-1 { top: 10%; left: 10%; animation-delay: 0s; }
.leaf-2 { top: 50%; right: 15%; animation-delay: 7s; }
.leaf-3 { bottom: 15%; left: 20%; animation-delay: 14s; }

@keyframes floatLeaf {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(90deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    75% { transform: translateY(-40px) rotate(270deg); }
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: pulseOrb 15s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-green);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-3);
    bottom: -50px;
    left: -50px;
    animation-delay: 5s;
}

@keyframes pulseOrb {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

/* --- Quiz Container --- */
.quiz-container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.quiz-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary);
}

.quiz-logo i {
    font-size: 28px;
    animation: rotateLeaf 10s infinite linear;
}

@keyframes rotateLeaf {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quiz-progress {
    flex: 1;
    max-width: 400px;
    margin-left: 40px;
}

.progress-bar {
    height: 8px;
    background: rgba(0, 166, 81, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-green);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.question-counter {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}

/* --- Quiz Content --- */
.quiz-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Welcome Screen */
.welcome-screen,
.question-screen,
.loading-screen,
.results-screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.welcome-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 50px 40px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--gradient-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
    animation: bounceIcon 2s infinite;
}

@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.welcome-card h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 15px;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 166, 81, 0.05);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.benefit-item:hover {
    background: rgba(0, 166, 81, 0.1);
    transform: translateY(-3px);
}

.benefit-item i {
    font-size: 24px;
    color: var(--primary);
}

.benefit-item span {
    font-weight: 500;
    color: var(--text-primary);
}

.start-quiz-btn {
    width: 100%;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 166, 81, 0.3);
}

.start-quiz-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 166, 81, 0.4);
}

.time-estimate {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Question Screen */
.question-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.question-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.question-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.question-hint {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-left: 75px;
}

.answer-options {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.answer-btn {
    background: var(--white);
    border: 2px solid rgba(0, 166, 81, 0.2);
    padding: 20px 25px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.answer-btn:hover {
    border-color: var(--primary);
    background: rgba(0, 166, 81, 0.05);
    transform: translateY(-2px);
}

.answer-btn.selected {
    border-color: var(--primary);
    background: rgba(0, 166, 81, 0.1);
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.2);
}

.answer-btn i {
    font-size: 22px;
    color: var(--primary);
    width: 30px;
}

.question-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.nav-btn {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prev-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.prev-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.prev-btn:not(:disabled):hover {
    background: rgba(0, 0, 0, 0.1);
}

.next-btn {
    background: var(--gradient-green);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.3);
}

.next-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 166, 81, 0.4);
}

/* Loading Screen */
.loading-screen {
    text-align: center;
    padding: 60px 20px;
}

.ai-brain-animation {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 40px;
}

.brain-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--gradient-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    animation: pulseBrain 2s infinite;
}

@keyframes pulseBrain {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: var(--primary);
    animation: orbitRotate 8s infinite linear;
}

.orbit-1 {
    width: 120px;
    height: 120px;
    animation-duration: 8s;
}

.orbit-2 {
    width: 160px;
    height: 160px;
    animation-duration: 10s;
    animation-direction: reverse;
}

.orbit-3 {
    width: 200px;
    height: 200px;
    animation-duration: 12s;
}

@keyframes orbitRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(60px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(60px) rotate(-360deg); }
}

.loading-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.loading-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.loading-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    margin: 0 5px;
    animation: bounceDot 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Results Screen */
.results-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.confetti-canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.results-badge {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: var(--gradient-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
    animation: celebrateBadge 1s infinite;
}

@keyframes celebrateBadge {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

.results-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.results-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.plant-profile-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.plant-profile-summary h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-tag {
    padding: 8px 16px;
    background: rgba(0, 166, 81, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.recommended-plants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.plant-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.plant-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.plant-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.plant-info {
    padding: 20px;
}

.plant-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.plant-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.match-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.match-score i {
    color: var(--gold);
}

.view-plant-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.view-plant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.3);
}

.care-tips-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.care-tips-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.care-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.care-tip-card {
    padding: 18px;
    background: rgba(0, 166, 81, 0.05);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.care-tip-card i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 10px;
}

.care-tip-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.care-tip-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.results-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn.primary {
    background: var(--gradient-green);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 166, 81, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 166, 81, 0.4);
}

.action-btn.secondary {
    background: var(--text-primary);
    color: white;
}

.action-btn.outline {
    background: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
}

.action-btn.outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-header {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-progress {
        max-width: 100%;
        margin-left: 0;
    }

    .welcome-card {
        padding: 30px 20px;
    }

    .welcome-card h1 {
        font-size: 28px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .question-card {
        padding: 25px 20px;
    }

    .question-text {
        font-size: 20px;
    }

    .question-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .question-hint {
        padding-left: 0;
    }

    .answer-btn {
        padding: 16px 18px;
    }

    .question-nav {
        flex-direction: column-reverse;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .recommended-plants {
        grid-template-columns: 1fr;
    }

    .results-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 15px 10px;
    }

    .welcome-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .results-badge {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .ai-brain-animation {
        width: 150px;
        height: 150px;
    }

    .brain-core {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}
