/* ============================================
   Advertisement System Styles
   ============================================ */

/* --- Slider/Banner Ads --- */
.ad-ticker { display:flex; align-items:center; gap:12px; box-sizing:border-box; direction:ltr; background:linear-gradient(135deg,#d0530b,#f26714); color:#fff; overflow:hidden; padding:8px 16px; width:calc(100% - 32px); max-width:1500px; min-height:60px; margin:24px auto; border:1px solid #ffffff22; border-radius:20px; box-shadow:0 16px 40px #d0530b22; }
.ad-ticker-icon { flex:0 0 42px; width:42px; height:42px; display:grid; place-items:center; border-radius:14px; background:#ffffff24; font-size:16px; }
.ad-ticker-viewport { flex:1; min-width:0; overflow:hidden; }
.ad-ticker-track { display:flex; width:max-content; direction:ltr; will-change:transform; }
.ad-ticker.is-ready .ad-ticker-track { animation:ad-ticker-scroll var(--ad-ticker-duration,14s) linear infinite; }
.ad-ticker-group { display:flex; align-items:center; flex-shrink:0; gap:16px; padding-right:16px; }
.ad-ticker-item { display:flex; align-items:center; flex:0 0 auto; gap:8px; white-space:nowrap; font-size:13px; font-weight:800; line-height:1.5; min-height:38px; text-decoration:none; color:inherit; border-radius:6px; }
.ad-ticker-badge { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; min-width:48px; height:26px; border-radius:999px; background:#fff; color:#d0530b; font-size:11px; font-weight:900; padding:0 10px; }
.ad-ticker-item img { object-fit:contain; border-radius:4px; }
.ad-ticker-cta { border:1px solid #ffffff55; border-radius:20px; padding:2px 12px; }
.ad-ticker:focus-within .ad-ticker-track { animation-play-state:paused; }
@media(hover:hover) and (pointer:fine) { .ad-ticker:hover .ad-ticker-track { animation-play-state:paused; } }
@keyframes ad-ticker-scroll { from { transform:translateX(0); } to { transform:translateX(-50%); } }
@media(prefers-reduced-motion:reduce) {
    .ad-ticker-viewport { overflow-x:auto; }
    .ad-ticker.is-ready .ad-ticker-track { animation:none; }
    .ad-ticker-group[aria-hidden="true"] { display:none; }
    .ad-ticker-group [data-ticker-repeat] { display:none; }
}
@media(max-width:767px) { .ad-ticker { width:calc(100% - 24px); margin:16px auto; padding:8px 10px; gap:10px; border-radius:16px; min-height:54px; } .ad-ticker-icon { flex-basis:36px; width:36px; height:36px; } }

.ad-banner-section, .ad-slider-section {
    padding: 2rem 0;
}
.ad-position-above_hero {
    padding: 1rem 0 0;
    position: relative;
    z-index: 5;
}
.ad-banner-container, .ad-slider-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* SLIDER WRAPPER - Critical for hiding overflow */
.ad-slider-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* SLIDER TRACK - Flex row, no wrapping */
.ad-slider-track {
    display: flex;
    flex-wrap: nowrap;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* EACH SLIDE - Must be exactly 100% width, no shrink */
.ad-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

.ad-slide-link, .ad-banner-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border-radius: 16px;
}

/* Image styles with alignment support */
.ad-slide-img, .ad-banner-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Image alignment classes */
.ad-slide-img.align-top, .ad-banner-img.align-top { object-position: center top; }
.ad-slide-img.align-center, .ad-banner-img.align-center { object-position: center center; }
.ad-slide-img.align-bottom, .ad-banner-img.align-bottom { object-position: center bottom; }
.ad-slide-img.align-left, .ad-banner-img.align-left { object-position: left center; }
.ad-slide-img.align-right, .ad-banner-img.align-right { object-position: right center; }

/* Image fit modes */
.ad-slide-img.fit-cover, .ad-banner-img.fit-cover { object-fit: cover; }
.ad-slide-img.fit-contain, .ad-banner-img.fit-contain { object-fit: contain; background: #f8f9fa; }
.ad-slide-img.fit-fill, .ad-banner-img.fit-fill { object-fit: fill; }

.ad-slide-overlay, .ad-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
    padding: 3rem 2rem 1.5rem;
}
.ad-slide-content, .ad-banner-content {
    color: white;
    max-width: 550px;
}
.ad-slide-title, .ad-banner-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}
.ad-slide-desc, .ad-banner-desc {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0.8rem;
}
.ad-slide-btn, .ad-banner-btn {
    display: inline-block;
    background: #F59E0B;
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.ad-slide-btn:hover, .ad-banner-btn:hover {
    background: #D97706;
    transform: translateY(-2px);
}

/* Slider Arrows */
.ad-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    z-index: 10;
}
.ad-slider-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}
.ad-slider-prev { left: 12px; }
.ad-slider-next { right: 12px; }
[dir="rtl"] .ad-slider-prev { right: 12px; left: auto; }
[dir="rtl"] .ad-slider-next { left: 12px; right: auto; }

/* Slider Dots */
.ad-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}
.ad-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}
.ad-dot.active {
    background: white;
    transform: scale(1.3);
}

/* --- Top Bar Ad --- */
.ad-topbar {
    position: relative;
    text-align: center;
    font-size: 0.9rem;
    z-index: 100;
}
.ad-topbar-btn {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: inherit;
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}
.ad-topbar-btn:hover {
    background: rgba(255,255,255,0.3);
    color: inherit;
}
.ad-topbar-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1rem;
}
.ad-topbar-close:hover { opacity: 1; }
[dir="rtl"] .ad-topbar-close { right: auto; left: 1rem; }

