:root {
    --primary-color: #4AA3DF;
    /* Bright Blue */
    --secondary-color: #FCC916;
    /* Bright Yellow */
    --accent-color: #E74C3C;
    /* Bright Red */
    --background-color: #F0F8FF;
    /* Alice Blue */
    --text-color: #333333;
    --font-heading: 'Fredoka One', cursive;
    --font-body: 'Comic Neue', cursive;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}

h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 0px var(--secondary-color);
    margin-bottom: 10px;
}

.slogan {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: bold;
}

.search-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
}

#search-form {
    display: flex;
    gap: 10px;
}

#search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 3px solid var(--primary-color);
    border-radius: 50px;
    font-family: var(--font-body);
    outline: none;
    transition: box-shadow 0.3s ease;
}

#search-input:focus {
    box-shadow: 0 0 10px rgba(74, 163, 223, 0.5);
}

#search-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 3px solid #E5B700;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: transform 0.1s ease;
}

#search-button:hover {
    transform: scale(1.05);
    background-color: #FFE066;
}

#search-button:active {
    transform: scale(0.95);
}

.results-area {
    width: 100%;
    min-height: 60px;
    margin-bottom: 30px;
    text-align: center;
}

.error-message {
    background-color: #FFCDD2;
    color: #C62828;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.3rem;
    border: 2px dashed #EF9A9A;
    font-weight: bold;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    50% {
        transform: translateX(10px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.mascot-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

#mascot-image {
    width: 300px;
    height: auto;
    max-width: 100%;
    /* Placeholder style if image missing */
    object-fit: contain;
}

.speech-bubble {
    background: #fff;
    border: 4px solid var(--text-color);
    border-radius: 30px;
    padding: 20px;
    position: relative;
    max-width: 300px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.1);
}

.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border: 20px solid transparent;
    border-top-color: var(--text-color);
    border-bottom: 0;
    margin-left: -20px;
    margin-bottom: -4px;
}

/* Inner triangle for bubble border effect */
.speech-bubble:before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    border: 17px solid transparent;
    border-top-color: #fff;
    border-bottom: 0;
    margin-left: -17px;
    z-index: 1;
}

#mascot-text {
    font-size: 1.1rem;
    font-weight: bold;
}

footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 20px;
    /* Space for home indicator on mobile */
}

/* Mobile Optimization */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .slogan {
        font-size: 1rem;
    }

    #search-form {
        flex-direction: column;
        gap: 15px;
    }

    #search-input,
    #search-button {
        width: 100%;
        font-size: 1.1rem;
        padding: 12px;
    }

    .mascot-container {
        margin-top: 10px;
    }

    #mascot-image {
        width: 250px;
    }

    .speech-bubble {
        padding: 15px;
        font-size: 0.9rem;
    }
}

/* --- Cookie Popup Styles --- */
#cookie-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#cookie-popup.hidden {
    display: none;
}

.popup-content {
    background-color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 95%;
    width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cookie-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

#cookie-mascot-container img {
    width: 120px;
    /* Much smaller image */
    height: auto;
    margin-top: -10px;
    /* Pull closer to bubble */
}

/* Override/Adjust speech bubble for popup context */
#cookie-text-container.speech-bubble {
    font-size: 1.1rem;
    padding: 15px;
    max-width: 100%;
    margin-bottom: 25px;
    /* Space for tail */
}

#cookie-text {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn-red-large {
    background-color: #ff4757;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 0 #c0392b;
    transition: transform 0.1s;
    width: 100%;
}

.btn-red-large:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #c0392b;
}

.btn-blue-small {
    background-color: transparent;
    color: var(--primary-color);
    border: none;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Close Button (X) */
#cookie-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

#cookie-close:hover {
    color: #ff4757;
}

#cookie-close.hidden {
    display: none;
}