/* Global Styles */
* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #ccc #fff;
}

/* style.css */
body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column; /* add this */
    align-items: center;    /* centers items horizontally */
    justify-content: flex-start; 
    min-height: 100vh;
    margin: 0;
    padding: 20px 20px 80px; /* Extra bottom padding for footer */
    background: linear-gradient(270deg, #ff9a9e, #fad0c4, #fbc2eb, #a6c1ee, #f6d365);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    overflow-x: hidden;
}

/* Animated gradient background */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.quiz-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
    margin: 20px auto;
    /* Remove max-height and overflow-y to fit all content without scroll */
    margin-top: 100px; /* Adjust this value as needed, based on your header's height */
}

/* Custom Scrollbar Styles for Quiz Container */
.quiz-container::-webkit-scrollbar {
    width: 10px;
}

.quiz-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.quiz-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.quiz-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

/* Typography */
h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.description {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

/* Question styling */
.question {
    margin-bottom: 20px;
    text-align: left;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question p {
    font-size: 16px;
    color: #444;
    margin-bottom: 10px;
}

/* Answer labels styling */
label {
    display: block;
    margin: 10px 0;
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

label:hover {
    background-color: #e0f7fa;
    transform: translateX(5px);
}

input[type="radio"] {
    margin-right: 10px;
}

/* Submit Button */
button {
    margin-top: 20px;
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Hidden elements */
.hidden {
    display: none;
}

/* Result display */
#result {
    margin-top: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.result-text {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-top: 10px;
}

/* Footer styling */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #666;
    z-index: 10;
}

footer p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

footer a {
    color: #4CAF50;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

footer a:hover {
    color: #45a049;
    text-decoration: underline;
}

footer img {
    vertical-align: middle;
    height: 20px;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 10px;
}
.language-switcher button {
    padding: 12px 20px; /* Increase padding for larger touch target */
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.language-switcher button:hover {
    background: #f5f5f5;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.language-switcher button:active {
    background: #e0e0e0; /* Visual feedback on press */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .quiz-container {
        padding: 15px;
        max-width: 95%;
        margin-top: 60px; /* reduced top margin for mobile */
        margin-bottom: 20px; /* add bottom margin for spacing */
        box-sizing: border-box; /* Ensure padding is included in the width */
    }
    
    h1 {
        font-size: 22px;
    }
    
    .description, .result-text, .header-quote {
        font-size: 14px;
    }

    .language-switcher button {
        padding: 10px 16px; /* Adjust padding for smaller screens */
        font-size: 14px;
    }
    
    .site-header {
        padding: 10px 20px;
    }
    
    /* Adjust rating labels for smaller screens */
    .rating-options label {
        width: 32px;
        height: 32px;
    }
    
    .rating-options span {
        font-size: 12px;
    }
    
    /* Ensure randomized questions container fits */
    #randomized-questions {
        display: flex;
        flex-direction: column;
    }

    /* Acknowledgment section adjustments */
    .acknowledgment {
        padding: 15px;
        font-size: 12px;
        margin: 20px auto 10px;
        box-sizing: border-box; /* Ensure padding is included in the width */
        margin-top: 20px; /* Add margin-top to create space above */
    }

    /* Ensure submit button is visible */
    button[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        box-sizing: border-box; /* Ensure padding is included in the width */
    }
}

/* Rating Options Container */
.rating-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

/* Style rating labels as circular buttons */
.rating-options label {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

/* Hide the radio input visually */
.rating-options input[type="radio"] {
    display: none;
}

/* Rating option text styling */
.rating-options span {
    font-size: 16px;
    font-weight: bold;
    pointer-events: none;
    color: #444;
}

/* Hover state for labels: add slight rotation for cool effect */
.rating-options label:hover {
    background-color: #e0f7fa;
    border-color: #4CAF50;
    transform: rotate(5deg) scale(1.05);
}

/* Active state for labels: pulse effect on click */
.rating-options label:active {
    animation: pulse 0.4s ease-out;
}

/* Selected (clicked) state using modern :has() pseudo-class */
.rating-options label:has(input:checked) {
    background-color: #4CAF50;
    border-color: #4CAF50;
    transform: scale(1.1);
}
.rating-options label:has(input:checked) span {
    color: #fff;
}

/* Pulse animation keyframes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Acknowledgment segment styling */
.acknowledgment {
    margin: 30px auto 10px;
    padding: 20px;
    max-width: 500px;
    background: #f0f8ff;
    border-left: 4px solid #4CAF50;
    border-radius: 5px;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1s ease-in-out;
    position: relative; /* Ensure it stays in the document flow */
    margin-top: 20px; /* Add margin-top to create space above */
}

/* Scrollbar Effect */

/* For WebKit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fff;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Updated Cool, Auto-Hiding White Header with Cat Logo and Custom Shape */
.site-header {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* Fixed for auto-hiding */
    top: 0;
    left: 0;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid rgba(200, 200, 200, 0.7);
    transition: transform 0.3s ease-in-out, filter 0.3s ease;
    transform: translateY(0); /* Visible by default */
    filter: brightness(0.95);
    /* Custom shape: angled bottom edge */
    clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
    pointer-events: auto; /* Enable interactions */
}

/* When header should become visible */
.site-header.visible {
    transform: translateY(0);
    filter: brightness(1);
    pointer-events: auto; /* Enable interactions when visible */
}

/* New styling for the quote in the header */
.header-quote {
    flex: 1;
    text-align: center;
    margin: 0 20px;
    font-style: italic;
    font-size: 14px;
    color: #555;
}

/* Optionally, add an animation for the header glow */
@keyframes headerGlow {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.05); }
    100% { filter: brightness(1); }
}

/* Logo styling with playful hover effect remains unchanged */
.site-header .logo svg {
    height: 60px;
    transition: transform 0.3s ease, filter 0.3s ease;
}
.site-header .logo svg:hover {
    transform: rotate(10deg) scale(1.1);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}

/* Extra decorative detail: patterned bottom border */
.site-header::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(90deg, rgba(200,200,200,0.6), rgba(200,200,200,0.6) 5px, transparent 5px, transparent 10px);
}

/* Enhanced Responsive adjustments */
@media (max-width: 600px) {
    .quiz-container {
        padding: 15px;
        max-width: 95%;
        margin-top: 60px; /* reduced top margin for mobile */
        margin-bottom: 20px; /* add bottom margin for spacing */
        box-sizing: border-box; /* Ensure padding is included in the width */
    }
    
    h1 {
        font-size: 22px;
    }
    
    .description, .result-text, .header-quote {
        font-size: 14px;
    }

    .language-switcher button {
        padding: 10px 16px; /* Adjust padding for smaller screens */
        font-size: 14px;
    }
    
    .site-header {
        padding: 10px 20px;
    }
    
    /* Adjust rating labels for smaller screens */
    .rating-options label {
        width: 32px;
        height: 32px;
    }
    
    .rating-options span {
        font-size: 12px;
    }
    
    /* Ensure randomized questions container fits */
    #randomized-questions {
        display: flex;
        flex-direction: column;
    }

    /* Acknowledgment section adjustments */
    .acknowledgment {
        padding: 15px;
        font-size: 12px;
        margin: 20px auto 10px;
        box-sizing: border-box; /* Ensure padding is included in the width */
        margin-top: 20px; /* Add margin-top to create space above */
    }

    /* Ensure submit button is visible */
    button[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        box-sizing: border-box; /* Ensure padding is included in the width */
    }
}
