/* ============================================
   iOS 26 EDGE-TO-EDGE ENHANCEMENTS
   Liquid Glass safe area support
   ============================================ */

.link-html {
    height: 100%;
    /* iOS 26: html background extends into status bar */
    background-color: var(--dynamic-bg-color, transparent);
    min-height: 100vh;
    min-height: 100dvh;
}

.link-body {
    /* Edge-to-edge background that bleeds behind safe areas */
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    min-height: 100dvh;
    
    /* Remove default margins to allow full bleed */
    margin: 0;
    padding: 0;
}

/* ============================================
   VIDEO BACKGROUNDS - EDGE-TO-EDGE
   ============================================ */

.link-video-background {
    object-fit: cover;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* iOS 26 dynamic viewport */
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    
    /* Extend into safe areas on iOS 26 */
    margin-top: calc(-1 * var(--safe-area-top, 0px));
    margin-left: calc(-1 * var(--safe-area-left, 0px));
    width: calc(100vw + var(--safe-area-left, 0px) + var(--safe-area-right, 0px));
    height: calc(100vh + var(--safe-area-top, 0px) + var(--safe-area-bottom, 0px));
    height: calc(100dvh + var(--safe-area-top, 0px) + var(--safe-area-bottom, 0px));
}

/* ============================================
   BACKDROP - EDGE-TO-EDGE WITH GLASS EFFECT
   ============================================ */

.link-body-backdrop {
    position: fixed;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    top: 0;
    left: 0;
    z-index: -1;
    
    /* Extend into safe areas */
    margin-top: calc(-1 * var(--safe-area-top, 0px));
    margin-left: calc(-1 * var(--safe-area-left, 0px));
    width: calc(100vw + var(--safe-area-left, 0px) + var(--safe-area-right, 0px));
    height: calc(100vh + var(--safe-area-top, 0px) + var(--safe-area-bottom, 0px));
    height: calc(100dvh + var(--safe-area-top, 0px) + var(--safe-area-bottom, 0px));
    
    /* Background extends edge-to-edge */
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* Optional: Glass morphism overlay for backdrop */
.link-body-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(var(--dynamic-bg-color-rgb, 0, 0, 0), 0.2);
    backdrop-filter: blur(0px) saturate(100%);
    -webkit-backdrop-filter: blur(0px) saturate(100%);
    transition: backdrop-filter 0.3s ease;
}

