/* --- Google Fonts (FIXED URL) --- */
@import url('https://googleapis.com');

/* --- Root Variables --- */
:root {
    --primary-blue: #6c88c8;       
    --accent-purple: #9b59b6;     
    --accent-purple-hover: #8e44ad;
    --kindness-peach: #fff5f0;    
    --text-light: #ffffff;
    --text-dark: #4a4a4a;
    --border-light: #e8eef3;
    --skeleton-grey: #f0f0f0;
    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Quicksand', sans-serif;
}

/* --- Global Pretty Font --- */
* {
    font-family: var(--font-body);
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    background-color: #fdfdfd;
    overflow-x: hidden;
}

/* --- Header Section --- */
header {
    text-align: center;
    padding: 60px 0 0 0;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #8da9e6 100%);
    color: var(--text-light);
}

.logo {
    font-family: var(--font-heading);
    font-size: 5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.motto {
    font-style: italic;
    font-size: 1.2rem;
    margin: 15px 20px 30px;
    color: rgba(255, 255, 255, 0.95);
}

/* --- Modern Pill Search Bar --- */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 40px;
    max-width: 1200px; /* Matched to grid width */
    margin: 0 auto;
}

/* Inner wrapper to keep the pill shape together */
.search-container .pill-wrapper {
    display: flex;
    background: white;
    border-radius: 50px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden; 
    width: 100%;
    max-width: 600px;
}

.search-container input {
    flex: 1; 
    padding: 16px 25px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
}

#searchScope {
    padding: 0 15px;
    border: none;
    border-left: 1px solid #eee; 
    background-color: #f8faff; 
    color: var(--primary-blue);
    font-weight: 600;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.search-container button {
    padding: 0 35px;
    background: var(--accent-purple);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.3s, transform 0.2s;
    font-family: inherit;
}

.search-container button:hover {
    background: var(--accent-purple-hover);
}

