body {
    background-color: #ffe06e;
    background-image: url("../img/bg.png");
    background-repeat: repeat;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* Banner for the website */
.banner {
    width: 100%;
    background-color: #f0b36a;
    display: flex;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
    color: #170f06;
    margin-right: auto;
    text-align: center;
}

.banner img {
    display: block;
    margin-left: auto;
    max-height: 80px;
}

.banner h1 {
    font-size: clamp(18px, 5vw, 48px);
    margin: 0;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Navigation Bar */
nav {
    color: #170f06;
    background-color: #f0b36a;
    display: flex;
    justify-content: space-between; /* Distributes links across the width */
    align-items: center;
    padding: 10px;
    border-color: #170f06;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

nav a {
    text-decoration: none;
    color: #170f06;
    border-color: #170f06;
    font-size: 18px;
    padding: 10px 20px;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-grow: 1; /* Makes each link take up equal space */
    text-align: center; /* Centers the text in the link */
}

.right_border {
    border-color: #170f06;
    border-right: 1px solid #170f06;
}

.left_border {
    border-color: #170f06;
    border-left: 1px solid #170f06;;
}

.v_border {
    border-color: #170f06;
    border-top: 1px solid #170f06;
    border-bottom: 1px solid #170f06;
}


nav a:hover {
    background-color: #f4f4f4;
    border-color: #666;
    color: #444;
}

/* Content for the about section */
.about-container {
    max-width: 600px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.about-container h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.about-container p {
    font-size: 18px;
    line-height: 1.6;
}

.about-container .contact-info {
    margin-top: 20px;
    font-size: 16px;
}

form {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

textarea, input, select, button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.joke-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 20px auto 20px;
    padding: 15px;
}

.joke {
    position: relative; /* Required for absolute positioning inside */
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

/* General button styles */
.next-jokes-button {
    padding: 10px 20px;
    font-size: 18px;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: inline-block; /* Make sure the button adjusts to the text */
    margin-top: 2px;
    margin-bottom: 20px;
    text-align: center;
    width: auto; /* Ensure the button adjusts width automatically */
}

/* Hover effect for the button */
.next-jokes-button:hover {
    background-color: #f4f4f4;
    border-color: #666;
    color: #444;
}

.button:hover {
    background-color: #45a049;
    border-color: #366e34;
}

/* ================= New Section for Catchy Info and Joke Submission Form =====================*/
.info-section {
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 20px auto 50px;
    padding: 40px 20px;
    flex-direction: column;
}

.info-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-block {
    background-color: #f0f0f0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.info-section h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.info-section p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-section form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-section input[type="text"],
.info-section textarea {
    width: 60%;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    border: 2px solid #333;
    border-radius: 8px;
    resize: vertical;
}

.info-section button {
    padding: 12px 20px;
    font-size: 18px;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.info-section button:hover {
    background-color: #f4f4f4;
    border-color: #666;
    color: #444;
}

/*------------------------------*/
.category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    max-width: 1000px;
    margin: 40px auto 10px;
    padding: 15px
}

.category-buttons button {
    min-width: 130px; /* sets the max text width baseline */
    text-align: center;
    padding: 10px 16px;
    border: none;
    border-radius: 9999px;
    background-color: #a0d2eb;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.category-buttons button:hover {
    background-color: #79b8e0;
}

.category-buttons button.active {
    background-color: #0077cc;
    color: white;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/*-------------------------------------------*/
.rating {
    font-size: 0.5rem;
    padding: 0;
    margin: 0;
    color: #ccc;
    display: inline-block;
    cursor: pointer;
    border: none;
    border-radius: 0;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
}

.small-margin-bottom {
    margin-bottom: 0;
}

.rating .star {
    transition: color 0.2s;
}

.rating .star.filled {
    color: #f7b500;
}

/* explanation */
.question-btn {
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    align-items: center;
    justify-content: center;
    position: relative;
    display: flex;
    cursor: pointer;
    text-align: right;
    float: right;
    margin: 12px 6px 12px;
}

/* The actual popup (appears on top) */
.question-btn .popuptext {
    visibility: hidden;
    min-width: 160px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px 10px;
    position: absolute;
    z-index: 1;
    bottom: 135%;
    left: -135px;
    margin-left: -80px;
}

/* Popup arrow */
.question-btn .popuptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 95%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Toggle this class when clicking on the popup container (hide and show the popup) */
.question-btn .show {
    visibility: visible;
    -webkit-animation: fadeIn 1s;
    animation: fadeIn 1s
}

.question-btn .hide {
    visibility: hidden;
    -webkit-animation: fadeIn 1s;
    animation: fadeIn 1s
}

/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity:1 ;}
}

/* Add animation (fade in the popup) */
@-webkit-keyframes fadeOut {
    from {opacity: 1;}
    to {opacity: 0;}
}

@keyframes fadeOut {
    from {opacity: 1;}
    to {opacity:0 ;}
}

/*========================= messages bar =================================*/

#message-bar {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    overflow: hidden;
    padding: 0 1rem;
    margin: 0 auto;
    max-width: 800px;
    background-color: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
    border-radius: 8px;
    font-weight: 500;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    transition:
            max-height 0.4s ease,
            opacity 0.4s ease,
            transform 0.4s ease,
            padding 0.4s ease,
            margin-top 0.4s ease;
}

#message-bar.success {
    background-color: #d1fae5;
    border-color: #34d399;
    color: #065f46;
}

#message-bar.show {
    visibility: visible;
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

#message-bar.hiding {
    opacity: 0;
    max-height: 0;
    transform: translateY(-8px);
    padding: 0 1rem;
    margin-top: 0;
    visibility: hidden;
}

#message-text {
    justify-self: center;
}

#close-button {
    background: transparent;
    border: none;
    color: inherit;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    padding-left: 1rem;
    margin-bottom: 10px;
}

