/**
 * Pop-up Magellan - Styles
 * Version 1.2.0 - 3 styles d'affichage
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.magellan-popup[hidden] {
    display: none !important;
}

.magellan-popup,
.magellan-popup * {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    box-sizing: border-box;
}

/* Variables par type d'alerte (defaults) */
.magellan-popup--info {
    --popup-color: #2563eb;
    --popup-bg-light: #dbeafe;
}
.magellan-popup--warning {
    --popup-color: #ea580c;
    --popup-bg-light: #ffedd5;
}
.magellan-popup--urgent {
    --popup-color: #dc2626;
    --popup-bg-light: #fee2e2;
}
.magellan-popup--success {
    --popup-color: #16a34a;
    --popup-bg-light: #dcfce7;
}

/* Flèche bouton */
.magellan-popup__arrow {
    width: 18px;
    height: 18px;
    margin-left: 2px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* ============================================
   STYLE 1 : MODAL CENTRÉ
   ============================================ */

.magellan-popup--style-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: magellanFadeIn 0.35s ease;
}

.magellan-popup--style-modal .magellan-popup__overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.magellan-popup--style-modal .magellan-popup__container {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 560px;
    width: 100%;
    padding: 48px 40px 36px;
    animation: magellanSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.magellan-popup--style-modal .magellan-popup__container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--popup-color);
    border-radius: 16px 0 0 16px;
}

/* ============================================
   STYLE 2 : BANNIÈRE EN HAUT (Améliorée)
   ============================================ */

.magellan-popup--style-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    animation: magellanSlideDown 0.4s ease;
}

