/**
 * External Link Warning Dialog Styles
 * 
 * @package Multipli
 * @author The Kestrel Co
 */

/* Dialog Base Styles */
#multipli-external-link-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: white;
}

/* Backdrop */
#multipli-external-link-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

/* Fallback for browsers without native dialog support */
#multipli-external-link-dialog:not([open]) {
    display: none;
}

#multipli-external-link-dialog.dialog-open {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* Backdrop fallback */
#multipli-external-link-dialog.dialog-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Dialog Header */
.dialog-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid #f1f3f5;
}

.dialog-header h2 {
    margin: 0;
    color: #004F71;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dialog-header .warning-icon {
    font-size: 1.75rem;
    color: #ffc107;
}

/* Dialog Body */
.dialog-body {
    padding: 1.5rem 2rem;
}

.dialog-body p {
    margin: 0 0 1rem;
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
}

.dialog-body p:last-child {
    margin-bottom: 0;
}

.dialog-body strong {
    color: #212529;
}

/* Dialog Footer */
.dialog-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 100px;
}

.dialog-btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.dialog-btn-cancel:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.dialog-btn-primary {
    background: var(--global-palette-btn-bg, #67B346);
    color: white;
}

.dialog-btn-primary:hover {
    background: #5ba13b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 179, 70, 0.3);
}

/* Hidden inputs */
#multipli-hidden-link,
#multipli-hidden-link-target {
    display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    #multipli-external-link-dialog {
        width: 95%;
        max-width: none;
    }

    .dialog-header {
        padding: 1.5rem 1.5rem 0.75rem;
    }

    .dialog-header h2 {
        font-size: 1.25rem;
    }

    .dialog-body {
        padding: 1rem 1.5rem;
    }

    .dialog-body p {
        font-size: 0.95rem;
    }

    .dialog-footer {
        padding: 0.75rem 1.5rem 1.5rem;
        flex-direction: column-reverse;
    }

    .dialog-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Animation for dialog */
@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation for native dialog */
#multipli-external-link-dialog[open] {
    animation: dialogFadeIn 0.2s ease-out;
}

/* Animation for fallback dialog (includes positioning) */
@keyframes dialogFadeInFallback {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#multipli-external-link-dialog.dialog-open {
    animation: dialogFadeInFallback 0.2s ease-out;
}

/* Ensure dialog is above other elements */
#multipli-external-link-dialog {
    z-index: 9999;
}


