/* Plant Quiz Game - CSS Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Marker Felt', 'Chalkboard SE', cursive, sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    color: #333;
}

.container {
    max-width: 800px;
    width: 90%;
    margin: 20px auto;
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 8px solid #8bc34a;
}

.screen {
    display: none;
    padding: 30px;
    min-height: 500px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen.active {
    display: flex;
}

/* Welcome Screen Styles */
.welcome-content {
    text-align: center;
    padding: 20px;
}

.welcome-content h1 {
    color: #2e7d32;
    font-size: 2.8rem;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.1);
    animation: float 3s ease-in-out infinite;
    background: linear-gradient(45deg, #4caf50, #8bc34a, #4caf50);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient 3s ease infinite, float 3s ease-in-out infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.welcome-content p {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #555;
    font-weight: bold;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
}

.instructions {
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    font-size: 1.1rem;
    color: #2e7d32;
    border: 3px dashed #8bc34a;
    animation: pulse 2s infinite;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.plant-illustration {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(145deg, #f1f8e9, #dcedc8);
    border-radius: 20px;
    border: 4px solid #a5d6a7;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

#start-btn, #restart-btn {
    background: linear-gradient(to right, #4caf50, #8bc34a);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.4rem;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    font-weight: bold;
    letter-spacing: 1px;
}

#start-btn:hover, #restart-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

#start-btn:active, #restart-btn:active {
    transform: translateY(2px);
}

/* Add animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 195, 74, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(139, 195, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 195, 74, 0); }
}

/* Quiz Screen Styles */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 3px solid #a5d6a7;
    width: 100%;
    background: #e8f5e9;
    border-radius: 10px;
}

.progress {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    margin-right: 20px;
}

#question-counter {
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a, #4caf50);
    background-size: 200% 100%;
    width: 0%;
    transition: width 1s ease;
    animation: progressAnimation 2s linear infinite;
}

