/* =========================================
   1. Configuration (CSS Variables)
   ========================================= */
:root {
    /* --- Colors --- */
    --empeeryal-color-primary: #0284c7;       /* Main Button Color */
    --empeeryal-color-primary-hover: #0369a1; /* Button Hover */
    --empeeryal-color-text: #475569;          /* Label Text */
    --empeeryal-color-text-inverse: #ffffff;  /* Button Text */
    --empeeryal-bg-wrapper: #f8fafc;          /* Box Background */
    --empeeryal-border-color: #e2e8f0;        /* Borders */
    
    /* --- Modal Specifics --- */
    --empeeryal-modal-overlay: rgba(15, 23, 42, 0.9);
    --empeeryal-modal-bg: #ffffff;
    --empeeryal-iframe-bg: #f1f5f9;
    
    /* --- Dimensions & Spacing --- */
    --empeeryal-spacing-md: 1.5rem;
    --empeeryal-radius-sm: 4px;
    --empeeryal-radius-lg: 8px;
    
    /* --- Z-Index (Critical for Modals) --- */
    /* High number to ensure it sits on top of sticky headers */
    --empeeryal-z-index: 100000; 
}

/* =========================================
   2. Block Wrapper & Button
   ========================================= */
.empeeryal-demo-wrapper {
    margin: 2rem 0;
    padding: var(--empeeryal-spacing-md);
    background-color: var(--empeeryal-bg-wrapper);
    border: 1px solid var(--empeeryal-border-color);
    border-radius: var(--empeeryal-radius-lg);
    text-align: center;
    box-sizing: border-box;
}

.empeeryal-demo-label {
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    color: var(--empeeryal-color-text);
    font-size: 1rem;
}

.empeeryal-demo-button {
    display: inline-block;
    background-color: var(--empeeryal-color-primary);
    color: var(--empeeryal-color-text-inverse);
    padding: 0.75rem 1.5rem;
    border-radius: var(--empeeryal-radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.empeeryal-demo-button:hover {
    background-color: var(--empeeryal-color-primary-hover);
}

.empeeryal-demo-button:focus {
    outline: 2px solid var(--empeeryal-color-primary);
    outline-offset: 2px;
}

.empeeryal-demo-button:active {
    transform: translateY(1px);
}

/* =========================================
   3. Modal Overlay & Container
   ========================================= */
.empeeryal-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--empeeryal-z-index);
}

/* Active State */
.empeeryal-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark Overlay */
.empeeryal-modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--empeeryal-modal-overlay);
    backdrop-filter: blur(4px); /* Modern blur effect */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* White Container */
.empeeryal-modal-container {
    position: relative;
    width: 90%;
    height: 85%;
    max-width: 1200px;
    background: var(--empeeryal-modal-bg);
    border-radius: var(--empeeryal-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    
    /* Animation Defaults */
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animation Active State */
.empeeryal-modal.is-open .empeeryal-modal-container {
    transform: scale(1);
    opacity: 1;
}

/* =========================================
   4. Modal Close Button
   ========================================= */
.empeeryal-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: var(--empeeryal-modal-bg);
    border: 1px solid var(--empeeryal-border-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.empeeryal-modal-close:hover {
    background: var(--empeeryal-bg-wrapper);
}

.empeeryal-modal-close:focus {
    outline: 2px solid white;
    box-shadow: 0 0 0 4px var(--empeeryal-color-primary);
}

/* CSS-only 'X' Icon */
.empeeryal-modal-close::before,
.empeeryal-modal-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background-color: #334155;
}
.empeeryal-modal-close::before {
    transform: rotate(45deg);
}
.empeeryal-modal-close::after {
    transform: rotate(-45deg);
}

/* =========================================
   5. Iframe & Utilities
   ========================================= */
.empeeryal-iframe-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    border-radius: var(--empeeryal-radius-lg);
    overflow: hidden;
    background-color: var(--empeeryal-iframe-bg);
}

iframe#empeeryal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}