/* Stili per la modale a tutto schermo */
.modal-fullscreen {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.modal-fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.close-preview {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    cursor: pointer;
    color: white;
}

.preview-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.preview-body {
    position: relative;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    /*padding: 20px;*/
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.preview-image {
    position: relative;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom left;
}

.preview-description {
    position: relative;
    width: 80%;
    margin: 0 auto;
    background: rgba(0,0,0,1);
    color: #fff;
    border-radius: 10px;
    font-size: 3vh;
    overflow-y: scroll;
    max-height: 70vh;
}

#preview-slide {
    position: relative !important;
    background-color: #111111;
    padding: 10px;
    width: 100vw;
    /*height:100vh;*/
    /*margin-bottom: 15vh;*/
}

.choiceButton {
    font-size: 1.1rem;
    min-width: 100px;
}

.preview-buttons {
    display: flex;
    padding: 0 2rem;
    justify-content: center;
    position:relative;
}

.preview-buttons button {
    padding: 0.8rem 0.2rem;
    border-radius: 0.5rem;
    background-color: #128436;
    border: 2px solid #128436;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 2rem;
    width: 100%;
}

#game {
    font-family: Arial, sans-serif;
    text-align: center;
    margin-top: 50px;
}

#timer {
    font-size: 20px;
}

#wordContainer {
    font-size: 30px;
    text-align: center;
    z-index: 10;
    position: inherit;
}

#start-story {
    background-color: #1a6400;
    border: 2px solid #1abe1a;
    color: white;
    min-width: 200px;
    border-radius: 20px;
    font-size: 2vh;
    padding: 1em !important;
}

.letter {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border: 2px solid white;
    background-color: #faffed;
    margin: 5px;
    border: 3px solid #d9eba7;
    font-weight: bold;
    color: #2d5400;

    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    width: 10vw;
    height: 10vw;
    font-size: 4vw;
}

.success-message {
    font-size: 25px;
    color: #ffce3c;
    margin-top: 20px;
}

.summary-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10001;
}

.summary-screen h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.summary-screen p {
    font-size: 20px;
    margin-bottom: 10px;
}

#restart-button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background-color: #007bff;
    border: none;
    color: white;
    margin-top: 20px;
}


.story-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.map_modal_dialog{
    min-width: 60vw!important;
    font-size: 2vh!important;
}

.modal-title {
    font-size: 2.4vh!important;
}

div.card-marker-label-topcard {
    border-radius: 32px;
    width: 42vh!important;
}

#BusinessMissionContainer {
    background-size: cover!important;
}

div.card-marker-label-bottomcard {
    height: 40vh!important;
    font-size: 2.2vh !important;
}

.card_title_business {
    font-size: 2.4vh!important;
}

.step_real_name {
    font-size: 2vh!important;
}

#story-modal {
    overflow-x: hidden;
    padding:0;
}

.story-modal-content {
    /*padding: 20px;*/
   /* width: 100vw;*/
    height: 100vh;
    background-color: #000000;
}

