/** TimeHub — Template 0002 — calendar.css
 * Fusion de calendar-form.css (ancien fichier unique).
 * @version 3.0.0
 */

/**
 * TimeHub Calendar - Styles V2.5 — Scopé T0002
 * Tous les sélecteurs préfixés [data-template="0002"]
 */

[data-template="0002"].timehub-wrapper {
    font-family: 'Segoe UI', sans-serif;
    background: #f0f2f5;
    padding: 20px;
}

/* Layout géré par timehub-ui.css section 15 */

/* --- NAVIGATION BAR (LINKS) --- */
[data-template="0002"] .timehub-format-nav {
    display: flex;
    background: #fff;
    border: 1px solid #ccc;
    margin-bottom: 20px;
}

[data-template="0002"] .format-link {
    flex: 1;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
    border-right: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f9f9f9;
    transition: background 0.2s;
}

[data-template="0002"] .format-link:last-child {
    border-right: none;
}

[data-template="0002"] .format-link:hover {
    background: #f0f0f0;
    color: #000;
}

[data-template="0002"] .format-link.active {
    background: #e6f0fa;
    color: #000;
    font-weight: bold;
    border-bottom: 3px solid #3498db;
}

[data-template="0002"] .format-link .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #3498db;
}

/* --- COLONNE GAUCHE (PARAMÈTRES) --- */
[data-template="0002"] .timehub-col-params {
    background: #eef2f7;
    /* Fond gris/bleuté du modèle */
    padding: 33px 10px 10px 10px;
    border-radius: 4px;
}

