@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scrollbars during animation */
}

.survey-container {
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-sizing: border-box; /* Include padding in width calculation */
    overflow: hidden; /* Clip animations */
}

#survey-title {
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
}

/* Wrapper needed to create a clipping mask for the sliding */
.question-area-wrapper {
    position: relative; /* Establishes positioning context */
    min-height: 100px; /* Give it some minimum height */
    margin-bottom: 40px;
    overflow: hidden; /* This hides the sliding content */
}

.question-area {
    position: relative; /* Allows absolute positioning inside if needed, easier for transforms */
    width: 100%;
    transition: transform 0.5s ease-in-out, opacity 0.4s ease-in-out; /* Smooth transition */
}

#question-text {
    font-size: 1.5em; /* Make question text larger */
    color: #555;
    min-height: 60px; /* Prevent layout jumps */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    font-weight: 600;
}

.button-area {
    display: flex;
    justify-content: space-around; /* Space out buttons */
    margin-top: 20px;
    gap: 20px; /* Add space between buttons */
}

.survey-button {
    padding: 20px 0; /* Tall buttons */
    width: 45%; /* Buttons take up significant width */
    font-size: 1.8em; /* Big text */
    font-weight: 700;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.survey-button.yes {
    background-color: #4CAF50; /* Green */
}

.survey-button.no {
    background-color: #A79B94; /* Brown */
}

.survey-button:hover {
    opacity: 0.9;
    transform: translateY(-3px); /* Slight lift on hover */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.survey-button:active {
    transform: translateY(1px); /* Push down on click */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- Animation Classes --- */

/* Slide Out Left */
.question-area.slide-out {
    transform: translateX(-150%); /* Move far left */
    opacity: 0;
}

/* Slide In Right (as the new question) */
.question-area.slide-in {
    transform: translateX(0); /* Start far right */
    opacity: 1; /* Start fully transparent */
}

/* Initial state for slide-in (before animation starts) */
.question-area.next-question-setup {
    transform: translateX(150%);
    opacity: 0;
    /* Position it off-screen immediately, ready to slide in */
    /* We'll remove this class quickly to trigger the transition */
}


/* Completion Message Styling */
.completion-message {
    margin-top: 40px;
    padding: 20px;
    background-color: #e6f4ea; /* Light green background */
    border-radius: 8px;
    border: 1px solid #c8e6c9; /* Soft green border */
    color: #2e7d32; /* Darker green text */
    opacity: 0; /* Start hidden */
    transform: translateY(20px); /* Start slightly lower */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.completion-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide buttons when complete */
.button-area.hidden {
    display: none;
}


/* Completion Message Styling */
.completion-message {
    margin-top: 40px;
    padding: 30px; /* Increased padding */
    background-color: #e6f4ea;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.completion-message.show {
    opacity: 1;
    transform: translateY(0);
}

.completion-message h2 {
    margin-bottom: 15px;
    color: #1b5e20; /* Darker green for heading */
}

.results-summary {
    display: flex;
    justify-content: center;
    gap: 30px; /* Space between yes/no counts */
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.result-count {
    padding: 10px 15px;
    border-radius: 6px;
    background-color: #ffffff; /* White background for contrast */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.result-count strong {
    font-size: 1.3em;
    margin-left: 5px;
}

.yes-count {
    color: #388e3c; /* Green text */
    border-left: 5px solid #4CAF50;
}

.no-count {
    color: #d32f2f; /* Red text */
    border-left: 5px solid #f44336;
}

.share-button {
    display: inline-block; /* Allow margin auto */
    margin-top: 25px;
    padding: 12px 25px;
    background-color: #1976D2; /* Blue share button */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-button:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
}

.share-button:active {
    transform: translateY(0);
    background-color: #0D47A1;
}

.share-fallback {
    margin-top: 15px;
    font-size: 0.9em;
    color: #555;
    background-color: #eee;
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed #ccc;
    word-wrap: break-word; /* Ensure long text wraps */
}

/* Hide buttons when complete */
.button-area.hidden {
    display: none;
}