/* =========================================================
   WeeToast - système de notifications maison
   ========================================================= */

#wee-toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483647;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;

    width: auto;
    max-width: calc(100vw - 40px);

    pointer-events: none;
    box-sizing: border-box;
}

/* =========================================================
   Toast
   ========================================================= */

.wee-toast {
    position: relative;

    display: inline-flex;
    align-items: flex-start;
    gap: 12px;

    width: max-content;
    max-width: min(500px, calc(100vw - 40px));
    min-width: 0;

    padding: 14px 16px;
    box-sizing: border-box;

    background: #ffffff;
    color: #111827;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.06);

    pointer-events: auto;

    opacity: 0;
    transform: translateX(30px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.wee-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.wee-toast.is-hiding {
    opacity: 0;
    transform: translateX(30px);
}

/* =========================================================
   Icon
   ========================================================= */

.wee-toast-icon {
    flex: 0 0 20px;

    width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 1px;
}

.wee-toast-icon svg {
    display: block !important;

    width: 18px !important;
    height: 18px !important;

    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;

    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.wee-toast-icon svg path,
.wee-toast-icon svg circle,
.wee-toast-icon svg line,
.wee-toast-icon svg polyline {
    fill: none !important;
    stroke: currentColor !important;
}

/* =========================================================
   Contenu
   ========================================================= */

.wee-toast-content {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.wee-toast-message {
    margin: 0;

    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;

    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* =========================================================
   Bouton fermer
   ========================================================= */

.wee-toast-close {
    flex: 0 0 24px;

    width: 24px;
    height: 24px;

    margin: -2px -4px 0 0;
    padding: 0;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #9ca3af;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.wee-toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.wee-toast-close:focus {
    outline: none;
}

.wee-toast-close svg {
    display: block !important;

    width: 16px !important;
    height: 16px !important;

    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* =========================================================
   Barre de progression
   ========================================================= */

.wee-toast-progress {
    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 3px;

    border-radius: 0 0 12px 12px;

    transform-origin: left center;
    animation-name: wee-toast-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;

    opacity: 0.85;
}

@keyframes wee-toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* =========================================================
   SUCCESS
   ========================================================= */

.wee-toast-success {
    border-left: 4px solid #16a34a;
}

.wee-toast-success .wee-toast-icon {
    color: #16a34a;
}

.wee-toast-success .wee-toast-progress {
    background: #16a34a;
}

/* =========================================================
   ERROR
   ========================================================= */

.wee-toast-error {
    border-left: 4px solid #dc2626;
}

.wee-toast-error .wee-toast-icon {
    color: #dc2626;
}

.wee-toast-error .wee-toast-progress {
    background: #dc2626;
}

/* =========================================================
   WARNING
   ========================================================= */

.wee-toast-warning {
    border-left: 4px solid #d97706;
}

.wee-toast-warning .wee-toast-icon {
    color: #d97706;
}

.wee-toast-warning .wee-toast-progress {
    background: #d97706;
}

/* =========================================================
   INFO
   ========================================================= */

.wee-toast-info {
    border-left: 4px solid #2563eb;
}

.wee-toast-info .wee-toast-icon {
    color: #2563eb;
}

.wee-toast-info .wee-toast-progress {
    background: #2563eb;
}

/* =========================================================
   DARK MODE
   ========================================================= */

[data-theme-style="dark"] #wee-toast-container .wee-toast,
.dark #wee-toast-container .wee-toast {
    background: #111827;
    color: #f9fafb;

    border-color: #374151;
}

[data-theme-style="dark"] #wee-toast-container .wee-toast-close,
.dark #wee-toast-container .wee-toast-close {
    color: #9ca3af;
}

[data-theme-style="dark"] #wee-toast-container .wee-toast-close:hover,
.dark #wee-toast-container .wee-toast-close:hover {
    background: #1f2937;
    color: #f3f4f6;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {
    #wee-toast-container {
        right: 12px;
        bottom: 12px;
        left: 12px;

        max-width: none;
        align-items: stretch;
    }

    .wee-toast {
        width: max-content;
        max-width: 100%;
    }
}