/* Ad-Free Banner Styles */
.ad-free-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8B0000; /* Dark Red/Brown background */
    color: white;
    padding: 8px 16px;
    border-radius: 4px; /* Slightly rounded corners */
    text-decoration: none;
    font-weight: bold;
    font-family: 'Hind', sans-serif; /* Match site font */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s, transform 0.1s;
    cursor: pointer;
    margin-left: 15px; /* Spacing from other nav items */
    white-space: nowrap;
}

.ad-free-banner:hover {
    background-color: #a50000; /* Lighter red on hover */
    transform: translateY(-1px);
}

.ad-free-banner:active {
    transform: translateY(1px);
}

.ad-free-banner .icon-stop {
    background-color: white;
    color: #8B0000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 10px;
    font-weight: 900;
}

.ad-free-banner .text {
    font-size: 15px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6); /* Semi-transparent background */
    z-index: 9999; /* Max z-index */
    display: flex; /* Flex to center content */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.close-modal:hover {
    color: #000;
}

.login-btn {
    background: white;
    color: #444;
    border: 1px solid #ccc;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-family: 'Hind', sans-serif;
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.login-btn:hover {
    background: #f7f7f7;
    box-shadow: 4px 8px rgba(0,0,0,0.1);
}

/* Hide on very small screens if needed, or adjust padding */
@media (max-width: 600px) {
    .ad-free-banner {
        padding: 5px 10px;
        font-size: 13px;
    }
}

/* ============================================================
   CLS FIX: Pre-reserved Ad Slot Containers
   - Space is reserved BEFORE the ad loads so content never jumps
   - Eliminates Cumulative Layout Shift (CLS) from ad injection
   ============================================================ */
.divine-ad-slot {
    display: block;
    width: 100%;
    /* Reserve height so page layout is stable before ad loads.
       250px = common responsive ad height on mobile.
       When the real ad fills in, it either matches or the slot
       is already tall enough — NO content shift. */
    min-height: 250px;
    overflow: hidden;
    /* Isolate this container from the rest of the layout so
       any size change inside it can never shift outside content */
    contain: layout style;
    box-sizing: border-box;
    margin: 8px auto;
    text-align: center;
    background: transparent;
}

/* Top slot (after breadcrumb) — give a bit of breathing room and reserve exact height */
.divine-ad-slot.divine-ad-top {
    margin-top: 4px;
    margin-bottom: 12px;
    height: 250px;
    min-height: 250px;
}

/* Bottom slot (before footer) */
.divine-ad-slot.divine-ad-bottom {
    margin-top: 12px;
    margin-bottom: 4px;
}

/* Reset AdSense <ins> tag so it respects our container */
.divine-ad-slot ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
}

/* Reserve space for Auto Ads anchor bar at bottom of viewport
   so it doesn't cover content and trigger layout shift */
body {
    padding-bottom: 60px;
}

/* On desktop the anchor bar is taller */
@media (min-width: 768px) {
    body {
        padding-bottom: 90px;
    }
    .divine-ad-slot {
        min-height: 90px;
    }
}
