/* === Celebrity Card Component (Homepage) === */
.celebrity-card {
    text-decoration: none;
    color: var(--c-content);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.celebrity-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px -10px var(--c-shadow);
}

.card-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.card-category {
    font-size: 0.9rem;
    color: #6e6e73;
    margin: 0;
}

/* === Category Filter Buttons === */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.category-button {
    font-family: var(--font-family);
    padding: 10px 25px;
    font-size: 1rem;
    border-radius: 99px;
    border: 1px solid transparent;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--c-content);
    transition: all 0.2s ease-in-out;
}

.category-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.category-button.active {
    background-color: #007aff;
    color: #fff;
    font-weight: 700;
    border-color: #007aff;
}


/* === STYLES FOR CELEBRITY DETAIL PAGE (FINAL & SCALED DOWN) === */
.celebrity-detail-page {
    max-width: 900px;
    margin: 40px auto;
}

.celebrity-info {
    text-align: center;
    margin-bottom: 30px; /* Adjusted spacing */
}

.celebrity-info h1 {
    font-size: 2.2rem; /* Scaled down */
    margin-bottom: 15px;
}

.info-meta {
    display: flex;
    justify-content: center;
    gap: 25px; /* Scaled down */
    color: #6e6e73;
    flex-wrap: wrap;
    padding: 15px; /* Scaled down */
    border-radius: var(--border-radius);
    background-color: #fff;
    box-shadow: 0 4px 12px var(--c-shadow);
    font-size: 0.9rem; /* Scaled down */
}

.detail-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px; /* Scaled down */
    border-radius: 30px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 var(--c-shadow);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.8;
    z-index: 1;
}

.image-frame {
    padding: 12px; /* Scaled down */
    border-radius: 22px;
    margin-bottom: 20px;
    z-index: 2;
    max-width: 400px; /* Scaled down */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.detail-hero img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 350px; /* Scaled down */
    object-fit: contain;
    border-radius: 15px;
}

.hero-caption {
    z-index: 2;
    position: relative;
    text-align: center;
}

.hero-caption p {
    font-size: 1.1rem; /* Scaled down */
    font-style: italic;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    margin: 0 0 15px 0;
}

