* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 700px;
    width: 100%;
    background: white;
    border-radius: 8px;
    border: 2px solid #4a7c59;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 500px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 20px;
}

.logo-container {
    margin-bottom: 15px;
}

.logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-size: 1.8em;
    color: #2d5a3d;
    margin-bottom: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.info-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #4a7c59;
    color: white;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.info-btn:hover {
    background: #3d6549;
    transform: scale(1.1);
}

.subtitle {
    color: #666;
    font-size: 1em;
}

.quiz-container {
    margin-top: 20px;
    position: relative;
    min-height: 400px;
}

/* Progress Indicator */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #4a7c59;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 7.69%; /* 1/13 */
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    font-weight: 600;
}

/* Question Pages */
.question-page {
    display: none;
    animation: fadeIn 0.4s ease-in;
    min-height: 350px;
}

.question-page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.question-page.slide-out {
    animation: fadeOut 0.3s ease-out;
}

.question-number {
    font-size: 1.2em;
    font-weight: bold;
    color: #4a7c59;
    margin-bottom: 15px;
    text-align: center;
}

.question-label {
    display: block;
    font-weight: 600;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.4;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.option {
    display: flex;
    align-items: center;
    padding: 15px 15px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #ddd;
    margin: 0;
    font-weight: normal;
    font-size: 1em;
    color: #333;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.option * {
    font-weight: normal;
    font-size: 1em;
    color: #333;
}

.option:hover {
    background: #f0f0f0;
    border-color: #4a7c59;
    transform: translateX(5px);
}

.option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4a7c59;
    flex-shrink: 0;
}

.option:has(input[type="radio"]:checked) {
    background: #e8f5e9;
    border-color: #4a7c59;
    font-weight: 600;
    transform: translateX(5px);
}

.option:has(input[type="radio"]:checked) * {
    font-weight: 600;
}

.additional-input {
    width: 100%;
    padding: 15px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    min-height: 120px;
    background: white;
    margin-bottom: 30px;
}

.additional-input:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.additional-input::placeholder {
    color: #999;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.nav-btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 600;
    color: white;
    background: #4a7c59;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.nav-btn:hover {
    background: #3d6549;
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: translateY(0);
}

.prev-btn {
    background: #6c757d;
}

.prev-btn:hover {
    background: #5a6268;
}

.submit-btn {
    background: #4a7c59;
}

.result-container {
    text-align: center;
    padding: 30px 20px;
}

.hidden {
    display: none !important;
}

.loading {
    padding: 40px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a7c59;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 1em;
}

.result-content {
    margin-top: 20px;
    animation: fadeIn 0.6s ease-in;
}

.fruit-display {
    margin-bottom: 30px;
    padding: 30px;
    background: #4a7c59;
    border-radius: 8px;
    color: white;
}

.fruit-emoji {
    font-size: 6em;
    margin-bottom: 15px;
    display: inline-block;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.fruit-display h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.fruit-description {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 5px;
    margin-bottom: 25px;
    text-align: left;
    line-height: 1.6;
    border: 1px solid #ddd;
}

.fruit-description p {
    font-size: 1em;
    color: #333;
    white-space: pre-wrap;
}

.personality-insights {
    background: #f0f7f4;
    padding: 25px;
    border-radius: 5px;
    margin-bottom: 25px;
    text-align: left;
    border: 1px solid #4a7c59;
    border-left: 4px solid #4a7c59;
}

.personality-insights h3 {
    color: #2d5a3d;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.personality-insights ul {
    list-style: none;
    padding: 0;
}

.personality-insights li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #333;
    line-height: 1.6;
}

.personality-insights li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4a7c59;
    font-weight: bold;
    font-size: 1.2em;
}

.fruit-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.fruit-facts,
.fruit-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    text-align: left;
    border: 1px solid #ddd;
}

.fruit-facts h3,
.fruit-info h3 {
    color: #2d5a3d;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 8px;
}

.fruit-facts ul {
    list-style: none;
    padding: 0;
}

.fruit-facts li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #333;
    line-height: 1.5;
}

.fruit-facts li:before {
    content: "🍎";
    position: absolute;
    left: 0;
}

.fruit-info p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.retry-btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 600;
    color: white;
    background: #4a7c59;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #3d6549;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 30px;
    border: 2px solid #4a7c59;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
}

.modal-close:hover {
    color: #4a7c59;
}

.modal-body h3 {
    color: #2d5a3d;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.modal-body p {
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.modal-body strong {
    color: #4a7c59;
}

/* Fruit Compatibility */
.fruit-compatibility {
    background: #f0f7f4;
    padding: 25px;
    border-radius: 5px;
    margin-bottom: 25px;
    text-align: left;
    border: 1px solid #4a7c59;
    border-left: 4px solid #4a7c59;
}

.fruit-compatibility h3 {
    color: #2d5a3d;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#compatibility-content {
    color: #333;
    line-height: 1.6;
}

/* Organization Stats */
.organization-stats {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 5px;
    margin-bottom: 25px;
    text-align: left;
    border: 1px solid #ddd;
}

.organization-stats h3 {
    color: #2d5a3d;
    margin-bottom: 20px;
    font-size: 1.2em;
    text-align: center;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
    text-align: center;
}

.stat-card h4 {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    font-weight: normal;
}

.stat-number {
    color: #4a7c59;
    font-size: 1.8em;
    font-weight: bold;
}

.chart-container {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.traits-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.traits-section h4 {
    color: #2d5a3d;
    margin-bottom: 15px;
    font-size: 1.1em;
}

#common-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trait-badge {
    background: #e8f5e9;
    color: #2d5a3d;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid #4a7c59;
}

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

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .fruit-emoji {
        font-size: 4em;
    }
    
    .fruit-display h2 {
        font-size: 1.6em;
    }

    .fruit-details {
        grid-template-columns: 1fr;
    }

    .question-label {
        font-size: 1.1em;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}