/* --- Popup Ads --- */
.ad-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.ad-popup-container {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}
.ad-popup-center {
    max-width: 500px;
    width: 90%;
}
.ad-popup-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 90%;
    animation: slideUp 0.4s ease;
}
.ad-popup-size-small { max-width: 380px; }
.ad-popup-size-medium { max-width: 500px; }
.ad-popup-size-large { max-width: 600px; }
.ad-popup-size-full { max-width: 90vw; }

.ad-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}
.ad-popup-close:hover { background: rgba(0,0,0,0.8); transform: scale(1.1); }
[dir="rtl"] .ad-popup-close { right: auto; left: 12px; }

.ad-popup-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ad-popup-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}
.ad-popup-body {
    padding: 1.5rem;
    text-align: center;
}
.ad-popup-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}
.ad-popup-desc {
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.6;
}
.ad-popup-btn {
    display: inline-block;
    background: linear-gradient(135deg, #041d38, #0459c4);
    color: white;
    padding: 0.7rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.ad-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(4, 29, 56,0.3);
}

/* --- Dashboard Ads --- */
.ad-dashboard-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}
.ad-dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.ad-dashboard-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ad-dashboard-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.ad-size-small .ad-dashboard-img { height: 100px; }
.ad-size-medium .ad-dashboard-img { height: 140px; }
.ad-size-full .ad-dashboard-img { height: 200px; }

.ad-dashboard-body {
    padding: 1rem 1.25rem;
    background: white;
}
.ad-dashboard-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #1a1a2e;
}
.ad-dashboard-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}
.ad-dashboard-btn {
    font-size: 0.85rem;
    color: #0459c4;
    font-weight: 600;
}

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { opacity: 0; transform: translateX(-50%) translateY(30px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* --- Responsive --- */
@media (max-width: 768px) {
    .ad-slide-img, .ad-banner-img { height: 220px; }
    .ad-slide-title, .ad-banner-title { font-size: 1.2rem; }
    .ad-slider-arrow { width: 32px; height: 32px; font-size: 0.9rem; }
    .ad-popup-container { width: 95%; }
    .ad-popup-title { font-size: 1.2rem; }
}