/* --- No Results Visual (FIXED CENTERING) --- */
.no-results {
    grid-column: 1 / -1; /* Spans full grid width */
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 40px auto; /* Centers box on screen */
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.no-results h2 {
    color: var(--primary-blue);
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.no-results p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.no-results-btn {
    padding: 14px 30px;
    background: var(--kindness-peach);
    color: var(--primary-blue);
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 rgba(0,0,0,0.05);
}

.no-results-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}


/* --- Improved Mobile Responsiveness --- */
@media (max-width: 650px) {
    .search-container {
        padding: 0 20px 40px;
    }
    
    .search-container .pill-wrapper {
        flex-direction: column;
        border-radius: 20px; /* Squares off slightly for the vertical stack */
    }

    .search-container input, 
    #searchScope, 
    .search-container button {
        width: 100%;
        padding: 15px;
        border-left: none; /* Removes the side-by-side separators */
        border-bottom: 1px solid #eee; /* Adds separators between the stacked items */
        border-radius: 0;
    }

    .search-container button {
        border-bottom: none; /* No line under the last item */
        background: var(--accent-purple);
    }

    .logo {
        font-size: 3.5rem; /* Shrinks logo so it fits on one line on phones */
    }
}

/* =========================================
   1. GRID SYSTEM - FIXED
   ========================================= */
.grid-container {
    display: grid;
    /* auto-fill is often smoother than auto-fit for consistent card alignment */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 30px;
    padding: 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Card Container */
.grid-item {
    perspective: 1000px;
    height: 450px; 
    width: 100%; /* Ensures it fills the grid cell */
    position: relative;
    cursor: pointer; /* Feedback for users */
}

/* =========================================
   2. CARD 3D FLIP LOGIC - FIXED
   ========================================= */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother curve */
    transform-style: preserve-3d;
}

/* Flip Action */
.grid-item.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    inset: 0; /* Shorthand for top/left/width/height 100% */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden; /* Vital for Safari */
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.card-front {
    z-index: 2; /* Front sits on top initially */
    transform: rotateY(0deg); 
}


.card-back {
    transform: rotateY(180deg);
    z-index: 1; 
}
/* =========================================
   3. FRONT OF CARD - FIXED
   ========================================= */
.item-image-wrapper {
    flex: 1; /* Takes up all space except the title height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fafafa;
    overflow: hidden;
    position: relative; /* Anchor for the share button if moved */
}

.item-image-wrapper img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 280px; /* Increased slightly for better fit */
    object-fit: contain;
    
    /* Reveal logic */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Fallback: if you aren't using JS to add .loaded, remove the opacity:0 above */
.item-image-wrapper img.loaded {
    opacity: 1;
}

.item-title {
    height: 80px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kindness-peach, #ffe5d9); /* Added fallback hex */
    color: var(--primary-blue, #003366);   /* Added fallback hex */
    font-weight: 600; /* Titles usually need a bit of weight */
    font-size: 1.2rem; /* Scaled down slightly to prevent overflow on long titles */
    border-top: 1px solid var(--border-light, #eee);
    text-align: center;
    padding: 0 15px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.share-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    z-index: 10; /* Ensure it's above the front card content */
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* =========================================
   4. BACK OF CARD & SCROLLING - FIXED
   ========================================= */
.back-scroll-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal jitter */
    padding: 20px;
    
    /* Standard Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue, #003366) transparent;
    
    /* Smoothness Fixes */
    -webkit-overflow-scrolling: touch; /* Butter-smooth on iOS */
    transform: translateZ(0); /* Forces GPU rendering for better scroll performance */
}

/* Custom Scrollbar for Chrome/Safari */
.back-scroll-content::-webkit-scrollbar { 
    width: 6px; 
}
.back-scroll-content::-webkit-scrollbar-track {
    background: transparent;
}
.back-scroll-content::-webkit-scrollbar-thumb { 
    background: var(--primary-blue, #003366); 
    border-radius: 10px; 
}

.flip-back-btn {
    position: relative; /* Stays at the bottom of the flex column */
    z-index: 25; /* Ensures it sits above any scrolled content */
    padding: 12px;
    background: var(--primary-blue, #003366);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    margin: 15px;
    flex-shrink: 0; /* Prevents the button from squishing if text is long */
    transition: background 0.2s, transform 0.1s active;
}

.flip-back-btn:hover {
    filter: brightness(1.1);
}

.flip-back-btn:active {
    transform: scale(0.98);
}

/* =========================================
   NAVBAR & CATEGORY BUTTONS - FIXED
   ========================================= */

.navbar {
    background: var(--kindness-peach, #ffe5d9);
    border-top: 4px solid rgba(255,255,255,0.3);
    border-bottom: 1px solid var(--border-light, #eee);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
}

.navbar li {
    position: relative; 
    cursor: pointer;
}

.navbar li span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 25px;
    font-weight: 700;
    color: var(--primary-blue, #003366);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Active Highlight */
.navbar li.active > span {
    background: rgba(255, 255, 255, 0.5);
    color: var(--accent-purple, #6a5acd);
}

/* --- Dropdown Menus --- */
.dropdown {
    position: absolute;
    background: #ffffff;
    min-width: 220px;
    visibility: hidden;
    opacity: 0;
    margin-top: -2px; 
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.dropdown li span {
    padding: 12px 20px;
    color: var(--text-dark, #333);
    text-transform: none; 
    font-size: 0.9rem;
    font-weight: 500;
    justify-content: space-between;
}

/* Hover States */
.navbar li:hover > .dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.navbar li:hover > span,
.dropdown li:hover > span {
    background: rgba(255, 255, 255, 0.3);
}

.dropdown li:hover > span {
    background: var(--kindness-peach, #ffe5d9);
    color: var(--primary-blue, #003366);
}

/* --- Positioning Levels (Fixed Centering) --- */

/* 1. Main Navbar Dropdowns: Centered under parent */
.navbar > ul > li > .dropdown {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px); 
}

.navbar > ul > li:hover > .dropdown {
    transform: translateX(-50%) translateY(0);
}

/* 2. Nested Sub-Dropdowns: Fly out to the right */
.dropdown li > .dropdown {
    top: 0;
    left: 100%;
    margin-left: 0;
    transform: translateX(10px); 
}

.dropdown li:hover > .dropdown {
    transform: translateX(0);
}

/* --- Arrows --- */
.has-dropdown > span::after {
    content: '▾';
    margin-left: 8px;
    font-size: 0.7rem;
    opacity: 0.6;
}

.dropdown .has-dropdown > span::after {
    content: '▸';
}
/* --- Skeleton & Footer - FIXED --- */
.skeleton {
    background-color: var(--skeleton-grey, #e0e0e0);
    /* Use a smoother gradient and percentage-based sizing for the shimmer */
    background-image: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0, 
        rgba(255, 255, 255, 0.5) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

footer {
    padding: 60px 20px;
    text-align: center;
    background: var(--primary-blue, #003366);
    color: var(--text-light, #f8f8f8);
    margin-top: 80px;
    width: 100%;
    box-sizing: border-box;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 25px;
}

.footer-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.7;
}

/* --- Static Page Containers - FIXED --- */
.page-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 40px; /* Reduced slightly for mobile safety */
    background: #fff;
    border: 3px solid var(--kindness-peach, #ffe5d9);
    border-radius: 30px; /* Slightly more modern than 40px */
    box-shadow: 0 15px 40px rgba(108, 136, 200, 0.08);
    box-sizing: border-box; /* Crucial to prevent horizontal scroll */
}

.page-container h2 { 
    font-family: var(--font-heading, sans-serif); 
    font-size: clamp(2rem, 8vw, 3.5rem); /* Responsive font sizing */
    color: var(--primary-blue, #003366); 
    text-align: center; 
    margin-bottom: 10px; 
}

.legal-text h3, .about-section h3 { 
    color: var(--primary-blue, #003366); 
    font-size: 1.4rem; 
    margin-top: 35px; 
    border-bottom: 2px solid var(--kindness-peach, #ffe5d9); 
    display: inline-block; 
}

/* --- Contact Form - FIXED --- */
.input-group { 
    margin-bottom: 25px; 
    text-align: left; 
}

.input-group label { 
    display: block; 
    font-weight: 700; 
    color: var(--primary-blue, #003366); 
    margin-bottom: 8px; 
}

.input-group input, 
.input-group textarea { 
    width: 100%; 
    padding: 15px; 
    border: 2px solid var(--kindness-peach, #ffe5d9); 
    border-radius: 12px; 
    outline: none; 
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Added Focus States for Accessibility */
.input-group input:focus, 
.input-group textarea:focus {
    border-color: var(--primary-blue, #003366);
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}
/* =========================================
   9. ADS - FIXED
   ========================================= */

.ad-tile {
    /* Ensure it behaves like a standard grid-item */
    width: 100%;
    height: 450px; 
    display: flex !important;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-light, #eee);
    padding: 15px; /* Slightly more breathing room */
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden !important;
    position: relative; /* Anchor for potential 'AD' labels */
}

/* 
   Aggressive AdSense Overrides:
   Targets the 'ins' and internal 'iframe' AdSense generates 
*/
.ad-tile ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 420px; /* Leave a small gap for padding */
    text-decoration: none !important;
}

.ad-tile iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 10px; /* Optional: curves the ad itself */
}

/* Optional: Add a subtle 'Advertisement' label so it's UX friendly */
.ad-tile::before {
    content: "ADVERTISEMENT";
    position: absolute;
    top: 5px;
    font-size: 0.65rem;
    color: #bbb;
    letter-spacing: 1px;
}

/* Responsive Scaling */
@media (max-width: 600px) {
    .ad-tile {
        height: 300px; /* Common mobile ad height (300x250 style) */
    }
    .ad-tile ins.adsbygoogle {
        max-height: 270px;
    }
}


/* =========================================
   FIXED: Secondary Header Colour
   ========================================= */
.secondary-header {
    text-align: center;
    padding: 40px 20px 30px;
    /* Force the peach background */
    background-color: var(--kindness-peach, #ffe5d9) !important; 
    border-bottom: 1px solid var(--border-light, #eee);
    width: 100%;
    box-sizing: border-box;
}

/* Ensure the sub-nav doesn't inherit transparency */
.subpage-nav {
    background: transparent;
    margin-top: 20px;
}

/* The actual "Back to Home" button style */
.btn-home {
    display: inline-flex; /* Better for icon alignment if added later */
    align-items: center;
    padding: 12px 28px;
    background-color: var(--accent-purple, #8e44ad);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 50px; /* Fully pill-shaped */
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.2);
}

.btn-home:hover {
    background-color: #7d3c98;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(142, 68, 173, 0.3);
}

.btn-home:active {
    transform: translateY(-1px);
}

/* Styling for the footer button to match */
.footer-links .btn-home-footer {
    font-weight: 800;
    color: var(--accent-purple, #8e44ad);
    margin-right: 15px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.footer-links .btn-home-footer:hover {
    border-bottom-color: var(--accent-purple, #8e44ad);
}



/* =========================================
   11. LEGAL & ABOUT PAGE STYLING - FIXED
   ========================================= */

.page-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 60px;
    background: #ffffff;
    border: 3px solid var(--kindness-peach, #ffe5d9);
    border-radius: 40px;
    box-shadow: 0 15px 40px rgba(108, 136, 200, 0.05);
    box-sizing: border-box; /* Critical to prevent padding from expanding width */
}

.legal-text, .about-section {
    line-height: 1.8;
    color: var(--text-dark, #333);
}

h1.legal-text {
    font-family: var(--font-heading, sans-serif);
    /* Responsive font: minimum 2.5rem, grows with screen, max 4rem */
    font-size: clamp(2.5rem, 10vw, 4rem); 
    color: var(--primary-blue, #003366);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.1;
}

.legal-text h2, .about-section h2 {
    color: var(--accent-purple, #8e44ad);
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: 700;
}

/* Center the section headers and add breathing room */
.about-section {
    margin-bottom: 50px;
}

.about-section h3 {
    display: block; /* Change from inline-block to span the width */
    text-align: center;
    margin: 40px auto 25px;
    padding-bottom: 10px;
    width: fit-content;
}

/* Style the LOVMJ Letter Lists */
.about-section ul {
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
}

.about-section li {
    background: #fff9f6; /* Very light peach tint */
    margin-bottom: 15px;
    padding: 20px 25px;
    border-radius: 15px;
    border-left: 5px solid var(--kindness-peach, #ffe5d9);
    transition: transform 0.2s ease;
}

.about-section li:hover {
    transform: translateX(10px); /* Subtle nudge on hover */
    background: #fff;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.05);
}

/* Make the Letters (L, o, v, M, j) stand out */
.about-section li strong {
    color: var(--primary-blue, #003366);
    font-size: 1.2rem;
    font-family: var(--font-heading, sans-serif);
    margin-right: 5px;
    display: inline-block;
}

/* Add a nice fade-in for the text after the letter */
.about-section li em {
    color: var(--primary-blue, #003366);
    font-style: normal;
    font-weight: 600;
    text-transform: lowercase;
}

.legal-text h3 {
    color: var(--primary-blue, #003366);
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--kindness-peach, #ffe5d9);
    display: inline-block;
}

.legal-text p, .legal-text li {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* --- Lists --- */
.legal-text ul, .legal-text ol {
    padding-left: 0;
    margin-left: 25px; /* Ensures bullets stay inside the container */
    margin-bottom: 25px;
}

.legal-text li {
    margin-bottom: 12px;
    padding-left: 5px;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .page-container {
        margin: 20px 15px;
        padding: 40px 25px; /* Balanced padding for tablets/phones */
        border-radius: 25px;
    }
    
    .legal-text h2 {
        font-size: 1.5rem;
    }
}

/* =========================================
   ADDITIONAL CONSISTENCY UPDATES - FIXED
   ========================================= */

/* 1. Values Grid - Cleaned up spacing */
.values-grid {
    display: grid;
    /* auto-fill is safer here to prevent cards from stretching too wide */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0; /* Vertical spacing from text */
}

.value-card {
    background: var(--kindness-peach, #ffe5d9);
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-light, #eee);
    transition: transform 0.2s ease;
}

.value-card:hover {
    transform: translateY(-5px);
}

.value-card strong {
    display: block;
    color: var(--primary-blue, #003366);
    font-size: 1.25rem;
    margin-bottom: 10px;
}

/* 2. Form Styling - Added missing Submit Button style */
.input-group {
    margin-bottom: 25px;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 700;
    color: var(--primary-blue, #003366);
    margin-bottom: 8px;
}

.input-group input, 
.input-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--kindness-peach, #ffe5d9);
    border-radius: 15px;
    font-family: inherit;
    outline: none;
    font-size: 1rem;
    box-sizing: border-box; /* Prevents width overflow */
    transition: border-color 0.3s;
}

.input-group input:focus, 
.input-group textarea:focus {
    border-color: var(--primary-blue, #003366);
}

/* Specific Style for Form Submit Buttons */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--primary-blue, #003366);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    opacity: 0.9;
}

/* 3. Navigation Buttons */
.subpage-nav {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px;
    background-color: var(--accent-purple, #8e44ad);
    color: white !important;
    text-decoration: none;
    border-radius: 35px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Snappy bounce */
    box-shadow: 0 4px 10px rgba(142, 68, 173, 0.2);
}

.btn-home:hover {
    background-color: var(--accent-purple-hover, #7d3c98);
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(142, 68, 173, 0.3);
}

/* =========================================
   COOKIE SYSTEM - FIXED & POLISHED
   ========================================= */

#lv-notice { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: var(--kindness-peach, #ffe5d9); 
    border-top: 4px solid var(--accent-purple-hover, #7d3c98); 
    padding: 20px; /* Uniform padding is safer for mobile */
    z-index: 10001; /* Must be higher than navbar/sticky elements */
    display: none; 
    justify-content: center; 
    align-items: center; 
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

#lv-modal { 
    position: fixed; 
    inset: 0;
    background: rgba(40, 55, 90, 0.6); 
    backdrop-filter: blur(10px); 
    z-index: 10002; /* Higher than everything else */
    display: none; 
    justify-content: center; 
    align-items: center; 
    padding: 20px;
    /* ADD THIS: */
    pointer-events: auto !important; 
}




/* Visibility Override */
#lv-notice.show-flex, 
#lv-modal.show-flex {
    display: flex !important;
    animation: slideUp 0.4s ease-out; /* Smooth entry */
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Content Layout */
.cookie-content {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    max-width: 1100px; 
    gap: 30px;
}

.cookie-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: var(--primary-blue, #003366);
}

.cookie-buttons {
    display: flex;
    align-items: center;
    gap: 15px; 
}

/* =========================================
   FIXED: Cookie Settings Link
   ========================================= */
.btn-settings { 
    background: transparent !important; 
    color: var(--primary-blue, #003366) !important; 
    text-decoration: underline; 
    border: none; 
    cursor: pointer; 
    padding: 10px; 
    font-weight: 600; 
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.btn-settings:hover {
    opacity: 0.7;
    color: var(--accent-purple, #8e44ad) !important;
}

/* --- Modal Improvements --- */
.modal-content { 
    background: #ffffff; 
    padding: clamp(20px, 5vw, 40px); /* Responsive padding */
    border-radius: 30px; 
    max-width: 500px; 
    width: 100%; 
    max-height: 90vh; /* Prevents overflow on short screens */
    overflow-y: auto;
    text-align: center; 
    border: 3px solid var(--kindness-peach, #ffe5d9); 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    box-sizing: border-box;
    position: relative;
    z-index: 10003; /* One level higher than its parent backdrop */
    pointer-events: auto !important;
}




.setting-item { 
    background: #fdfdfd; 
    border: 1px solid var(--border-light, #eee); 
    padding: 15px 20px; 
    border-radius: 15px; 
    margin-bottom: 12px; 
    text-align: left; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Buttons --- */
.btn-accept, .btn-reject { 
    background: var(--primary-blue, #003366); 
    color: white; 
    border: none; 
    padding: 12px 25px; 
    border-radius: 50px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-accept:hover { 
    background: var(--accent-purple-hover, #7d3c98); 
    transform: translateY(-2px); 
}


.btn-reject:hover {
    background: var(--accent-purple-hover, #7d3c98);
    transform: translateY(-2px); 
}

/* --- Mobile Fixes --- */
@media (max-width: 768px) { 
    .cookie-content { flex-direction: column; text-align: center; gap: 20px; }
    .cookie-buttons { flex-direction: column-reverse; width: 100%; }
    .cookie-buttons button, .cookie-buttons .btn-settings { width: 100%; text-align: center; }
    .modal-btns { grid-template-columns: 1fr; }
}


/* =========================================
   SHARE LINK & TOAST - FIXED
   ========================================= */

.share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-blue, #003366);
    cursor: pointer;
    z-index: 5; 
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.share-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Visibility Logic during Flip */
.grid-item.is-flipped .share-btn {
    display: none; 
}

.grid-item.is-flipped .card-back {
    z-index: 10; 
    visibility: visible;
}

.grid-item.is-flipped .card-front {
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s 0.3s; /* Hide front halfway through the flip */
}

/* --- Share Toast Notification --- */
.share-toast {
    position: fixed;
    bottom: 30px; /* Elevated slightly for better visibility */
    left: 50%;
    transform: translateX(-50%) translateY(150%); /* Hidden further down */
    background: #2c3e50; /* Slightly softer than pure #333 */
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 20000; /* Above even the cookie modal */
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Optional: Add a checkmark icon to the toast via CSS */
.share-toast::before {
    content: '✓';
    color: #2ecc71;
    font-weight: 900;
}