
/* =====================================
   PROJET EQUINOVA
   CONFIGURATION GÉNÉRALE
===================================== */

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #F8EEF1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Modifications pour agrandir l'avatar et le mettre derrière les boutons*/

.overlay-bottom-group {
    position: relative;
}


#communication-frame {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 25;
    max-width: 100%;
    height: 360px !important;
    max-height: 55vh;
}



/* =====================================
   CONTENEUR PRINCIPAL & SCÈNE AVATAR
===================================== */

.container {
    width: 500px;
    height: 92vh;
    min-height: 760px;
    background-color: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 25px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.main-content.avatar-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding-top: 0;
    margin-top: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #FFFFFF;
}

.main-avatar {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

.avatar-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.avatar-overlay > *,
.avatar-overlay button,
.avatar-overlay iframe {
    pointer-events: auto;
}

.overlay-bottom-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}




/* =====================================
   CONTENEUR PRINCIPAL
===================================== */
/*
.container {
    width: 500px;
    min-height: 850px;
    background-color: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 25px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}*/

/* =====================================
   HEADER
===================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.logo h2 {
    color: #660000;
    font-size: 27px;
    font-weight: 700;
}


.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-title span {
    font-weight: 500;
    margin: 0 2px;
}



/* =====================================
   TIMER DE THOMAS
===================================== */

.timer-area {
    width: 155px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.timer {
    background-color: #F8EEF1;
    color: #660000;
    padding: 9px 14px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
}

#progressContainer {
    width: 100%;
    height: 7px;
    background-color: #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
}

#progressBar {
    width: 100%;
    height: 100%;
    background-color: #2E9D59;
    border-radius: 10px;
    transition: width 1s linear, background-color 0.3s;
}

/* =====================================
   CONTENU PRINCIPAL
===================================== */

/*
.main-content {
    margin-top: auto;
    padding-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;
}*/

/* =====================================
   AVATAR
===================================== */
/*
.avatar {
    width: 120px;
    height: 120px;
    background-color: #F8EEF1;
    border: 3px solid #8B1538;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #660000;
    font-size: 55px;
}*/

/* =====================================
   QUESTION ET COMMUNICATION DE JAD
===================================== */

.overlay-bottom-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.question-box {
    position: relative;
    z-index: 35;
    width: 100%;
    padding: 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#ouvrir-communication {
    position: relative;
    z-index: 35;
}

#communication-frame {
    position: absolute;
    left: 0;
    right: 0;
    top: 56px;
    z-index: 30;
    width: 100% !important;
    height: 225px !important;
    max-height: 50vh;
}

#communication-frame[hidden] {
    display: none !important;
}

/* =====================================
   BOUTONS AVATAR ET LANGUE
===================================== */

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.choice-button {
    flex: 1;
    padding: 12px 8px;
    border: 1px solid #8B1538;
    border-radius: 12px;
    background-color: #FFFFFF;
    color: #660000;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s, transform 0.2s;
}

.choice-button:hover {
    background-color: #FDF7F9;
}

.choice-button i {
    font-size: 18px;
}

/* =====================================
   ACCÈS RAPIDE DE MARIEM
===================================== */

.access-login {
    display: flex;
    gap: 12px;
    width: 100%;
}

.secondary-button {
    flex: 1;
    padding: 14px 10px;
    background-color: #660000;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.secondary-button:hover {
    background-color: #8B1538;
}

/* =====================================
   BOUTONS INFÉRIEURS
===================================== */

.bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 2px;
}

.bottom-action {
    flex: 1 1 0;
    min-width: 0;
    height: 92px;
    border: none;
    border-radius: 15px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
}

.bottom-action i {
    font-size: 24px;
}

/* SOS */

.sos {
    background-color: #B91C1C;
    color: #FFFFFF;
}

.qr {
    background-color: #F5C6CB;
    color: #660000;
}

.end {
    background-color: #660000;
    color: #FFFFFF;
}
.bottom-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

/* =====================================
   THOMAS - FENÊTRES MODALES
===================================== */

.qr-modal,
.confirm-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Confirmation SOS au-dessus du menu SOS */

#sosConfirmPopup {
    z-index: 1100;
}

/* =====================================
   THOMAS - QR CODE
===================================== */

.qr-modal-content {
    position: relative;
    background: white;
    width: 400px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px 25px;
    border-radius: 20px;
    text-align: center;
    color: #660000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.qr-modal-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.qr-modal-content p {
    font-size: 13px;
    color: #777;
    margin-bottom: 20px;
}

.close-qr {
    position: absolute;
    top: 12px;
    right: 15px;
    border: none;
    background: none;
    color: #660000;
    font-size: 23px;
    cursor: pointer;
}

#qrCanvas {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    padding: 10px;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
}

.generate-button {
    background: #660000;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.generate-button:hover {
    background: #8B1538;
}

