/* =================================================================
   06-4. PROJECT EMAIL VIEWER
   ================================================================= */

.email-viewer-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0 60px 0;
}

/* Toolbar de contrôle centrée */
.viewer-toolbar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Le conteneur en forme de pilule */
.control-group-pill {
    background: #f4f4f4;
    padding: 9px 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Label interne (LANGUAGE / VERSION) */
.pill-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6e6e6e;
    user-select: none;
}

.language-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.email-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Style des boutons de langue */
.lang-btn {
    background: transparent;
    border: 0px solid transparent;
    border-radius: 50%; 
    padding: 0;
    width: 25px;
    height: 25px;
    cursor: pointer;
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.lang-btn .fi {
    width: 100%;
    height: 100%;
    transform: scale(1.4);
    object-fit: cover;
}

.lang-btn:hover, .lang-btn.active {
    opacity: 1;
}

.lang-btn.active {
    border-color: #747474;
}

/* Contrôles Desktop/Mobile */
.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #ccc;
    padding: 1px;
    transition: all 0.3s ease;
}

.control-btn:hover { color: #7c7c7c; }
.control-btn.active { color: #242424; }

/* Wrapper Frame */
.email-frame-wrapper {
    width: 750px;
    max-width: 100%;
    height: 1100px;
    border: 1px solid #eee;
    background: #fff;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1), height 0.5s ease, border 0.3s ease;
}

.email-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* État Mobile (Le Mockup) */
.email-frame-wrapper.is-mobile {
    width: 375px;
    height: 750px;
    border: 12px solid #161616; 
    border-radius: 40px;
}

/* Dark Mode */
html.dark-theme .control-group-pill { background: #25262c; }
html.dark-theme .pill-label { color: #a0a0a0; }
html.dark-theme .control-btn.active { color: #fff; }
html.dark-theme .email-frame-wrapper { border-color: #222; background: #000; }
html.dark-theme .email-frame-wrapper.is-mobile { border-color: #333; }

/* =================================================================
   RESPONSIVE MOBILE
   ================================================================= */
@media (max-width: 900px) {
    .viewer-toolbar { 
        gap: 10px;
    }

    /* On cache toute la pilule VERSION en mobile */
    .email-controls-pill {
        display: none;
    }

    .control-group-pill {
        padding: 10px 20px;
    }

    .pill-label {
        font-size: 9px;
    }

    /* État par défaut sur mobile (Email large) */
    .email-frame-wrapper {
        width: 95% !important;
        height: 650px !important;
        border: 8px solid #202020 !important;
        border-radius: 30px !important;
    }

    /* État quand on force is-mobile via JS (optionnel si switcher caché) */
    .email-frame-wrapper.is-mobile {
        width: 280px !important; 
        height: 500px !important;
    }

    .lang-btn { 
        width: 22px; 
        height: 22px; 
    }
}