.link-body-backdrop.glass-effect::after {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

/* ============================================
   INFO & SHARE BUTTONS - SAFE AREA AWARE
   ============================================ */

.link-info {
    position: fixed;
    z-index: 1000;
    bottom: max(1rem, calc(var(--safe-area-bottom, 0px) + 1rem));
    left: max(1rem, calc(var(--safe-area-left, 0px) + 1rem));
}

.link-info a {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    min-width: 40px;
    min-height: 40px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    background-color: rgba(0, 0, 0, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.link-info a:hover {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    background-color: rgba(0, 0, 0, 0.25);
    color: white;
    transform: scale(1.05);
}

/* Share button - iOS 26 safe area aware */
.share-button-wrapper {
    position: fixed;
    z-index: 1000;
    top: max(1rem, calc(var(--safe-area-top, 0px) + 1rem));
    right: max(1rem, calc(var(--safe-area-right, 0px) + 1rem));
}

.share-button {
    border-radius: 50%;
    min-width: 45px;
    min-height: 45px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    background-color: rgba(0, 0, 0, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.share-button:hover {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    background-color: rgba(0, 0, 0, 0.25);
    color: white;
    transform: scale(1.05);
}

/* ============================================
   CONTENT AREA - SAFE AREA PADDING
   ============================================ */

.link-content {
    /* Account for safe areas on all sides */
    padding-top: max(2rem, calc(var(--safe-area-top, 0px) + 2rem));
    padding-bottom: max(2rem, calc(var(--safe-area-bottom, 0px) + 2rem));
    padding-left: max(1rem, var(--safe-area-left, 0px));
    padding-right: max(1rem, var(--safe-area-right, 0px));
    
    /* Ensure content is visible above background */
    position: relative;
    z-index: 1;
    
    /* Use dynamic viewport height */
    min-height: 100dvh;
}

/* ============================================
   PROFILE IMAGE / AVATAR
   ============================================ */

.link-image {
    width: 125px;
    height: 125px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.link-verified {
    border: 2px solid #fff;
    border-radius: 50rem;
    padding: 0.35rem 0.55rem;
    background: #0086ff;
    color: #fff;
    font-weight: bold;
}

.link-verified-small {
    color: #0086ff;
    vertical-align: text-top;
}

.link-verified-small .fa-stack {
    font-size: .80rem;
}

/* ============================================
   BUTTONS & LINKS
   ============================================ */

.link-btn {
    position: relative;
    white-space: normal;
    word-wrap: break-word;
    padding: 1rem 4.5rem;
    font-size: 1.1rem;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    border-radius: 0;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.link-btn:hover {
    animation: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.link-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.link-btn-straight {
    border-radius: 0;
}

.link-btn-round {
    border-radius: 50px;
}

.link-btn-rounded {
    border-radius: 12px;
}

.link-avatar-straight {
    border-radius: 0;
}

.link-avatar-round {
    border-radius: 50rem;
}

.link-avatar-rounded {
    border-radius: 12px;
}

/* Hover animations */
.link-hover-animation-smooth {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-hover-animation-smooth:hover, 
.link-hover-animation-instant:hover {
    transform: scale(1.02);
}

.link-hover-animation-smooth:active, 
.link-hover-animation-instant:active {
    transform: scale(0.98);
}

/* Button images */
.link-btn-image-wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-width: 45px;
    max-height: 45px;
    position: absolute;
    top: 50%;
    margin-top: -22.5px;
    margin-left: -4.1rem;
    border-radius: 8px;
}

[dir="rtl"] .link-btn-image-wrapper {
    margin-left: initial;
    margin-right: -4.1rem;
}

.link-btn-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ============================================
   BIG LINK BUTTONS
   ============================================ */

.link-big-btn {
    padding: 1rem;
    min-height: 80px;
}

.link-big-btn-image-wrapper {
    overflow: hidden;
    width: 15%;
    height: auto;
    max-height: calc(100% - 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    border-radius: 8px;
}

.link-big-btn-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.link-big-content-wrapper {
    margin-left: 15%;
    width: 70%;
    padding: 0 1rem;
}

.link-big-icon-wrapper {
    width: 15%;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.link-grid-image-wrapper {
    position: relative;
    width: 100%;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    background-position: center;
    background-size: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.link-grid-image-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.link-grid-image-wrapper-columns-2 {
    height: 10rem;
}

.link-grid-image-wrapper-columns-3 {
    height: 6rem;
}

@media (min-width: 992px) {
    .link-grid-image-wrapper-columns-2 {
        height: 20rem;
    }

    .link-grid-image-wrapper-columns-3 {
        height: 10rem;
    }
}

.link-grid-image-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 3rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: .25rem 1rem;
}

.link-grid-image-overlay-text {
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    width: 100%;
    font-weight: 600;
}

/* ============================================
   EXTERNAL ITEMS & MEDIA
   ============================================ */

.link-external-item-image {
    width: 100%;
    height: auto;
    max-height: 10rem;
    object-fit: cover;
    border-radius: 8px;
}

.link-iframe-round {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.link-iframe-child-round iframe {
    border-radius: 12px;
}

.link-round {
    border-radius: 12px;
}

#links > .row > div:target {
    transform: scale(1.02);
    transition: transform 0.2s;
}

/* ============================================
   REVIEW BLOCKS
   ============================================ */

.link-review-image {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50rem;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.8);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================
   IMAGE SLIDER
   ============================================ */

.link-image-slider-image {
    object-fit: cover;
    border-radius: 8px;
}

/* ============================================
   FAQ BLOCKS
   ============================================ */

.link-faq button {
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

/* ============================================
   FOOTER
   ============================================ */

.link-footer {
    margin: 3rem 0;
    padding-bottom: max(2rem, calc(var(--safe-area-bottom, 0px) + 2rem));
}

.link-footer-branding {
    font-size: .9rem;
    opacity: 0.7;
}

/* ============================================
   MODALS - GLASS MORPHISM
   ============================================ */

.modal-header {
    padding: 1rem;
    border-bottom: 0;
}

.modal-subheader {
    padding: 0 1rem;
    border-bottom: 0;
    margin: 0;
}

.modal-content {
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
}

.modal-backdrop {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 1 !important;
}

/* ============================================
   FORM OVERRIDES
   ============================================ */

form .btn-primary {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

form .btn-primary, 
form .btn-primary:hover, 
form .btn-primary:focus, 
form .btn-primary:active {
    background: black !important;
    border-color: black !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

form .btn-primary:hover, 
form .btn-primary:focus {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

form .btn-primary:active {
    opacity: 0.75;
    transform: translateY(0);
}

.btn:focus, 
.btn:active {
    box-shadow: none !important;
}

/* ============================================
   PREVIEW HIGHLIGHT
   ============================================ */

[data-webpage-block-id] {
    transition: all 0.2s;
    border: 2px solid transparent;
}

[data-webpage-block-id].preview-highlight {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
}

/* ============================================
   HEADER BLOCK
   ============================================ */

.link-header-avatar {
    position: absolute;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================
   SMALLER ROUNDED BUTTONS
   ============================================ */

[data-webpage-block-type="review"] .link-btn-round,
[data-webpage-block-type="paragraph"] .link-btn-round,
[data-webpage-block-type="business_hours"] .link-btn-round {
    border-radius: 25px;
}

/* ============================================
   PARAGRAPH SPACING
   ============================================ */

[data-webpage-block-type="paragraph"] p:last-child {
    margin-bottom: 0;
}

/* ============================================
   BUSINESS HOURS
   ============================================ */

.link-business-hours-icon-wrapper {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50rem;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.2;
    background: rgba(0, 0, 0, 0.05);
}

/* ============================================
   QUILL EDITOR
   ============================================ */

.ql-content p {
    margin-bottom: 0 !important;
}

/* ============================================
   iOS 26 LANDSCAPE ORIENTATION
   ============================================ */

@media (orientation: landscape) {
    .link-content {
        padding-left: max(1rem, calc(var(--safe-area-left, 0px) + 1rem));
        padding-right: max(1rem, calc(var(--safe-area-right, 0px) + 1rem));
    }
    
    .link-info {
        left: max(1rem, calc(var(--safe-area-left, 0px) + 1rem));
    }
    
    .share-button-wrapper {
        right: max(1rem, calc(var(--safe-area-right, 0px) + 1rem));
    }
}

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

@media (prefers-color-scheme: dark) {
    .link-info a,
    .share-button {
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .link-info a:hover,
    .share-button:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .modal-content {
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .link-btn {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .link-btn:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .link-info,
    .share-button-wrapper {
        display: none;
    }
    
    .link-content {
        padding: 1rem;
    }
}