/* =====================================
   THOMAS - FIN DE SESSION
===================================== */

.popup-box {
    background: white;
    width: 400px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    color: #660000;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.popup-box h2 {
    margin-bottom: 12px;
}

.popup-box p {
    color: #777;
    font-size: 14px;
}

.popup-icon {
    font-size: 42px;
    color: #8B1538;
    margin-bottom: 15px;
}

.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

#cancelExit,
#confirmExit,
#cancelButton,
#confirmButton {
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-weight: 600;
}

#cancelExit,
#cancelButton {
    background: #777777;
}

#confirmExit,
#confirmButton {
    background: #660000;
}

#cancelExit:hover,
#cancelButton:hover {
    background: #555555;
}

#confirmExit:hover,
#confirmButton:hover {
    background: #8B1538;
}

/* =====================================
   THOMAS - FENÊTRE SOS
===================================== */

.sos-modal-content {
    position: relative;
    background: #FFFFFF;
    width: 460px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 22px;
    text-align: center;
    color: #660000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.sos-modal-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.sos-hidden {
    display: none !important;
}

/* =====================================
   CERCLE DE PROGRESSION SOS
===================================== */

.sos-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 15px auto;
}

.sos-container svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

.background-ring {
    fill: none;
    stroke: #E0E0E0;
    stroke-width: 12;
}

.progress-ring {
    fill: none;
    stroke: #B91C1C;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.05s linear;
}

/* =====================================
   BOUTON SOS CIRCULAIRE
===================================== */

#sosButton {
    position: absolute;
    width: 155px;
    height: 155px;
    left: 32.5px;
    top: 32.5px;
    border: none;
    border-radius: 50%;
    background: #B91C1C;
    color: white;
    font-family: inherit;
    font-size: 42px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

#sosButton:active {
    background: #8B0000;
    transform: scale(0.97);
}

.sos-instruction {
    color: #777;
    font-size: 13px;
    margin: 15px 0 20px;
}

/* =====================================
   BOUTON RETOUR SOS
===================================== */

.sos-back-button {
    margin-top: 20px;
    padding: 12px 22px;
    background: #F5C6CB;
    color: #660000;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sos-back-button:hover {
    background: #EBAEB7;
}

/* =====================================
   MENU DES SERVICES D'URGENCE
===================================== */

.sos-description {
    color: #777;
    font-size: 13px;
    margin-bottom: 20px;
}

.service-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    width: 100%;
    padding: 15px 20px;
    margin: 10px 0;
    background: #F8EEF1;
    color: #660000;
    border: 1px solid #E8CBD3;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.service-button i {
    width: 25px;
    font-size: 20px;
    color: #8B1538;
}

.service-button:hover {
    background: #F5C6CB;
    border-color: #8B1538;
}

/* =====================================
   INFORMATIONS DES SERVICES
===================================== */

.service-success-icon {
    font-size: 45px;
    color: #2E9D59;
    margin-bottom: 15px;
}

#serviceName {
    margin-bottom: 20px;
}

#servicePhone,
#serviceLocation {
    color: #555;
    font-size: 14px;
    margin: 12px 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* =====================================
   RESPONSIVE
===================================== */

@media (max-width: 550px) {

    .container {
        width: 100%;
        min-height: 800px;
        padding: 18px;
    }

    .bottom-action {
        height: 95px;
        font-size: 11px;
    }

    .bottom-action i {
        font-size: 25px;
    }

    .choice-button {
        font-size: 10px;
    }

    .logo h2 {
        font-size: 22px;
    }

    .timer-area {
        width: 135px;
    }

    .sos-modal-content {
        padding: 25px 18px;
    }

    .popup-buttons {
        flex-wrap: wrap;
    }

}

/*Transition entre affichage*/

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.9s; }

/*Animations QR*/

.qr {
    background-color: #F5C6CB;
    color: #660000;
    animation: qrBreath 2s infinite;
    transition: 0.3s;
}

.qr:hover{

    transform:scale(1.05);

    box-shadow:0 0 20px rgba(139,21,56,0.4);
}

@keyframes qrBreath {

    0%{
        transform:scale(1);
        box-shadow:0 0 0px rgba(0,0,0,0);
    }

    50%{
        transform:scale(1.04);
        box-shadow:0 0 18px rgba(139,21,56,0.25);
    }

    100%{
        transform:scale(1);
        box-shadow:0 0 0px rgba(0,0,0,0);
    }
}

.qr-text-pulse{

    animation: qrTextPulse 2s infinite;

    font-weight:700;
}

@keyframes qrTextPulse {

    0%{
        color:#660000;
        letter-spacing:0px;
    }

    50%{
        color:white;
        letter-spacing:2px;
    }

    100%{
        color:#660000;
        letter-spacing:0px;
    }
}