/*==============joke header*/
.joke-header {
    display: flex;
    /*justify-content: space-between;*/
    align-items: center;
    margin-bottom: 0.5rem;
    flex-direction: row;
    justify-content: space-between;
}

.joke-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: #444;
    margin: 0;
}

/*================ show/hide answer ===============*/
.joke-punchline.hidden {
    display: none;
}

.joke-punchline {
    margin-top: 0.5rem;
    font-style: italic;
    color: #444;
}

.global-toggle {
    display: flex;
    justify-content: flex-start; /* ⬅️ align to left */
    align-items: flex-start;
    margin: 1rem 1rem 0 1rem;
    max-width: 800px;
    font-weight: 500;
    font-size: 1rem;
}

.checkbox-label {
    align-items: center;
}

.global-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    aspect-ratio: 1;
    margin-right: 1rem;
    cursor: pointer;
    accent-color: #4ade80; /* green tone */
    border-radius: 4px;
}
.global-toggle-label {
    margin-top: 0.5rem;
}

.global-toggle-wrapper {
    border-radius: 0px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0px auto 0px;
    padding: 0px 0px;
    flex-direction: column;
}

.reveal-btn {
    padding: 10px 20px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    background-color: #c9955b;
    color: black;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: inline-block; /* Make sure the button adjusts to the text */
    margin-top: 2px;
    margin-bottom: 20px;
    text-align: center;
    width: auto; /* Ensure the button adjusts width automatically */
}

.reveal-btn:hover {
    background-color: #ebb87e;
}

.rating.rated {
    opacity: 0.6;
    pointer-events: none; /* Prevents any further interaction */
}

/*------------------------------ donation -------------------------*/

#donate-form {
    border: none;
    background: white;
    padding: 0px;
    border-radius: 0px;
    margin-top: 5px;
    box-shadow: none;
}

/*--------------------- loading --------------*/
/* Optional spinner instead of text */
.spinner {
    border: 4px solid #170f06;
    border-top: 4px solid #444;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    margin: 2rem auto;
    animation: spin 0.8s linear infinite;
}

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

.bubble-loader {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    font-size: 2rem;
}

.bubble-loader span {
    animation: bounce 0.6s ease-in-out infinite alternate;
}

.bubble-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.bubble-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

/*----------------------- footer --------------------------*/
.footer-bar {
    background-color: #f0f0f0;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid #ccc;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 1rem;
    color: #444;
}

.footer-content img {
    width: auto;
    height: 24px;
    transition: transform 0.2s ease;
}

.footer-content img:hover {
    transform: scale(1.2);
}

/* ===================================*/
.features-list {
     max-width: 500px; /* adjust to your desired width */
     margin: 0 auto; /* center the list horizontally */
     padding: 1em;
     font-family: Arial, sans-serif;
     font-size: 1rem;
     line-height: 1.5;
 }

.features-list li {
    margin-bottom: 0.75em;
    list-style-type: disc;
    padding-left: 1em;
}