[data-template="0002"] .param-row {
    display: flex;
    flex-direction: row;
    /* Force l'alignement sur la même ligne */
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

[data-template="0002"] .param-row label {
    flex: 0 0 60%;
    /* Largeur fixe pour alignement vertical parfait */
    font-size: 14px;
    color: #333;
    margin: 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

[data-template="0002"] .field-wrapper {
    flex: 1;
    /* Prend tout l'espace restant */
    width: auto;
    text-align: right;
}


[data-template="0002"] input[type="color"] {
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    vertical-align: middle;
    box-sizing: border-box;
}

[data-template="0002"] input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

[data-template="0002"] input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* --- GRILLE POSITION (PETIT) --- */
[data-template="0002"] .pos-grid {
    display: grid;
    width: 60px;
    aspect-ratio: 1 / 1;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    border: 1px solid #999;
    background: #fff;
    margin: 0 auto;
}

[data-template="0002"] .pos-cell {
    border: 1px solid #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

[data-template="0002"] .pos-cell:hover {
    background-color: #f0f0f0;
}

[data-template="0002"] .pos-cell.active {
    background-color: #205081;
}

/* Bleu du thème */
[data-template="0002"] .pos-cell.active::after {
    content: '•';
    color: white;
    font-size: 20px;
    line-height: 0;
    padding-bottom: 2px;
}

/* Renommé de .hidden → .pos-disabled pour éviter le conflit avec WordPress (.hidden { display:none !important }) */
[data-template="0002"] .pos-cell.pos-disabled {
    visibility: visible;
    background-color: #e0e0e0;
    pointer-events: none;
    cursor: default;
}

/* Grise la case non sélectionnable */
[data-template="0002"] .pos-grid.disabled {
    opacity: 0.3;
    pointer-events: none;
    background-color: #eee;
}


/* --- TOOLTIP CUSTOM (INFOBULLE) --- */
[data-template="0002"] .timehub-tooltip-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    cursor: help;
    color: #888;
}

[data-template="0002"] .timehub-tooltip-container .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

[data-template="0002"] .timehub-tooltip-text {
    visibility: hidden;
    width: 350px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 100;
    bottom: 135%;
    /* Position au-dessus */
    left: 50%;
    margin-left: -175px;
    /* Centrage : moitié de 350px */
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

[data-template="0002"] .timehub-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

[data-template="0002"] .timehub-tooltip-container:hover .timehub-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* --- COLONNE DROITE (APERÇU) --- */
[data-template="0002"] .preview-header h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

/* --- ZONE APERÇU (CONTENEUR) --- */
[data-template="0002"] #timehub-preview-content {
    background-color: #f0f0f1;
    /* Fond gris pour faire ressortir la feuille */
    padding: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* --- APERÇU A4 --- */
[data-template="0002"] .preview-outer-wrapper {
    position: relative;
    width: 95%; /* Flèches maintenant dans l'A4 — plus besoin de réserver de place à l'extérieur */
    margin: 0 auto;
}

[data-template="0002"] .preview-a4-wrapper {
    background-color: #ffffff;
    /* Feuille blanche */
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.15);
    /* Ombre portée bas-droite */
    border: 1px solid #A6A6A6;
    padding: 0; /* Pas de padding, le layout est géré en interne */
    box-sizing: border-box;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Empêche le contenu de déborder et d'agrandir la page */
    container-type: size; /* Définit un conteneur de requête pour utiliser les unités cqh */
    container-name: a4;
}

/* --- MODE PORTRAIT (PM) --- */
[data-template="0002"] .preview-a4-wrapper[data-mode="portrait"] {
    aspect-ratio: 210/297;
}

/* --- FORMAT LETTER portrait --- */
[data-template="0002"] .preview-a4-wrapper.is-format-letter {
    aspect-ratio: 8.5 / 11;
}

/* --- FORMAT A3 portrait (297×420mm — même ratio 1:√2 que A4) --- */
[data-template="0002"] .preview-a4-wrapper.is-format-a3 {
    aspect-ratio: 297 / 420;
}

/* --- FORMAT Tabloid portrait (279×432mm) --- */
[data-template="0002"] .preview-a4-wrapper.is-format-tabloid {
    aspect-ratio: 279 / 432;  /* Tabloid portrait */
}

@media (max-width: 900px) {
    [data-template="0002"] .timehub-main-container {
        grid-template-columns: 1fr;
    }

    /* Empilement vertical sur mobile */
    [data-template="0002"] .preview-sticky-wrapper {
        position: static;
    }
}

/* --- Suppression des flèches (spinners) natives --- */

/* Chrome, Safari, Edge, Opera */
[data-template="0002"] input[type=number]::-webkit-outer-spin-button,
[data-template="0002"] input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
[data-template="0002"] input[type=number] {
    -moz-appearance: textfield;
}

/* --- NOUVEAUX STYLES THTEST --- */
[data-template="0002"] .th-image-container {
    flex: 0 0 45%;
    background-color: #e9e9e9;
    /* cal_bg.jpg supprimé — image par mois via JS carrousel */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Pour positionner l'année */
    overflow: hidden; /* Empêche tout dépassement */
    container-type: size;
    container-name: drawerHaut;
}

/* Bandeau noir semi-transparent (Twin Engine : parité GD DOCX) */
[data-template="0002"] .th-image-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 29cqh; /* ~13% du A4 recalculé pour le tiroir haut (45%) */
    background-color: rgba(0, 0, 0, 0.41); /* Alpha ~105/255 */
    z-index: 1;
}

/* Année positionnée sur l'image */
[data-template="0002"] .th-image-container .th-year-title {
    position: absolute;
    bottom: 4.5cqh; /* Ajustement proportionnel au tiroir haut */
    left: 5%;
    color: #fff;
    font-size: 17.5cqh; /* ~8% du A4 recalculé */
    font-weight: 900;
    text-shadow: 0px 0px 1px #000, 0px 0px 1px #000, 1px 1px 3px rgba(0,0,0,0.8); /* Simule contour + ombre */
    z-index: 2; /* S'assure de passer au-dessus du bandeau */
    margin: 0;
    line-height: 1;
    padding-left: 2.5%;
}

[data-template="0002"] .th-image-placeholder {
    /* Masqué à la demande de l'utilisateur */
    display: none !important;
}

/* --- TIROIR BAS --- */
[data-template="0002"] .th-bottom-drawer {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    container-type: size;
    container-name: drawerBas;
    position: relative;
    overflow: hidden;
}

[data-template="0002"] .th-month-container {
    padding-left: 5.7%; /* Aligne avec le conteneur de la grille qui a aussi 5% */
    padding-right: 5%;
    padding-top: 0%;
    text-align: left;
    margin-bottom: 1cqh;
}

[data-template="0002"] .th-month-title {
    display: block;
    font-size: 4cqh; /* ~3.5% du A4 recalculé pour le tiroir bas (55%) */
    font-weight: 500;
    color: var(--th-main-color, #000);
    text-transform: capitalize;
    padding-left: 3%;
    padding-bottom: 1%;
}

[data-template="0002"] .th-grid-container {
    flex: 1;
    padding: 0 5% 1cqh 5%;
    display: flex;
    flex-direction: column;
}

[data-template="0002"] .th-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 6cqh); /* Force la hauteur de chaque ligne à 6cqh */
    align-content: start; /* Aligne la grille en haut de l'espace disponible */
    margin-top: -4%;
}

