/* ====== GENERALE (desktop e default) ====== */
html {
  overflow-y: scroll;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* evita scroll orizzontale indesiderato */
}

/* Contenitore centrale */
.container {
    background-color: white;
    max-width: 1000px;
    margin: 20px auto;  /* centrato orizzontalmente */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header con logo e menu */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;   /* evita overflow */
    padding: 0 20px;
    margin-bottom: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Logo dimensione uniforme */
.site-logo img {
    max-width: 500px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Menu di navigazione */
.menu {
    margin-right: 10px;
    padding: 0;
}

.menu ul {
    list-style: none;
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0;
    white-space: nowrap; /* evita che il menu vada a capo */
}

.menu ul li {
    display: inline-block;
}

.menu ul li a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 5px;
    transition: background 0.3s ease, color 0.3s ease;
    display: block;
}

.menu ul li a:hover,
.menu ul li a.active {
    background-color: #B52025;
    color: white;
}

/* Contenitore del jcarousel */
.slider-container {
    display: flex;
    margin-top: 50px;
    background-color: #B52025;
    padding: 20px;
    border-radius: 8px;
}

/* Slider per le immagini */
.image-slider {
    width: 66%;
}

.image-slider img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

/* Slider per il testo */
.text-slider {
    width: 34%;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-slider p {
    text-align: justify;
    padding: 10px;
}

.text-slider a {
    color: #FFFF00;
    text-decoration: none;
    transition: color 0.3s ease;
}

.text-slider a:visited {
    color: #ffa500;
}

.text-slider a:hover {
    color: #ffa500;
    text-decoration: underline;
}

/* Contenitore dei riquadri grigi */
.gray-boxes-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

.gray-box {
    background-color: #d3d3d3;
    padding: 20px;
    border-radius: 8px;
    width: 32%;
    color: #333;
    font-size: 16px;
    background: linear-gradient(to top, #d3d3d3, #f0f0f0);
}

.box-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.box-header img {
    width: 50px;
    height: auto;
}

.box-header h3 {
    margin: 0;
    color: #B52025;
    font-size: 18px;
}

.gray-box p {
    margin: 0;
    line-height: 1.5;
}

/* ===== ATTIVITÀ ===== */
.activities-list {
    display: flex;                /* usa flexbox invece del grid */
    justify-content: center;      /* centra orizzontalmente */
    gap: 20px;                    /* spazio tra le card */
    flex-wrap: wrap;              /* per andare a capo su schermi piccoli */
    padding: 20px;
}

.activity-card {
    background-color: #f4f4f4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 250px;                 /* larghezza fissa per allineamento regolare */
}

.activity-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.quiz-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quiz-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.quiz-question {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

.question-text {
    font-weight: 600;
    margin-bottom: 10px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
}

.quiz-option {
    margin-bottom: 8px;
    font-size: 16px;
    cursor: pointer;
}

.quiz-option input[type="radio"] {
    margin-right: 8px;
}

.quiz-feedback.correct {
    color: #28a745;
    font-weight: bold;
    margin-top: 5px;
}

.quiz-feedback.incorrect {
    color: #dc3545;
    font-weight: bold;
    margin-top: 5px;
}

.quiz-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007BFF;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.quiz-btn:hover {
    background: #0056b3;
}

.quiz-btn.secondary {
    background: #6c757d;
}

.quiz-btn.secondary:hover {
    background: #545b62;
}

.quiz-score {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

/* ====== QUIZ AUDIO (stile simile ai quiz normali) ====== */
.audio-quiz-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.audio-quiz-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 26px;
    font-weight: bold;
    color: #333;
}

/* Blocco per ogni audio e relative domande */
.audio-block {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.audio-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

.audio-block h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #B52025;
}

.audio-player {
    margin-bottom: 20px;
    width: 100%;
}

/* Domande */
.audio-questions .question-text {
    font-weight: 600;
    margin-bottom: 10px;
}

.audio-questions .quiz-options {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.audio-questions .quiz-option {
    margin-bottom: 8px;
    font-size: 16px;
    cursor: pointer;
}

.audio-questions .quiz-option input[type="radio"] {
    margin-right: 8px;
}

/* Feedback */
.audio-feedback.correct {
    color: #28a745;
    font-weight: bold;
    margin-top: 5px;
}
.audio-feedback.incorrect {
    color: #dc3545;
    font-weight: bold;
    margin-top: 5px;
}

/* Pulsanti */
.audio-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007BFF;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    margin-top: 10px;
    transition: background 0.3s ease;
}
.audio-btn:hover {
    background: #0056b3;
}

.audio-btn.secondary {
    background: #6c757d;
}
.audio-btn.secondary:hover {
    background: #545b62;
}

/* Punteggio finale */
.audio-quiz-score {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .audio-quiz-wrapper {
        padding: 15px;
    }
    .audio-block {
        padding: 15px;
    }
}


/* ===== FOOTER ===== */
.footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    margin-top: 40px;
    background-color: white;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(    to right,
    rgba(169, 169, 169, 0) 0%,
    rgba(169, 169, 169, 0.5) 10%,
    rgba(169, 169, 169, 0.5) 90%,
    rgba(169, 169, 169, 0) 100%);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
}

.footer-menu ul li {
    display: inline-block;
}

.policy-links {
    text-align: center;
    flex: 1;
    font-size: 14px;
}

.policy-links a {
    color: #333; /* colore coerente con il footer attuale */
    text-decoration: none;
    margin: 0 5px;
}

.policy-links a:hover {
    text-decoration: underline;
}

/* Pulsante accedi/logout a destra */
.accedi-container {
    margin-left: auto;
    min-width: 80px;
    flex-shrink: 0;
}

.accedi {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    background-color: transparent;
    transition: background 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.accedi:hover {
    background-color: #B52025;
    color: white;
}

/* ===== SEZIONE NEWSLETTER ===== */
.newsletter-container {
    margin-top: 40px;
    text-align: left;
}

.newsletter-container h2 {
    color: #B52025;
    font-size: 22px;
    margin-bottom: 5px;
}

.newsletter-container p {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.newsletter-form input {
    width: 15%;
    min-width: 150px;
    padding: 5px;
    font-size: 14px;
}

.newsletter-form button {
    background-color: #B52025;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #900;
}

.text-image-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 40px;
}

.text-image-container img {
    max-width: 300px;
    border-radius: 8px;
}

.text-image-container p {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
}

/* CONTATTI */
.contact-box {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-box h3 {
    color: #B52025;
    font-size: 20px;
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.contact-form textarea {
    height: 120px;
}

.note {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
}

.contact-form button {
    background-color: #B52025;
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background-color: #900;
}

.project-separator {
    border: none;
    height: 2px;
    background-color: #ccc;
    margin: 20px 0;
}

.float-left {
    float: left;
    margin-right: 10px;
    margin-bottom: 10px;
}

.float-right {
    float: right;
    margin-left: 10px;
    margin-bottom: 10px;
}

.align-left {
    text-align: left;
}

.align-right {
    text-align: right;
}

.align-center {
    text-align: center;
}

.align-justify {
    text-align: justify;
}

/* Layout contact page */
.contact-page {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Box principale */
.contact-box {
    flex: 1 1 400px;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.contact-box:hover {
    transform: translateY(-5px);
}

/* Titolo con icona */
.contact-box h3 {
    font-size: 24px;
    color: #B52025;
    margin-bottom: 20px;
    position: relative;
}

/* Campi del form */
.contact-form label {
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.3s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #B52025;
    outline: none;
}

/* Bottone */
.contact-form button {
    background: #B52025;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}
.contact-form button:hover {
    background: #900;
    transform: scale(1.05);
}

/* Colonna destra (newsletter e suggerimenti) */
.contact-extra {
    flex: 1 1 300px;
}

/* Newsletter e suggerimenti */
.newsletter-container, 
.contact-extra-info {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .contact-page {
        flex-direction: column;
    }
}

/* ====== MOBILE (max-width: 768px) ====== */
@media (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 10px;
    }

    .header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin-bottom: 20px;
    }

    .site-logo img {
        max-width: 80%;
        max-height: 50px;
        width: auto;
        margin-bottom: 10px;
    }

    .menu ul {
        flex-direction: column;
        gap: 10px;
        white-space: normal;
        align-items: center;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 300px;
    }

    .menu ul li {
        display: block;
        text-align: center;
        width: 100%;
    }

    .menu ul li a {
        font-size: 16px;
        padding: 8px;
    }

    .slider-container {
        flex-direction: column;
        margin-top: 30px;
        padding: 15px;
    }

    .image-slider {
        width: 100%;
        margin-bottom: 20px;
    }

    .image-slider img {
        height: 250px;
    }

    .text-slider {
        width: 100%;
        font-size: 16px;
        padding: 10px;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: justify;
    }

    .gray-boxes-container {
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
    }

    .gray-box {
        width: 100%;
        font-size: 14px;
        padding: 15px;
    }

    .footer {
        text-align: center;
        padding: 15px 10px;
        flex-direction: column;
    }

    .footer-menu ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .newsletter-container {
        text-align: center;
    }

    .newsletter-form {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        max-width: 300px;
        margin: 0 auto;
    }

    .newsletter-form input {
        width: 100%;
        min-width: unset;
    }

    .text-image-container {
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
    }

    .text-image-container img {
        max-width: 100%;
    }

    .contact-box {
        max-width: 90%;
        padding: 15px;
    }

    .align-left,
    .align-right,
    .align-center,
    .align-justify {
        text-align: center;
    }

    .float-left,
    .float-right {
        float: none;
        margin: 0 0 10px 0;
    }
}

/* ==== Cookie banner ====*/
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #222;
  color: #fff;
  padding: 20px;
  text-align: center;
  z-index: 10000;
  font-family: Arial, sans-serif;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

.cookie-banner p {
  margin: 0 0 10px;
  font-size: 16px;
}

.cookie-banner p a {
  color: #4da6ff;
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cookie-buttons .btn {
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.cookie-buttons .accept {
  background-color: #007BFF;
  color: white;
}
.cookie-buttons .accept:hover {
  background-color: #0056b3;
}

.cookie-buttons .essential {
  background-color: #6c757d;
  color: white;
}
.cookie-buttons .essential:hover {
  background-color: #545b62;
}

.cookie-buttons .reject {
  background-color: #dc3545;
  color: white;
}
.cookie-buttons .reject:hover {
  background-color: #a71d2a;
}

@media (max-width: 480px) {
  .cookie-buttons {
    flex-direction: column;
  }
  .cookie-buttons .btn {
    width: 100%;
  }
}

#game-area {
  position: relative;
  width: 100%;
  height: 80vh; /* spazio di gioco */
  display: flex;
  justify-content: center;
  align-items: center;
}

#red-dot {
  position: absolute;
  width: 30px;
  height: 30px;
  background-color: red;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: top 0.5s ease, left 0.5s ease;
  cursor: pointer;
}