.magellan-popup--style-banner .magellan-popup__container {
    background: linear-gradient(135deg, var(--popup-color) 0%, color-mix(in srgb, var(--popup-color) 85%, #000) 100%);
    color: #ffffff;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

/* Fallback si color-mix non supporté */
@supports not (background: color-mix(in srgb, red, blue)) {
    .magellan-popup--style-banner .magellan-popup__container {
        background: var(--popup-color);
    }
}

.magellan-popup--style-banner .magellan-popup__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.magellan-popup--style-banner .magellan-popup__icon svg {
    width: 26px;
    height: 26px;
}

.magellan-popup--style-banner .magellan-popup__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.5;
}

.magellan-popup--style-banner .magellan-popup__title {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    display: block;
}

.magellan-popup--style-banner .magellan-popup__description {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    font-size: 0.95rem;
    display: block;
}

.magellan-popup--style-banner .magellan-popup__description p {
    margin: 0;
    display: inline;
}

.magellan-popup--style-banner .magellan-popup__description a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.magellan-popup--style-banner .magellan-popup__description strong {
    color: #ffffff;
    font-weight: 600;
}

.magellan-popup--style-banner .magellan-popup__button {
    flex-shrink: 0;
    background: #ffffff;
    color: var(--popup-color) !important;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.magellan-popup--style-banner .magellan-popup__button:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    color: var(--popup-color) !important;
}

.magellan-popup--style-banner .magellan-popup__close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    position: static;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.magellan-popup--style-banner .magellan-popup__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.magellan-popup--style-banner .magellan-popup__close svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   STYLE 3 : CARTE FLOTTANTE
   ============================================ */

.magellan-popup--style-card {
    position: fixed;
    z-index: 999999;
    max-width: 380px;
    width: calc(100% - 40px);
    animation: magellanCardSlide 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.magellan-popup--bottom-right {
    bottom: 24px;
    right: 24px;
}
.magellan-popup--bottom-left {
    bottom: 24px;
    left: 24px;
}
.magellan-popup--top-right {
    top: 24px;
    right: 24px;
}
.magellan-popup--top-left {
    top: 24px;
    left: 24px;
}

.magellan-popup--style-card .magellan-popup__container {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 22px 22px 20px;
    overflow: hidden;
}

.magellan-popup--style-card .magellan-popup__container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--popup-color);
}

/* ============================================
   ÉLÉMENTS COMMUNS MODAL + CARTE
   ============================================ */

.magellan-popup--style-modal .magellan-popup__close,
.magellan-popup--style-card .magellan-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    color: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.magellan-popup--style-modal .magellan-popup__close:hover,
.magellan-popup--style-card .magellan-popup__close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.magellan-popup--style-modal .magellan-popup__close svg,
.magellan-popup--style-card .magellan-popup__close svg {
    width: 16px;
    height: 16px;
}

.magellan-popup--style-modal .magellan-popup__header,
.magellan-popup--style-card .magellan-popup__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.magellan-popup--style-modal .magellan-popup__icon,
.magellan-popup--style-card .magellan-popup__icon {
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--popup-bg-light);
    color: var(--popup-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.magellan-popup--style-modal .magellan-popup__icon {
    width: 56px;
    height: 56px;
}
.magellan-popup--style-modal .magellan-popup__icon svg {
    width: 30px;
    height: 30px;
}

.magellan-popup--style-card .magellan-popup__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}
.magellan-popup--style-card .magellan-popup__icon svg {
    width: 22px;
    height: 22px;
}

.magellan-popup--style-modal .magellan-popup__title,
.magellan-popup--style-card .magellan-popup__title {
    margin: 0;
    color: #0f172a;
    line-height: 1.35;
    letter-spacing: -0.01em;
    font-weight: 600;
}

.magellan-popup--style-modal .magellan-popup__description {
    font-size: 1.05rem;
    line-height: 1.7;
    padding-top: 6px;
    padding-right: 36px;
}

.magellan-popup--style-card .magellan-popup__title {
    font-size: 1.05rem;
    padding-top: 4px;
    padding-right: 30px;
    flex: 1;
}

.magellan-popup--style-modal .magellan-popup__description,
.magellan-popup--style-card .magellan-popup__description {
    color: #1e293b;
    margin-bottom: 22px;
    font-weight: 400;
}

.magellan-popup--style-modal .magellan-popup__description {
    font-size: 1.05rem;
    line-height: 1.7;
}

.magellan-popup--style-card .magellan-popup__description {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.magellan-popup--style-modal .magellan-popup__description p,
.magellan-popup--style-card .magellan-popup__description p {
    margin: 0 0 12px;
}

.magellan-popup--style-modal .magellan-popup__description p:last-child,
.magellan-popup--style-card .magellan-popup__description p:last-child {
    margin-bottom: 0;
}

.magellan-popup--style-modal .magellan-popup__description a,
.magellan-popup--style-card .magellan-popup__description a {
    color: var(--popup-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.magellan-popup--style-modal .magellan-popup__description strong,
.magellan-popup--style-card .magellan-popup__description strong {
    color: #0f172a;
    font-weight: 600;
}

.magellan-popup--style-modal .magellan-popup__actions,
.magellan-popup--style-card .magellan-popup__actions {
    display: flex;
    justify-content: flex-end;
}

.magellan-popup--style-modal .magellan-popup__button,
.magellan-popup--style-card .magellan-popup__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--popup-color);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif !important;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.magellan-popup--style-modal .magellan-popup__button {
    padding: 13px 26px;
    font-size: 0.98rem;
}

.magellan-popup--style-card .magellan-popup__button {
    padding: 10px 18px;
    font-size: 0.88rem;
    border-radius: 8px;
}

.magellan-popup--style-modal .magellan-popup__button:hover,
.magellan-popup--style-card .magellan-popup__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    color: #ffffff !important;
}

.magellan-popup--style-modal .magellan-popup__button:hover .magellan-popup__arrow,
.magellan-popup--style-card .magellan-popup__button:hover .magellan-popup__arrow,
.magellan-popup--style-banner .magellan-popup__button:hover .magellan-popup__arrow {
    transform: translateX(3px);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes magellanFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes magellanSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes magellanSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes magellanCardSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@media (max-width: 600px) {
    /* Modal */
    .magellan-popup--style-modal {
        padding: 12px;
    }
    .magellan-popup--style-modal .magellan-popup__container {
        padding: 40px 22px 26px;
        border-radius: 14px;
    }
    .magellan-popup--style-modal .magellan-popup__container::before {
        border-radius: 14px 0 0 14px;
    }
    .magellan-popup--style-modal .magellan-popup__header {
        flex-direction: column;
        gap: 12px;
    }
    .magellan-popup--style-modal .magellan-popup__icon {
        width: 48px;
        height: 48px;
    }
    .magellan-popup--style-modal .magellan-popup__title {
        font-size: 1.15rem;
        padding-top: 0;
        padding-right: 30px;
    }
    .magellan-popup--style-modal .magellan-popup__description {
        font-size: 0.98rem;
    }
    .magellan-popup--style-modal .magellan-popup__actions {
        justify-content: stretch;
    }
    .magellan-popup--style-modal .magellan-popup__button {
        width: 100%;
        justify-content: center;
    }

    /* Bannière */
    .magellan-popup--style-banner .magellan-popup__container {
        padding: 16px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .magellan-popup--style-banner .magellan-popup__icon {
        width: 40px;
        height: 40px;
    }
    .magellan-popup--style-banner .magellan-popup__icon svg {
        width: 22px;
        height: 22px;
    }
    .magellan-popup--style-banner .magellan-popup__content {
        flex: 1 1 calc(100% - 60px);
        order: 1;
    }
    .magellan-popup--style-banner .magellan-popup__title {
        font-size: 0.95rem;
    }
    .magellan-popup--style-banner .magellan-popup__description {
        font-size: 0.88rem;
    }
    .magellan-popup--style-banner .magellan-popup__button {
        order: 3;
        flex: 1;
        justify-content: center;
        font-size: 0.88rem;
        padding: 10px 18px;
    }
    .magellan-popup--style-banner .magellan-popup__close {
        order: 2;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }

    /* Carte */
    .magellan-popup--style-card {
        max-width: none;
        width: calc(100% - 24px);
    }
    .magellan-popup--bottom-right,
    .magellan-popup--bottom-left {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    .magellan-popup--top-right,
    .magellan-popup--top-left {
        top: 12px;
        right: 12px;
        left: 12px;
    }
}