.close-story {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-story:hover,
.close-story:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.wordscramble-content {
    background-color: white!important;
}



/* TIMER */

.timer-circle {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 20px auto;
}

.timer-circle .circle {
    stroke-dasharray: 283; /* Circonferenza del cerchio (2πr dove r=45) */
    stroke-dashoffset: 0;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1s linear;
}

.timer-container {
    position: relative;
    text-align: center;
}


@keyframes timerPulse {
    0% { background-color: rgba(255, 0, 0, 0.2); }
    50% { background-color: rgba(255, 89, 0, 0.6); }
    100% { background-color: rgba(255, 0, 0, 0.2); }
}

.timer-container {
    position: relative;
    text-align: center;
}

.timer-circle {
    position: relative;
    width: 9vw;
    height: 9vw;
    margin: 20px auto;
    z-index: 1;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4vw;
    font-weight: bold;
    color: white;
    z-index: 2;
}

.timer-pulse {
    animation: timerPulse 0.8s infinite;
}


/* punteggio */

.score-container {
    position: fixed;
    top: 5vh;
    right: 20px;
    display: none; /* Nascosto di default */
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Mostra solo quando è presente la classe .story-playing */
.story-playing {
    display: flex!important;
}

.score-icon {
    width: 5vw;
    height: 5vw;
    margin-right: 10px;
    display: flex;
}

.score-value {
    font-size: 5vw;
    font-weight: bold;
    color: #ffffff;
}

@keyframes scorePopup {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

.score-increase {
    position: absolute;
    color: #4CAF50;
    font-weight: bold;
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

#def_close_activity_button .fa-solid.fa-xmark {
    font-size: 2rem;
    color: #111c30;
    z-index: 1000000;
}

#def_close_activity_button .fa-solid.fa-xmark:hover {
    font-size: 2rem;
    color: #2c487b;
    z-index: 1000000;
}

.header_quiz_intro {
    font-size: 1.5rem;
}

img.quiz-img {
    width: 19vh;
}

.text_intro p {
    font-size: 2.5vh!important;
}

/* particle per score */

.particle {
    position: fixed;
    pointer-events: none;
    width: 15px;
    height: 15px;
    background-color: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 10px #FFD700;
    z-index: 999999999999;
}

@keyframes particleMove {
    0% {
        opacity: 1;
        transform: scale(100);
    }
    100% {
        opacity: 0;
        transform: scale(0.2);
    }
}

.particle-negative {
    position: fixed;
    pointer-events: none;
    width: 15px;
    height: 15px;
    background-color: #ff2f00;
    border-radius: 50%;
    box-shadow: 0 0 10px #FF2F00FF;
    z-index: 999999999999;
}

@keyframes particleMove {
    0% {
        opacity: 1;
        transform: scale(100);
    }
    100% {
        opacity: 0;
        transform: scale(0.2);
    }
}





.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.letter-grid {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
}

.bg-letter {
    font-size: 4rem;
    color: rgba(163, 163, 163, 0.86);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    animation: letterFade 3s infinite;
    animation-delay: var(--delay);
}

@keyframes letterFade {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.1); }
}



/* FIND DIFFERENCES */

#game-description {
    color: #0d0d0d;
    text-align: center;
    max-width: 70vw;
    margin: auto;
    margin-top: auto;
    margin-bottom: auto;
    background-color: #fff;
    padding: 1vw;
    font-weight: bold;
    font-size: 2.3vh;
    border-radius: 2vh;
    border: 4px solid #333;
    margin-top: 1vh;
}

.find-differences-content {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
}

.images-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    margin-bottom: 15vh;
}

.game-image-container {
    position: relative;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    margin: auto;
}

.game-imageB-container {
    position: relative;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    margin: auto;
}



.game-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.markers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.difference-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 255, 0, 0.5);
    border: 2px solid #00ff00;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: markerPulse 1s infinite;
}

.differences-counter {
    /*position: fixed;*/
   /*top: 20px;
    left: 50%;
    transform: translateX(-50%);*/
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 7px 10px;
    border-radius: 20px;
    font-size: 1em;
    z-index: 1000;
    margin-bottom: -1rem;
}

.timer-container {
    position: fixed;
    /*top: 20px;*/
    margin-top: -20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 1.2em;
    z-index: 1000;
}

@keyframes markerPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.difference-marker.found {
    position: absolute;
    background: rgba(0, 255, 0, 0.6);
    border: 2px solid green;
    pointer-events: none;
}

.difference-marker.found.circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.difference-marker.found.rectangle {
    border-radius: 0;
    transform: translate(0%, 0%) !important;
}








.success-message {
    text-align: center;
    color: #4CAF50;
    font-size: 1.5em;
    font-weight: bold;
    margin: 20px 0;
}

.continue-button {
    padding: 10px 20px;
    border-radius: 0.5vw;
    background-color: #2dad00;
    border: 2px solid #9df334!important;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 2vh;
}

