/* CSS Marquee Animation */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 20px 0;
    background: transparent;
    direction: ltr !important;
    /* Force LTR */
}

/* Modal Overrides Removed */
.projects-marquee-container {
    width: 100%;
    overflow-x: auto;
    /* allow scroll if needed, but intended to handle overflow */
    overflow-y: visible;
    /* Show shadows */
    white-space: nowrap;
    position: relative;
    padding: 20px 0;
    direction: ltr !important;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.projects-marquee-container::-webkit-scrollbar {
    display: none;
}

.marquee-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: marquee-scroll 40s linear infinite;
    gap: 20px;
}

.client-logo-card {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    background: #2a2a2a;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    transition: all 0.3s ease;
    border: 0.5px solid #c9a961;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.client-logo-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    filter: grayscale(100%) brightness(150%);
    transition: 0.3s;
    opacity: 0.8 !important;
}

.client-logo-card:hover {
    border-color: #C9A961;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    background: #252525;
}

.client-logo-card:hover img {
    filter: grayscale(0%) brightness(100%) !important;
    opacity: 1 !important;
    transform: scale(1.1);
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- Ad Modal Styling with Background (Final) --- */
/* Ensure the wrapper is centered */
.ad-modal {
    display: none;
    /* Toggled by JS */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* Dark overlay behind modal */

    /* Flex Centering is KEY here */
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal Content Box - Pure CSS Background */
.ad-modal-content {
    background-color: #1a1a1a;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
    border: 1px solid #444;
    overflow: hidden;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    margin: auto;
    display: flex;
    flex-direction: column;
}

/* Dark Overlay using Pseudo-element to ensure text readability */
.ad-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Darken the background image */
    backdrop-filter: blur(5px);
    /* Optional: Blur the background */
    z-index: 1;
    /* Sit above background, below text */
}

/* Ensure ALL content sits above the overlay */
.ad-modal-body,
.ad-modal-close,
.ad-modal-actions {
    position: relative;
    z-index: 10;
}

/* Background Image Layer */
/* This section is now redundant as background is handled by .ad-modal-content */
/* .ad-modal-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.ad-modal-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px) brightness(0.3);
    transform: scale(1.1);
} */

/* Dark Gradient Overlay for readability */
/* This section is now redundant as overlay is handled by .ad-modal-content::before */
/* .ad-modal-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8));
    z-index: 1;
} */

/* Body Content (Texts, etc) */
.ad-modal-body {
    position: relative;
    z-index: 10;
    overflow-y: auto !important;
    max-height: 100%;
    /* Let it fill the content box */
    padding: 30px;
    scrollbar-width: thin;
}

.ad-modal-body-content {
    display: block !important;
    /* Single column flow */
    text-align: center;
    /* Center everything */
    padding: 20px 0;
}

/* On mobile, stack them */
@media (max-width: 768px) {
    .ad-modal-body-content {
        flex-direction: column;
    }

    .ad-modal-poster {
        width: 100%;
        max-width: 200px;
        margin: 0 auto 20px auto;
    }
}

/* Ensure text is readable and centered */
.ad-modal-details {
    position: relative;
    z-index: 10;
    width: 100%;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center !important;
    /* Center text alignment */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-modal-title {
    color: #fff !important;
    font-size: 2.5rem;
    /* Larger Title */
    margin-bottom: 20px;
    border-bottom: 3px solid #C9A961;
    padding-bottom: 15px;
    display: inline-block;
    font-weight: 700;
}

.ad-modal-description {
    color: #f5f5f5 !important;
    font-size: 1.2rem;
    line-height: 1.8;
    background: rgba(0, 0, 0, 0.5);
    /* Stronger background for readability without image */
    padding: 25px;

    max-width: 800px;
    /* Limit width for readability */
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-modal-close {
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    color: white;
    position: absolute;
    top: 15px;
    right: 15px;
    /* Or left depending on language */
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: 0.3s;
}

.ad-modal-close:hover {
    background: #C9A961;
    color: black;
}

/* The Actions Bar (Button) */
.ad-modal-actions {
    position: relative;
    z-index: 10;
    padding: 20px;

    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Clean up old Lightbox styles */
.image-lightbox {
    display: none !important;
}