/* =========================================================
   DisaTime – Compagnon d'aide
   ========================================================= */

.dt-help {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10000;
    font-family: inherit;
}

/* =========================================================
   Bouton principal
   ========================================================= */

.dt-help-trigger {
    min-width: 58px;
    height: 58px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #1f6feb;
    color: #ffffff;
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.22),
        0 3px 8px rgba(15, 23, 42, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.dt-help-trigger:hover {
    transform: translateY(-2px);
    background: #1859bd;
    box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.26),
        0 4px 10px rgba(15, 23, 42, 0.14);
}

.dt-help-trigger:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 4px;
}

.dt-help-trigger-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
}

/* =========================================================
   Panneau
   ========================================================= */

.dt-help-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(380px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.22),
        0 8px 24px rgba(15, 23, 42, 0.1);

    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transform-origin: bottom right;
    pointer-events: none;

    transition:
        opacity 0.18s ease,
        visibility 0.18s ease,
        transform 0.18s ease;
}

.dt-help.is-open .dt-help-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* =========================================================
   En-tête
   ========================================================= */

.dt-help-header {
    padding: 20px;
    background:
        linear-gradient(
            135deg,
            #1f6feb 0%,
            #1554b3 100%
        );
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dt-help-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.dt-help-avatar {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
}

.dt-help-heading h2 {
    margin: 0 0 4px;
    color: inherit;
    font-size: 1.08rem;
    line-height: 1.25;
}

.dt-help-heading p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    line-height: 1.4;
}

.dt-help-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.dt-help-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* =========================================================
   Contexte
   ========================================================= */

.dt-help-context {
    margin: 16px 16px 8px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a5f;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dt-help-context-label {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
}

.dt-help-context strong {
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   Actions
   ========================================================= */

.dt-help-actions {
    padding: 8px 16px 16px;
    display: grid;
    gap: 10px;
}

.dt-help-action {
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #0f172a;
    text-decoration: none;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.dt-help-action:hover {
    border-color: #93c5fd;
    background: #f8fbff;
    transform: translateX(2px);
}

.dt-help-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.dt-help-action strong,
.dt-help-action small {
    display: block;
}

.dt-help-action strong {
    margin-bottom: 3px;
    font-size: 0.91rem;
}

.dt-help-action small {
    color: #64748b;
    font-size: 0.77rem;
    line-height: 1.35;
}

.dt-help-arrow {
    color: #94a3b8;
    font-size: 1.4rem;
}

/* =========================================================
   Pied du panneau
   ========================================================= */

.dt-help-footer {
    padding: 11px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
}

.dt-help-footer code {
    max-width: 150px;
    overflow: hidden;
    color: #475569;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 600px) {
    .dt-help {
        right: 14px;
        bottom: 14px;
    }

    .dt-help-panel {
        position: fixed;
        right: 14px;
        bottom: 84px;
        left: 14px;
        width: auto;
        transform-origin: bottom center;
    }

    .dt-help-trigger {
        min-width: 54px;
        height: 54px;
        padding: 0;
    }

    .dt-help-trigger-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .dt-help-trigger-icon {
        background: transparent;
    }
}