[data-template="0002"] .th-day-header {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--th-main-color, #000);
    padding-bottom: 1cqh;
    font-size: 2cqh !important;
}

[data-template="0002"] .th-day-header.is-weekend {
    color: var(--th-weekend-color, #3688D4);
}

[data-template="0002"] .th-day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 4.8cqh;
        padding: 3cqh 1cqh;
}

[data-template="0002"] .day-number {
    font-weight: 600;
    color: var(--th-main-color, #000);
    font-size: 4cqh; /* ~4.5% du A4 recalculé */
}

[data-template="0002"] .day-number.is-weekend {
    color: var(--th-weekend-color, #3688D4);
}

[data-template="0002"] .th-day-cell.is-holiday {
    background-color: var(--th-weekend-color, #3688D4);
}

[data-template="0002"] .th-day-cell.is-holiday .day-number {
    color: #fff;
}

/* Liste des jours fériés sous le calendrier */
[data-template="0002"] .th-holidays-list {
    text-align: left;
    margin-top: 0.3cqh;
    margin-bottom: 0;
    padding-top: 0.15cqh;
    display: block;
    border-top: 1px solid #8A8A8A;
    width:40%;
    margin-left: 5%;
}

[data-template="0002"] .th-holiday-item {
    font-size: 1cqh; /* ~1% du A4 recalculé */
    color: #8A8A8A;
    margin: 0;
    line-height: 1.3;
}

/* Message d'information / Feedback */
[data-template="0002"] #timehub-message {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    text-align: center;
}

/* Message d'alerte restriction position (Jours Fériés) */
[data-template="0002"] #pos-restriction-msg {
    background-color: #fa2525;
    text-shadow: #000 1px 1px 0px;
    padding: 10px;
    color: #ffffff;
    font-size: 10px;
    border-radius: 5px;
    margin-top: 5px;
    line-height: 1.2;
    font-weight: bold;
}

/* Weekend Selector (Jours cliquables) */
[data-template="0002"] .weekend-selector {
    display: flex;
    gap: 2px;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
}

/* --- LOGO MARQUE (Brand Logo) --- */
/* Position absolue dans la marge basse du wrapper A4 */
[data-template="0002"] .brand-logo-zone {
    position: absolute;
    bottom: 2.5%;
    right: 5%;
    width: 20%;
    line-height: 0;
    pointer-events: none;
}

[data-template="0002"] .brand-logo-zone svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- BOUTON PLEIN ÉCRAN --- */
/* Position / taille / opacity uniquement — apparence dans timehub-ui.css */
[data-template="0002"] .btn-fullscreen-toggle {
    position  : absolute;
    top       : 50%;
    left      : 50%;
    transform : translate(-50%, -50%);
    width     : 20cqh;
    height    : 20cqh;
    opacity   : 0.2;
}

[data-template="0002"] .btn-fullscreen-toggle:hover {
    opacity   : 0.99;
    transform : translate(-50%, -50%) scale(1.1);
}

/* Fallback Dashicons — taille différente de timehub-ui.css (18px vs 20px) */
[data-template="0002"] .btn-fullscreen-toggle .dashicons {
    font-size : 18px;
    width     : auto;
    height    : auto;
    margin    : 0;
    line-height: 1;
}

/* --- CARROUSEL APERÇU --- */
[data-template="0002"] .th-carousel-controls {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

/* Taille / opacity / transition / icône — apparence de base dans timehub-ui.css */
[data-template="0002"] .btn-carousel {
    width      : 10cqh;
    height     : 10cqh;
    font-size  : 5cqh;
    line-height: 1;
    opacity    : 0.35;
    transition : ease 0.0s; /* override timehub-ui.css pour animation instantanée */
}

[data-template="0002"] .carousel-badge {
    position: absolute;
    top: 2cqh;
    left: 50%;
    width: 70%;
    text-align: center;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    text-shadow:1px 1px 1px rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    backdrop-filter: blur(1px);
}

/* --- ANIMATION CARROUSEL --- */
[data-template="0002"] .anim-slide-out-left,
[data-template="0002"] .anim-slide-out-right {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    z-index: 1;
    pointer-events: none;
}

[data-template="0002"] .anim-slide-in-left,
[data-template="0002"] .anim-slide-in-right {
    z-index: 2;
}

@keyframes t0002-slideOutLeft {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-30%); opacity: 0; }
}
@keyframes t0002-slideInRight {
    0% { transform: translateX(30%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes t0002-slideOutRight {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(30%); opacity: 0; }
}
@keyframes t0002-slideInLeft {
    0% { transform: translateX(-30%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

[data-template="0002"] .anim-slide-out-left { animation: t0002-slideOutLeft 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
[data-template="0002"] .anim-slide-in-right { animation: t0002-slideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
[data-template="0002"] .anim-slide-out-right { animation: t0002-slideOutRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
[data-template="0002"] .anim-slide-in-left { animation: t0002-slideInLeft 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }

/* --- OVERLAY PLEIN ÉCRAN --- */
/* Bouton ✕ T0002 → géré par timehub-ui.css (style unifié tous templates) */

/* --- CLONE A4 DANS OVERLAY — T0002 ---
   Le container impose la forme A4 portrait plein écran.
   Le A4 clone remplit ce container à 100%. */
#timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content {
    position        : relative;
    max-width       : 95vw;
    max-height      : 95vh;
    display         : flex;
    align-items     : center;
    justify-content : center;
    pointer-events  : none;
}

/* Le clone A4 dans l'overlay — restaure les propriétés structurelles perdues
   (normalement sous [data-template="0002"], ancêtre absent dans le body) */
#timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content .preview-a4-wrapper.is-format-letter {
    aspect-ratio: 8.5 / 11 !important;
}

#timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content .preview-a4-wrapper.is-format-a3 {
    aspect-ratio: 297 / 420 !important;
}

#timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content .preview-a4-wrapper.is-format-tabloid {
    aspect-ratio: 279 / 432 !important;
}

#timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content .preview-a4-wrapper {
    pointer-events: auto;
    width: auto !important;
    height: 95vh !important;
    aspect-ratio: 210 / 297 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    /* Propriétés structurelles */
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important; /* Force les enfants à pleine largeur */
    overflow: hidden !important;
    position: relative !important;
    container-type: size !important;
    container-name: a4 !important;
    background-color: #ffffff;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Mobile : piloter par la largeur pour éviter le débordement horizontal */
@media (max-width: 768px) {
    #timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content .preview-a4-wrapper {
        width: 90vw !important;
        height: auto !important;
    }
}

/* Image flush : aucune marge blanche en haut/gauche/droite du A4 */
#timehub-fullscreen-overlay[data-template="0002"] .timehub-fullscreen-content .th-image-container {
    width: 100% !important;
    margin: 0 !important;
    flex-shrink: 0;
}

/* --- MINI-GALERIE PHOTOS --- */
[data-template="0002"] .th-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    justify-content: flex-end;
}

[data-template="0002"] .th-thumbnail-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

[data-template="0002"] .th-thumbnail-wrapper:hover {
    border-color: #205081;
}

[data-template="0002"] .th-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[data-template="0002"] .th-thumbnail-wrapper .edit-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(32, 80, 129, 0.9);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* --- MODALE CROPPER --- */
[data-template="0002"] .timehub-cropper-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[data-template="0002"] .timehub-cropper-modal.active {
    opacity: 1;
    visibility: visible;
}

[data-template="0002"] .cropper-modal-content {
    background: white;
    border-radius: 8px;
    width: 95%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

[data-template="0002"] .cropper-modal-header,
[data-template="0002"] .cropper-modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
}

[data-template="0002"] .cropper-modal-header h4 { margin: 0; font-size: 18px; color: #333; }
[data-template="0002"] .cropper-modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #666; line-height: 1; }
[data-template="0002"] .cropper-modal-close:hover { color: #f00; }

[data-template="0002"] .cropper-img-container {
    height: 60vh;
    max-height: 600px;
    background: #222; /* Fond sombre derrière l'image */
    width: 100%;
}

[data-template="0002"] .cropper-modal-footer { justify-content: flex-end; gap: 15px; }
[data-template="0002"] .btn-cancel { padding: 10px 20px; border: 1px solid #ccc; background: white; border-radius: 4px; cursor: pointer; font-weight: bold; color: #333; }
[data-template="0002"] .btn-cancel:hover { background: #eee; }
[data-template="0002"] .btn-resize-only { padding: 10px 20px; border: 2px solid #205081; background: transparent; color: #205081; border-radius: 4px; cursor: pointer; font-weight: bold; transition: all 0.2s; }
[data-template="0002"] .btn-resize-only:hover { background: #e6f0fa; }
[data-template="0002"] .btn-validate { padding: 10px 20px; border: none; background: #205081; color: white; border-radius: 4px; cursor: pointer; font-weight: bold; }
[data-template="0002"] .btn-validate:hover { background: #163a5f; }

/* --- NOUVEAU : MODALE D'ALERTE PERSONNALISÉE --- */
[data-template="0002"] .th-custom-alert-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 1000000; /* Au-dessus de tout */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

[data-template="0002"] .th-custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

[data-template="0002"] .th-custom-alert-box {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

[data-template="0002"] .th-custom-alert-overlay.active .th-custom-alert-box {
    transform: scale(1);
}

[data-template="0002"] .alert-icon {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-template="0002"] .alert-icon .dashicons {
    font-size: 50px;
    width: 50px;
    height: 50px;
    line-height: 1;
}

/* Style pour les erreurs */
[data-template="0002"] .th-custom-alert-box.type-error .alert-icon { border: 4px solid #f27474; }
[data-template="0002"] .th-custom-alert-box.type-error .alert-icon .dashicons { color: #f27474; }
[data-template="0002"] .th-custom-alert-box.type-error .btn-alert-confirm { background-color: #d9534f; }
[data-template="0002"] .th-custom-alert-box.type-error .btn-alert-confirm:hover { background-color: #c9302c; }

/* Style pour les confirmations (warning) */
[data-template="0002"] .th-custom-alert-box.type-warning .alert-icon { border: 4px solid #f8bb86; }
[data-template="0002"] .th-custom-alert-box.type-warning .alert-icon .dashicons { color: #f8bb86; }
[data-template="0002"] .th-custom-alert-box.type-warning .btn-alert-confirm { background-color: #205081; }
[data-template="0002"] .th-custom-alert-box.type-warning .btn-alert-confirm:hover { background-color: #163a5f; }

[data-template="0002"] .alert-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

[data-template="0002"] .alert-message {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 25px 0;
    white-space: pre-wrap; /* Pour respecter les sauts de ligne \n */
}

[data-template="0002"] .alert-buttons { display: flex; justify-content: center; gap: 15px; }
[data-template="0002"] .alert-buttons button { padding: 12px 30px; border: none; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; color: white; }
[data-template="0002"] .btn-alert-cancel { background-color: #6c757d; }
[data-template="0002"] .btn-alert-cancel:hover { background-color: #5a6268; }

/* ===== BOUTON D'AIDE (remplace les tooltips hover) ===== */
[data-template="0002"] .th-help-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    color: #aaa;
    vertical-align: middle;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

[data-template="0002"] .th-help-trigger .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    transition: color 0.2s;
}

[data-template="0002"] .th-help-trigger:hover .dashicons {
    color: #205081;
}

/* Style info pour la modale d'aide */
[data-template="0002"] .th-custom-alert-box.type-info .alert-icon {
    border: 4px solid #3498db;
}
[data-template="0002"] .th-custom-alert-box.type-info .alert-icon .dashicons {
    color: #3498db;
}
[data-template="0002"] .th-custom-alert-box.type-info .btn-alert-confirm {
    background-color: #205081;
}
[data-template="0002"] .th-custom-alert-box.type-info .btn-alert-confirm:hover {
    background-color: #163a5f;
}

/* ===== BOUTON SUPPRESSION MINIATURE (X en haut à gauche) ===== */
[data-template="0002"] .th-thumb-delete {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: rgba(200, 30, 30, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 5;
    transition: background 0.2s;
    font-weight: bold;
}

[data-template="0002"] .th-thumb-delete:hover {
    background: rgba(180, 0, 0, 1);
}

/* ===== PARAM-ROW EN COLONNE (label au-dessus, champ pleine largeur) ===== */
[data-template="0002"] .param-row.param-row--column {
    flex-direction: column;
    align-items: flex-start;
}

[data-template="0002"] .param-row.param-row--column > label {
    flex: none;
    margin-bottom: 6px;
}

[data-template="0002"] .param-row.param-row--column > .field-wrapper {
    width: 100%;
    text-align: left;
}

/* ──────────────────────────────────────────────────────────────────────────
   FONT PICKER — sélecteur de police avec aperçu Google Fonts
   ────────────────────────────────────────────────────────────────────────── */
[data-template="0002"] .th-font-picker { position: relative; width: 100%; }

[data-template="0002"] .th-font-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px; background: #fff; border: 1px solid #ccc; border-radius: 4px;
    cursor: pointer; color: #333; text-align: left; transition: border-color 0.15s;
    font-size: 14px; line-height: 1.4; min-height: 34px;
}
[data-template="0002"] .th-font-trigger:hover,
[data-template="0002"] .th-font-picker.is-open .th-font-trigger { border-color: #205081; outline: none; }
[data-template="0002"] .th-font-trigger-label {
    flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px;
}
[data-template="0002"] .th-font-trigger-arrow {
    margin-left: 8px; font-size: 10px; color: #888; transition: transform 0.2s; flex-shrink: 0;
}
[data-template="0002"] .th-font-picker.is-open .th-font-trigger-arrow { transform: rotate(180deg); }
[data-template="0002"] .th-font-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid #d0d0d0; border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14); max-height: 280px; overflow-y: auto;
    z-index: 1100; padding: 4px 0;
}
[data-template="0002"] .th-font-picker.is-open .th-font-dropdown { display: block; }
[data-template="0002"] .th-font-option {
    padding: 9px 14px; font-size: 16px; cursor: pointer; color: #222;
    transition: background 0.1s; white-space: nowrap; line-height: 1.3; text-align: left;
}
[data-template="0002"] .th-font-option:hover { background: #f0f4f9; }
[data-template="0002"] .th-font-option.is-active { background: #e8eef6; color: #205081; }

/* ──────────────────────────────────────────────────────────────────────────
   OVERLAY — Avertissement polices DOCX
   ────────────────────────────────────────────────────────────────────────── */
[data-template="0002"] .timehub-docx-font-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
[data-template="0002"] .docx-font-overlay-box {
    background: #fff; border-radius: 10px; padding: 32px 36px; max-width: 520px; width: 90%;
    box-shadow: 0 12px 48px rgba(0,0,0,0.28); font-size: 15px; line-height: 1.65;
}
[data-template="0002"] .docx-font-overlay-box p { margin: 0 0 16px; color: #333; }
[data-template="0002"] .docx-font-overlay-box a { color: #205081; text-decoration: underline; }
[data-template="0002"] .docx-font-overlay-box a:hover { color: #184068; }
[data-template="0002"] #docx-continue-btn {
    display: block; width: 100%; margin-top: 8px; padding: 14px 20px;
    background: #205081; color: #fff; border: none; border-radius: 6px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; letter-spacing: 0.3px;
}
[data-template="0002"] #docx-continue-btn:hover { background: #184068; }