.insta-link {
    display: inline-block;
    background-color: #007aff;
    color: #fff;
    padding: 8px 18px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.insta-link:hover {
    transform: scale(1.05);
}

/* === SVG Background Patterns === */

/* === NEW Mandala/Floral SVG Background === */

/* === FINAL HERO BACKGROUND STYLE (User's Choice) === */

.hero-background {
    background-image: linear-gradient(-225deg, #69EACB 0%, #EACCF8 48%, #6654F1 100%);

    /* Positioning styles to make it work as a background layer */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.9; /* A little bit of opacity looks nice */
}

/* === Header Search Bar (Detail Page) === */
.header-search-container {
    width: 220px;
}

#header-search-input {
    width: 100%;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-sizing: border-box;
    font-family: var(--font-family);
    
    /* Using the same gradient */
    background: #7F00FF;
    background: -webkit-linear-gradient(to right, #E100FF, #7F00FF);
    background: linear-gradient(to right, #E100FF, #7F00FF);

    color: #FFFFFF;
}

#header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

#header-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* === Live Search Results Styles === */
.hero-search-container, .header-search-container {
    position: relative; /* Needed for positioning the results */
}

.search-results-container {
    position: absolute;
    top: 110%; /* Position it right below the search input */
    left: 0;
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    border-radius: var(--border-radius);
    z-index: 1001;
    display: none; /* Hidden by default */
}

/* Applying the glass effect to the results dropdown */
.search-results-container.glass-effect {
    background: rgba(255, 255, 255, 0.85);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--c-content);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-result-item img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 10px;
    margin-right: 10px;
}

.search-result-item span {
    font-size: 1rem;
    font-weight: bold;
}

/* === Bio Section on Detail Page === */
.bio-section {
    margin-top: 40px;
    padding: 25px;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--c-shadow);
}

.bio-section h2 {
    font-size: 1.5rem;
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.bio-section p {
    line-height: 1.8;
    color: #333;
}

/* === Styles for Background Image Protection (Final Corrected Version) === */

/* For homepage cards (This remains the same and is correct) */
.card-image-container.protected-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 1 / 1;
}

/* For detail page hero - Styles for the new nested structure */

/* 1. The Outer Frame (The Glass) */
.image-frame {
    width: 100%;
    max-width: 450px;
    padding: 15px; /* This padding creates the visible glass border */
    border-radius: 25px; 
    box-sizing: border-box;
    /* The glass-effect class gives it the background and blur */
}

/* 2. The Inner Image Div */
.image-frame .protected-image {
    width: 100%;
    height: 100%;
    
    /* This forces the inner div to be a perfect square */
    aspect-ratio: 1 / 1;

    /* Image display properties */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Rounded corners for the image itself */
    border-radius: 15px; 
}

/* === Redirect Modal Styles === */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}
.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 30px;
    color: #666;
    line-height: 1.7;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-button {
    padding: 10px 30px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

.modal-button.confirm {
    background-color: #007aff;
    color: white;
}

.modal-button.cancel {
    background-color: #e5e5e5;
    color: #333;
}

/* === New "Call to Action" Button Style === */

.cta-section {
    text-align: center;
    margin-top: 40px;
}

.insta-link-v2 {
    display: inline-block;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    
    /* A beautiful gradient */
    background: linear-gradient(45deg, #8a2be2, #4a00e0);
    
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.insta-link-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.4s ease;
}

.insta-link-v2:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.insta-link-v2:hover::before {
    left: 100%;
}

/* === Styles for Static Content Pages === */
.page-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.page-content h1, .page-content h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.page-content p {
    line-height: 1.9;
    color: #333;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* === Ad Slot Styles === */
.ad-slot-card {
    background-color: #f0f2f5;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px; 
    border: 2px dashed #dce1e7;
    grid-column: 1 / -1; /* Make it span full width if grid has more than 1 column */
}

.ad-slot-container {
    margin: 40px 0;
    padding: 20px;
    background-color: #f0f2f5;
    border-radius: var(--border-radius);
    border: 2px dashed #dce1e7;
}

.ad-slot-placeholder {
    color: #abb5c2;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
}
/* === Interstitial Ad in Modal === */
.modal-ad-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px; /* Adjust as needed for ad size */
    width: 100%;
    background-color: #f0f2f5;
    border: 2px dashed #dce1e7;
    border-radius: 12px;
    color: #abb5c2;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    position: relative; /* For timer positioning */
}

#modal-timer {
    position: absolute;
    bottom: 15px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.9rem;
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}

/* === Language Switcher === */
.language-switcher {
    position: relative;
    display: inline-block;
}
.language-switcher .current-lang {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: var(--c-content);
    padding: 10px;
}
.language-switcher .lang-dropdown {
    display: none;
    position: absolute;
    background-color: #f1f1f1;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
}
.language-switcher:hover .lang-dropdown {
    display: block;
}
.lang-dropdown a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}
.lang-dropdown a:hover {
    background-color: #ddd;
}

/* === Language Select Modal === */
.language-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.language-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.language-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
}
.language-modal-overlay.visible .language-modal-content {
    transform: scale(1);
}
.language-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    background: none;
    border: none;
}
.language-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
}
.language-modal-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
}
.language-modal-content ul li a {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}
.language-modal-content ul li a:hover {
    background-color: #f0f0f0;
}
.language-modal-content ul li a.active {
    background-color: #007aff;
    color: white;
    font-weight: bold;
}
.mobile-lang-button {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.mobile-lang-button svg {
    stroke: var(--c-content);
}
/* === Instagram Embed Section === */
.instagram-embed-section {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}
.instagram-media {
    margin: 1px auto !important; /* Overrides Instagram's default margin */
}
/* === Related Celebrities Section === */
.related-celebrities-section {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #e5e5e5;
}

.related-celebrities-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
}

/* Make the grid 4 columns on desktop */
.related-celebrities-section .celebrity-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Override for mobile to be 3 columns */
@media (max-width: 768px) {
    .related-celebrities-section .celebrity-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* === Loading Indicator Spinner === */
#loading-indicator {
    text-align: center;
    padding: 20px;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #007aff;
    display: inline-block;

    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}