/*============================================================================*/
/*                          MAIN LAYOUT (Responsive)                          */
/*============================================================================*/

.main-container {
    display: flex;
    height: 80vh;
    transition: height 0.3s ease;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.main-container.active-content {
    height: 40vh;
}

.left-section,
.right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: flex 0.5s ease;
    min-width: 0;
}

/* Séparateur */
.divider {
    width: 2px;
    background: #eee;
    height: 60%;
    align-self: center;
}

/* Carrés d’option */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.text-content {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.square {
    width: 10rem;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--tertiary-color);
    color: var(--text-color);
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    border-radius: 20px;
    transition: transform 0.3s, background-color 0.3s;
}

.square:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* Options */
.options {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.option {
    padding: 10px 30px;
    background-color: var(--secondary-color);
    color: var(--tertiary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.option:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Image à droite */
.right-section img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: opacity 0.5s ease;
    display: block;
    margin: 0 auto;
}

/* Contenu dynamique */
.content-wrapper {
    margin: 32px auto 0;
    padding: 20px;
    width: 80%;
    border-radius: 30px;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Chat IA */
.chat-container {
    width: 100%;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-question {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.send-question {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}
.send-question:hover {
    background: #27ae60;
}
.ai-response {
    width: 80%;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}
.loading {
    color: #7f8c8d;
    font-style: italic;
}
.error {
    color: #e74c3c;
}

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

/* --- Tablettes (≤1024px) --- */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        height: auto;
        gap: 40px;
    }

    .divider {
        width: 80%;
        height: 2px;
        margin: 20px auto;
        background: #eee;
    }

    .left-section, .right-section {
        padding: 10px 0;
    }

    .square {
        width: 8rem;
        height: 90px;
        font-size: 15px;
    }

    .content-wrapper {
        width: 90%;
        padding: 16px;
    }
}

/* --- Mobiles (≤768px) --- */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 16px;
        gap: 24px;
    }

    .square {
        width: 100%;
        max-width: 300px;
        height: 80px;
        font-size: 14px;
    }

    .container {
        flex-direction: column;
        gap: 20px;
    }

    .content-wrapper {
        width: 95%;
        border-radius: 20px;
    }

    .chat-container {
        padding: 16px;
    }

    .ai-response {
        width: 100%;
    }
}

/* --- Petits téléphones (≤480px) --- */
@media (max-width: 480px) {
    .square {
        width: 100%;
        max-width: 260px;
        height: 70px;
        font-size: 13px;
        border-radius: 14px;
    }

    .option {
        padding: 8px 20px;
        font-size: 14px;
    }

    .content-wrapper {
        padding: 14px;
    }

    .popup-card {
        padding: 28px 20px;
    }
}

/*============================================================================*/
/*                 FULLSCREEN GLASS POPUP - Responsive Fixes                   */
/*============================================================================*/

.fullscreen-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    z-index: 9999;
    padding: 24px;
}

/* Card du popup */
.popup-card {
    width: min(1000px, 90%);
    max-width: 1100px;
    padding: 80px 48px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Titres et paragraphes */
.popup-card h1 {
    margin: 0 0 12px 0;
    font-weight: 800;
    color: #000;
    font-size: clamp(36px, 6vw, 90px);
    line-height: 1.1;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.popup-card p {
    margin: 0 0 24px 0;
    color: #000;
    font-size: clamp(16px, 2.2vw, 22px);
    max-width: 700px;
    margin-inline: auto;
    line-height: 1.5;
}

/* Boutons */
.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 20px;
}

.popup-btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: rgb(0, 0, 0);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.popup-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
}

/* Animation */
.fullscreen-popup.show {
    animation: popupIn 400ms cubic-bezier(.2, .9, .28, 1) both;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Tablettes --- */
@media (max-width: 1024px) {
    .popup-card {
        padding: 60px 32px;
        width: 90%;
    }
}

/* --- Mobiles --- */
@media (max-width: 768px) {
    .popup-card {
        padding: 40px 24px;
        border-radius: 16px;
    }
    .popup-card h1 {
        font-size: clamp(26px, 7vw, 48px);
    }
    .popup-card p {
        font-size: clamp(14px, 3vw, 18px);
    }
    .popup-actions {
        flex-direction: column;
        gap: 10px;
    }
    .popup-btn {
        width: 100%;
        max-width: 260px;
    }
}

/* --- Petits téléphones --- */
@media (max-width: 480px) {
    .popup-card {
        padding: 24px 16px;
    }
    .popup-card h1 {
        font-size: 24px;
    }
    .popup-card p {
        font-size: 14px;
    }
}