#WrongAnswer h2 {
    font-size: 3vw;
}

.continue-button:hover {
    background-color: #45a049;
}

#game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    display: none;
}

#game-overlay .success-message {
    color: white;
    margin-bottom: 20px;
}


.feedback-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.feedback-message > div {
    background-color: #fff;
    padding: 2rem;
    border-radius: 1em;
    text-align: center;
    max-width: 80%;
    color: #343434;
    font-size: 2.2vh;
    min-width: 60vw;
}

.feedback-message.correct h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.feedback-message.wrong h2 {
    color: #f44336;
    margin-bottom: 20px;
}

.pointsMessage {
    margin:15px;
}


/* CARD */
/* Drag Card Game Styles */
.dragcard-content {
    background-color: #f5f5f5;
    min-height: 100vh;
}

.card-draggable {
    cursor: move;
    user-select: none;
    padding: 1.5rem;
    margin: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 100;
}

.card-draggable.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
}

.card-target {
    border: 2px dashed #ccc;
    min-height: 120px;
    margin: 0.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s ease;
}

.card-target.hover {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.card-match-correct {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.2);
    animation: pulse-success 0.5s ease;
}

.card-match-incorrect {
    border-color: #f44336;
    background-color: rgba(244, 67, 54, 0.2);
    animation: pulse-error 0.5s ease;
}

@keyframes pulse-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulse-error {
    0% { transform: scale(1); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: scale(1); }
}

.game-complete-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 2000;
}



/* SLIDER CARDS GAME */

/* Quiz Cards Styles */
/* Stili base per il carousel */

#dragcard-game {
    margin-bottom: 15vh;
}

.story-question-card {
    border-radius: 2vw!important;
    border: 4px solid #042740!important;
    background: #1f13b0;
    background: linear-gradient(0deg, rgba(1,30,91,1) 0%, rgba(16,40,129,1) 100%);
    width:100% !important;
}

.story-question-card .card-body{
    background: none!important;
}

.story-question-card .card-header {
    text-align: center;
    color: white;
    font-size: 1.8vh;
    padding: 1.5vh;
}

.story-question-card .card-body {
    text-align: center;
    font-size: larger;
    font-size: 1.8vh;
    padding: 3px 20px!important;
}

.story-question-card .carousel {
    width:100%;
}
.story-question-card .carousel-inner {
    overflow-y: visible;
    min-height: 100px !important;
    width: 80% !important;
    margin: auto;
}

.story-question-card .carousel-item {
    padding-left: 5px;
}

.question-card {
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.story-question-card .carousel-control-prev,
.story-question-card .carousel-control-next {
    width: 4vh!important;
    height: 4vh!important;
    top: 45% !important;
    background: #007bff;
    border-radius: 50%;
    opacity: 1;
    transform: translateY(-50%);
    margin: 1%;
}

.story-question-card .carousel-control-prev:hover,
.story-question-card .carousel-control-next:hover {
    background: #0056b3;
    opacity: 1;
}

.story-question-card .carousel-control-next-icon,
.story-question-card .carousel-control-prev-icon {
    width: 2vh;
    height: 2vh;
}

.answer-card {
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    min-height: 78px;
}

.answer-card.selected {

}

.answer-card.correct {
    border: 4px solid #28a745;
    background-color: #d4edda;
}

.answer-card.incorrect {
    border: 4px solid #dc3545;
    background-color: #f8d7da;
}

.story-question-card .carousel-inner .row {
    display: flex;
    flex-wrap: wrap;
}



.answer-card {
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.answer-card .card-body {
    background-color: #fff!important;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    text-align: center;
}

#dragbuttonmessage {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    padding: 0 15px;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    background-color: rgba(0,0,0,.6);
}

/* Aggiusta il padding del container per evitare che il contenuto finisca sotto l'area sticky */
.dragcard-content {
    padding-bottom: 100px; /* Altezza sufficiente per evitare sovrapposizioni */
}

/* Stile per il feedback all'interno dell'area sticky */
#dragbuttonmessage #feedback {
    margin-bottom: 0;
}