@keyframes progressAnimation {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.score {
    font-weight: bold;
    color: #2e7d32;
    font-size: 1.4rem;
    background: #c8e6c9;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #8bc34a;
}

.question-container {
    text-align: center;
    width: 100%;
    padding: 10px;
}

.explanation-container {
    margin-top: 20px;
    padding: 15px;
    background: #f1f8e9;
    border-radius: 15px;
    border: 2px solid #c5e1a5;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    font-size: 1.2rem;
    color: #2e7d32;
    font-weight: bold;
}

.question {
    margin-bottom: 25px;
    padding: 20px;
    background: #f1f8e9;
    border-radius: 15px;
    border: 2px solid #c5e1a5;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.question p {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #2e7d32;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    border-left: 5px solid #4caf50;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.option-btn {
    background: linear-gradient(145deg, #f1f8e9, #e8f5e9);
    border: 3px solid #c5e1a5;
    padding: 14px 24px;
    font-size: 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

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

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

.option-btn:hover {
    background: linear-gradient(145deg, #dcedc8, #c8e6c9);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.option-btn:active {
    transform: translateY(1px);
}

.option-btn.correct {
    background: linear-gradient(145deg, #c8e6c9, #a5d6a7);
    border-color: #4caf50;
    color: #2e7d32;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}

.option-btn.incorrect {
    background: linear-gradient(145deg, #ffcdd2, #f8bbd0);
    border-color: #f44336;
    color: #c62828;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.6);
}

.svg-container, .image-container {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #a5d6a7;
}

.svg-container svg {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.drag-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.draggable-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.draggable-item {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    padding: 12px 18px;
    border-radius: 12px;
    margin: 5px;
    cursor: grab;
    user-select: none;
    border: 3px solid #64b5f6;
    min-width: 100px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.draggable-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.draggable-item.dragging {
    opacity: 0.8;
    transform: scale(1.1) rotate(5deg);
    cursor: grabbing;
}

.draggable-image {
    max-width: 100%;
    max-height: 50px;
    display: block;
    margin: 0 auto;
}

.svg-area {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    padding: 10px;
    background: rgba(241, 248, 233, 0.7);
    border-radius: 15px;
}

.drop-zones {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    margin-top: 15px;
}

.drop-zone {
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    border: 3px dashed #a5d6a7;
    padding: 18px;
    border-radius: 15px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.drop-zone.hover {
    background: linear-gradient(145deg, #c8e6c9, #a5d6a7);
    border-style: solid;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.drop-zone p.correct {
    color: #2e7d32;
    font-weight: bold;
    font-size: 1.2rem;
    animation: celebrate 0.6s ease;
}

.drop-zone p.incorrect {
    color: #c62828;
    font-weight: bold;
    font-size: 1.2rem;
}

.matching-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(241, 248, 233, 0.5);
    border-radius: 20px;
    border: 2px solid #c5e1a5;
}

.plant-items, .seed-items {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 10px;
}

.match-item {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    padding: 14px 20px;
    border-radius: 15px;
    margin: 5px;
    min-width: 140px;
    text-align: center;
    cursor: move;
    font-weight: bold;
    border: 2px solid #64b5f6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.match-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.match-item.drop-zone {
    cursor: pointer;
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    border: 2px dashed #4caf50;
}

.match-item.drop-zone.hover {
    background: linear-gradient(145deg, #c8e6c9, #a5d6a7);
    transform: scale(1.05);
}

.match-item.correct {
    background: linear-gradient(145deg, #c8e6c9, #a5d6a7);
    color: #2e7d32;
    font-weight: bold;
    border-color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.match-item.incorrect {
    background: linear-gradient(145deg, #ffcdd2, #f8bbd0);
    color: #c62828;
    font-weight: bold;
    border-color: #f44336;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
}

.match-line {
    height: 4px;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    flex-grow: 1;
    margin: 0 10px;
    border-radius: 2px;
    align-self: center;
}

/* Results Screen Styles */
.results-content {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.results-content h2 {
    color: #2e7d32;
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: celebrate 0.6s ease infinite alternate;
}

@keyframes celebrate {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.final-score {
    font-size: 2rem;
    margin-bottom: 25px;
    color: #2e7d32;
    font-weight: bold;
    background: white;
    padding: 15px 30px;
    border-radius: 25px;
    border: 4px solid #4caf50;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.achievement {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 20px;
    border: 3px solid #8bc34a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 80%;
    max-width: 400px;
}

#achievement-message {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #2e7d32;
    font-weight: bold;
    line-height: 1.5;
}

.plant-badge {
    margin: 20px 0;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 50%;
    border: 5px solid #8bc34a;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Feedback animations */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    80% { transform: translateY(-10px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        width: 95%;
        margin: 10px auto;
    }
    
    .screen {
        padding: 15px;
    }

    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }

    #start-btn, #restart-btn {
        padding: 15px 30px;
        font-size: 1.2rem;
    }

    .quiz-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress {
        align-items: center;
    }
    
    .question p {
        font-size: 1.2rem;
    }
    
    .options {
        gap: 8px;
    }
    
    .option-btn {
        padding: 10px 15px;
        font-size: 1rem;
    }

    .final-score {
        font-size: 1.5rem;
    }

    #achievement-message {
        font-size: 1.2rem;
    }

    .explanation-container {
        font-size: 1rem;
    }
}

/* Back link */
footer {
    text-align: center;
    padding: 20px;
}

.back-link {
    display: inline-block; /* Make it behave like a block for padding/margin */
    background: linear-gradient(to right, #66bb6a, #81c784); /* Lighter green gradient */
    color: white;
    border: none;
    padding: 12px 25px; /* Slightly smaller padding than main buttons */
    font-size: 1.1rem; /* Slightly smaller font size */
    border-radius: 30px; /* Rounded corners */
    cursor: pointer;
    margin-top: 20px; /* Add some top margin */
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Subtle shadow */
    font-weight: bold;
    letter-spacing: 0.5px;
    text-decoration: none; /* Remove underline */
}

.back-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    background: linear-gradient(to right, #4caf50, #66bb6a); /* Slightly darker on hover */
}

.back-link:active {
    transform: translateY(1px);
}
