/**
 * GSRNC iFrame Fallbacks - Default Theme CSS
 * Provides a soft background with border and rounded corners
 */

/* CSS Custom Properties for easy theming */
:root {
    --gsrnc-border: #e0e0e0;
    --gsrnc-bg: #f8f9fa;
    --gsrnc-fg: #333333;
    --gsrnc-link: #0073aa;
    --gsrnc-link-hover: #005a87;
    --gsrnc-shadow: rgba(0, 0, 0, 0.1);
    --gsrnc-border-radius: 8px;
    --gsrnc-spacing: 16px;
    --gsrnc-font-size: 14px;
}

/* Main fallback container */
.gsrnc-iframe-fallback {
    background-color: #fcf6e9;
    border: none;
    border-radius: var(--gsrnc-border-radius);
    padding: var(--gsrnc-spacing);
    margin: 8px 0;
    box-shadow: 0 2px 4px var(--gsrnc-shadow);
    font-family: 'Fira Sans', Arial, Helvetica, 'Nimbus Sans L', sans-serif;
    font-size: var(--gsrnc-font-size);
    line-height: 1.5;
    color: var(--gsrnc-fg);
    position: relative;
    overflow: hidden;
    
    /* Ensure proper display */
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Alternative class name compatibility */
.iframe-fallback {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background-color: var(--gsrnc-bg, #f8f9fa);
    color: var(--gsrnc-fg, #333);
    margin: 8px 0;
    font-family: inherit;
}

.iframe-fallback a {
    text-decoration: underline;
    color: var(--gsrnc-link, #0073aa);
}

/* Content wrapper */
.gsrnc-iframe-fallback-content {
    text-align: center;
    max-width: 100%;
}

/* Fallback message */
.gsrnc-iframe-fallback-message {
    margin: 0 0 12px 0;
    font-size: var(--gsrnc-font-size);
    line-height: 1.4;
    color: #422717;
    padding-bottom: 0;
    font-size: 17px;
    margin-top: 6px;
}

/* Fallback link */
.gsrnc-iframe-fallback-link {
    display: inline-block;
    text-decoration: underline;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--gsrnc-font-size);
    
    /* Ensure link is accessible */
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #f8992b;
    border-color: #f8992b;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: -20px;
}

.gsrnc-iframe-fallback-link:hover,
.gsrnc-iframe-fallback-link:focus {color: #fff;background: #41271b;}

.gsrnc-iframe-fallback-link:active {
    transform: translateY(1px);
}

/* Focus management */
.gsrnc-iframe-fallback:focus {
    outline: 2px solid var(--gsrnc-link);
    outline-offset: 2px;
}

/* Screen reader only content */
.gsrnc-iframe-fallback .sr-only,
.gsrnc-iframe-fallback-announcement {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Modal-specific styles */
.modal .gsrnc-iframe-fallback,
.dialog .gsrnc-iframe-fallback,
.popup .gsrnc-iframe-fallback,
[role="dialog"] .gsrnc-iframe-fallback,
[aria-modal="true"] .gsrnc-iframe-fallback {
    margin: 16px auto;
    max-width: 90%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gsrnc-iframe-fallback {
        padding: 12px;
        margin: 6px 0;
        font-size: 13px;
    }
    
    .gsrnc-iframe-fallback-link {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .gsrnc-iframe-fallback {
        padding: 10px;
        border-radius: 6px;
    }
    
    .gsrnc-iframe-fallback-message {
        margin-bottom: 10px;
        font-size: 12px;
    }
    
    .gsrnc-iframe-fallback-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gsrnc-iframe-fallback {
        border-width: 2px;
        background-color: white;
        color: black;
    }
    
    .gsrnc-iframe-fallback-link {
        color: #0000EE;
        border: 1px solid currentColor;
    }
    
    .gsrnc-iframe-fallback-link:hover,
    .gsrnc-iframe-fallback-link:focus {
        background-color: #FFFF00;
        color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gsrnc-iframe-fallback-link {
        transition: none;
    }
    
    .gsrnc-iframe-fallback-link:active {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --gsrnc-border: #404040;
        --gsrnc-bg: #2c2c2c;
        --gsrnc-fg: #e0e0e0;
        --gsrnc-link: #66b3ff;
        --gsrnc-link-hover: #4da6ff;
        --gsrnc-shadow: rgba(0, 0, 0, 0.3);
    }
}

/* Print styles */
@media print {
    .gsrnc-iframe-fallback {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .gsrnc-iframe-fallback-link {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .gsrnc-iframe-fallback-link:after {
        content: " (" attr(href) ")";
        font-size: 11px;
        font-weight: normal;
    }
}

/* RTL support */
[dir="rtl"] .gsrnc-iframe-fallback {
    text-align: center; /* Center alignment works for RTL too */
}

/* Animation for when fallback appears */
.gsrnc-iframe-fallback {
    animation: gsrnc-fade-in 0.3s ease-out;
    margin: 20px 0;
}

@keyframes gsrnc-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disable animation for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gsrnc-iframe-fallback {
        animation: none;
    }
}

/* Body class when fallbacks are active */
body.gsrnc-iframe-fallback-active {
    /* Can be used for global styles when fallbacks are present */
}

body.gsrnc-prefers-reduced-motion .gsrnc-iframe-fallback {
    animation: none;
    transition: none;
}

body.gsrnc-prefers-reduced-motion .gsrnc-iframe-fallback-link {
    transition: none;
    transform: none !important;
}


.sgpb-popup-dialog-main-div-wrapper	.gsrnc-iframe-fallback{
	margin: 0 !important;
	margin-bottom: -20px !important;
}