/* Adatta il pulsante all'area sticky */
#dragbuttonmessage #confirm-btn {
    margin-bottom: 10px;
    background-color: #2dad00;
    color: #fff;
    font-size: 2vh;
}


.feedback-message.timeout h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
}

.feedback-message.timeout .timeout-icon {
    font-size: 3.5vw;
    margin-bottom: 15px;
    color: #ff6b6b;
}


/* COLORI PULSANTI */

/* First button - Green */
.question-btn-1 {
    background-color: #2dad00 !important;
    border-color: #7be02f !important;
}

/* Second button - Orange */
.question-btn-2 {
    background-color: #ca7313 !important;
    border-color: #ffbe39 !important;
}

/* Third button - Purple */
.question-btn-3 {
    background-color: #ba12c0 !important;
    border-color: #d454d9 !important;
}

/* Fourth button - Blue */
.question-btn-4 {
    background-color: #135dbf !important;
    border-color: #569bf6 !important;
}

/* Fifth button - Blue (same as fourth) */
.question-btn-5 {
    background-color: #999e05 !important;
    border-color: #dbe046 !important;
}

/* Sixth button - Pink */
.question-btn-6 {
    background-color: #bf1351 !important;
    border-color: #e04e82 !important;
}

/* Additional buttons will cycle back through the colors */
.question-btn-7 { background-color: #2dad00 !important; border-color: #7be02f !important; }
.question-btn-8 { background-color: #ca7313 !important; border-color: #ffbe39 !important; }
.question-btn-9 { background-color: #ba12c0 !important; border-color: #d454d9 !important; }
.question-btn-10 { background-color: #135dbf !important; border-color: #569bf6 !important; }
.question-btn-11 { background-color: #999e05 !important; border-color: #dbe046 !important; }
.question-btn-12 { background-color: #bf1351 !important; border-color: #e04e82 !important; }



.last-difference-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    z-index: 10000;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-in, bounce 0.5s ease 0.3s;
}

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

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}




/* CONNECTION HANDLER */
/* Connection error modal styles */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

#connection-error-modal {
    display: none;
    position: fixed;
    z-index: 999999999999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

#connection-error-modal .alert {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

#connection-error-modal button {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

#connection-error-modal button:hover {
    background-color: #0069d9;
}


/* KRIS CSS PER AGGIUNTA AVATAR


/* Wrapper per avatar per avetre la descrizione affiancata */
.preview-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-end; /* Allinea in basso */
    justify-content: flex-start;
    width: 100%;
    gap: 1.6rem;
    position: relative;
}


.preview-avatar {
    display: none;
    flex-shrink: 0;
    align-items: flex-end;
    justify-content: flex-start;
    position: absolute;
    z-index: 4;
}

.preview-avatar img {
    max-width: 19rem;
    height: auto;
    object-fit: contain;
}

/* Quando c'è l'avatar */
.preview-content-wrapper.has-avatar .preview-description {
    position: relative;
    flex: 1;
    background: rgba(0,0,0,.7);
    color: #fff;
    padding: 1.25rem 1.25rem 1.25rem 20.50rem;
    border-radius: 10px;
    font-size: 1.5rem;
    overflow-y: auto;
    max-height: 25vh;
    margin: 0;
    width: auto;
}

/* Se non c'è avatar, descrizione tutto schermo */
.preview-content-wrapper:not(.has-avatar) .preview-description {
    width: 100%;
    margin: 0 auto;
}

/* Mobile: in verticale? */
@media (max-width: 768px) {
    .preview-content-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .preview-avatar {
        top: 0;
        left: 1rem;
    }

    .preview-avatar img {
        max-width: 18vw;
    }

    .preview-description {
        width: 90% !important;
    }

    .preview-image {
        width: 80%;
    }

    .preview-content-wrapper.has-avatar .preview-description {
        height: auto;
        max-height: none;
        padding: 2rem;
        margin-top: 5.6rem;
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}