/* =========================================================================
   AMP Popup Reklam & Bahis Banner Builder - Ultra Modern Ortak Stiller (v2.0)
   - %100 AMP ve Normal Tema Uyumlu
   - Cyber Dark / Luxury iGaming & Casino Tasarımı
   - 2 Reklam Slotu (Çift Reklam), Yıldızlar, Bonus Rozetleri, CTA Butonları
   ========================================================================= */

.apr-overlay,
.apr-amp-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 8, 15, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Normal sayfada JS açana kadar gizli */
.apr-overlay {
    display: none;
}
.apr-overlay.apr-acik {
    display: flex;
}

/* AMP erken kapatma */
.apr-amp-overlay.apr-closed {
    display: none;
}

/* --- Ana Popup Kutusu (Box) --- */
.apr-box {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    background: linear-gradient(180deg, #131722 0%, #0c0f17 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.15);
    animation: apr-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    color: #f1f5f9;
    box-sizing: border-box;
}

@keyframes apr-in {
    from { transform: translateY(25px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Kaydırılabilir İçerik Alanı (Küçük ekranlarda taşmayı önler) */
.apr-scroll-container {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 40px);
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.apr-scroll-container::-webkit-scrollbar {
    width: 4px;
}
.apr-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.apr-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* --- Üst Başlık Çubuğu (Header Bar) --- */
.apr-header-bar {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 18px;
    background: linear-gradient(90deg, #b45309, #d97706, #ef4444);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.apr-header-icon {
    font-size: 14px;
}
.apr-header-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 60px; /* Kapatma butonuna pay bırak */
}

/* --- Modern Kapsül Kapatma & Geri Sayım Butonu --- */
.apr-close {
    position: absolute;
    top: 8px;
    right: 12px;
    min-width: 48px;
    height: 28px;
    padding: 0 10px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
}
.apr-close:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 1);
    transform: scale(1.05);
}
.apr-close-timer-icon {
    font-size: 11px;
    opacity: 0.9;
}
.apr-count {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

/* AMP Kapatma & Geri Sayım Katmanları */
.apr-cd-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    opacity: 1;
    visibility: visible;
}
.apr-cd-x {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    color: #ffffff;
    width: 100%;
    height: 100%;
}
.apr-amp-sec {
    font-size: 11px;
    font-weight: 800;
}
.apr-close amp-date-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* --- Reklam Kartları Sarmalayıcısı --- */
.apr-cards-wrapper {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Tekil Bahis & Reklam Kartı (.apr-card) --- */
.apr-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 12px 14px;
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.apr-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

/* Kart 2 (İkinci Reklam Slotu) Hafif Farklı Ton */
.apr-card-slot2 {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(59, 130, 246, 0.2);
}
.apr-card-slot2:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

/* Kart Üst Başlık & Rozet Satırı */
.apr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.apr-card-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.apr-card-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

/* Yıldız Değerlendirme (Rating) */
.apr-stars-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 7px;
    border-radius: 6px;
}
.apr-stars {
    color: #fbbf24;
    font-size: 11px;
    letter-spacing: 1px;
}
.apr-score {
    color: #fef08a;
    font-size: 11px;
    font-weight: 800;
}

/* Rozet (Badge) */
.apr-badge {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    white-space: nowrap;
}

.apr-card-slot2 .apr-badge {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

/* Kart Görsel Alanı */
.apr-card-media {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.apr-img,
.apr-card amp-img,
.apr-card img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}
.apr-card a:hover .apr-img,
.apr-card a:hover img {
    transform: scale(1.02);
}

/* Bonus Kutusu */
.apr-bonus-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.apr-bonus-icon {
    font-size: 15px;
}
.apr-bonus-text {
    font-size: 13px;
    font-weight: 800;
    color: #34d399;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

/* Özellikler & Maddeler (Chips / Tags) */
.apr-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.apr-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    line-height: 1.3;
}

/* CTA Butonları */
.apr-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 11px 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.apr-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.6);
    color: #ffffff;
}
.apr-card-slot2 .apr-cta-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}
.apr-card-slot2 .apr-cta-btn:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}
.apr-btn-arrow {
    font-size: 13px;
    transition: transform 0.2s ease;
}
.apr-cta-btn:hover .apr-btn-arrow {
    transform: translateX(4px);
}

/* İki Kart Arasındaki Şık Ayırıcı */
.apr-card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin: 2px 0;
}

/* --- Geri Sayım İlerleme Çubuğu (Bottom Bar) --- */
.apr-bar {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
    flex-shrink: 0;
}
.apr-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    transform-origin: left center;
    -webkit-transform-origin: left center;
    transform: scaleX(1);
    -webkit-transform: scaleX(1);
}
.apr-amp-bar {
    transform: scaleX(1);
    -webkit-transform: scaleX(1);
}

/* --- Mobil Uyumluluk & Küçük Telefonlar İçin Akıllı Ölçekleme --- */
@media (max-width: 600px) {
    .apr-overlay,
    .apr-amp-overlay {
        padding: 8px;
    }
    .apr-box {
        max-width: 100%;
        max-height: 94vh;
        border-radius: 18px;
    }
    .apr-scroll-container {
        max-height: calc(94vh - 38px);
    }
    .apr-cards-wrapper {
        padding: 8px;
        gap: 8px;
    }
    .apr-card {
        padding: 9px 11px;
        border-radius: 14px;
    }
    .apr-card-title {
        font-size: 13px;
    }
    .apr-stars-wrap {
        padding: 1px 5px;
    }
    .apr-stars {
        font-size: 10px;
    }
    .apr-score {
        font-size: 10px;
    }
    .apr-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    .apr-bonus-box {
        padding: 6px 9px;
        margin-bottom: 8px;
        gap: 6px;
    }
    .apr-bonus-icon {
        font-size: 13px;
    }
    .apr-bonus-text {
        font-size: 11px;
    }
    .apr-tags-list {
        gap: 4px;
        margin-bottom: 8px;
    }
    .apr-tag {
        font-size: 10px;
        padding: 2px 6px;
    }
    .apr-cta-btn {
        padding: 9px 12px;
        font-size: 12px;
        border-radius: 10px;
    }

    /* 720x350 vb. Afişler İçin Görsel Yerleşim Modları */
    .apr-imgmode-kompakt .apr-card-media {
        max-height: 115px;
        overflow: hidden;
    }
    .apr-imgmode-kompakt .apr-img,
    .apr-imgmode-kompakt .apr-card amp-img,
    .apr-imgmode-kompakt .apr-card img,
    .apr-imgmode-kompakt .apr-card-media amp-img img {
        height: 115px;
        object-fit: cover;
    }

    .apr-imgmode-mini .apr-card-media {
        max-height: 80px;
        overflow: hidden;
    }
    .apr-imgmode-mini .apr-img,
    .apr-imgmode-mini .apr-card amp-img,
    .apr-imgmode-mini .apr-card img,
    .apr-imgmode-mini .apr-card-media amp-img img {
        height: 80px;
        object-fit: cover;
    }
}

/* Kısa Ekranlı Telefonlar (iPhone SE vb. max-height 680px) */
@media (max-height: 680px) and (max-width: 600px) {
    .apr-header-bar {
        padding: 8px 12px;
        font-size: 11px;
    }
    .apr-close {
        top: 6px;
        right: 8px;
        height: 24px;
        min-width: 42px;
        font-size: 10px;
    }
    .apr-card-header {
        margin-bottom: 6px;
    }
    .apr-card-media {
        margin-bottom: 6px;
    }
    .apr-imgmode-oran .apr-card-media {
        max-height: 120px;
        overflow: hidden;
    }
    .apr-imgmode-oran .apr-img,
    .apr-imgmode-oran .apr-card amp-img,
    .apr-imgmode-oran .apr-card img {
        object-fit: cover;
    }
}

/* =========================================================================
   KENAR EFEKTLERİ (glow / rotate / shimmer) - %100 AMP Onaylı
   ========================================================================= */
.apr-fx {
    position: relative;
}
.apr-fx .apr-content-inner {
    position: relative;
    z-index: 1;
}

/* Glow */
.apr-fx-glow .apr-fx-layer {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: 0;
    border-radius: 20px;
    box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.6), 0 0 35px 8px rgba(239, 68, 68, 0.35);
    opacity: 0.6;
    animation: aprFxGlow 1.4s ease-in-out infinite alternate;
    -webkit-animation: aprFxGlow 1.4s ease-in-out infinite alternate;
}
@keyframes aprFxGlow {
    from { opacity: 0.4; transform: scale(0.995); }
    to   { opacity: 1;   transform: scale(1.01); }
}

/* Rotate */
.apr-fx-rotate {
    padding: 2px;
    overflow: hidden;
}
.apr-fx-rotate .apr-fx-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    height: 250%;
    z-index: 0;
    background: conic-gradient(from 0deg, #f59e0b, #ef4444, #3b82f6, #10b981, #f59e0b);
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    animation: aprFxRotate 4s linear infinite;
    -webkit-animation: aprFxRotate 4s linear infinite;
}
@keyframes aprFxRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Shimmer */
.apr-fx-shimmer {
    overflow: hidden;
}
.apr-fx-shimmer .apr-fx-layer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 60%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transform: translateX(0);
    -webkit-transform: translateX(0);
    animation: aprFxShimmer 3s ease-in-out infinite;
    -webkit-animation: aprFxShimmer 3s ease-in-out infinite;
}
@keyframes aprFxShimmer {
    0%   { transform: translateX(0); }
    35%  { transform: translateX(300%); }
    100% { transform: translateX(300%); }
}

@media (prefers-reduced-motion: reduce) {
    .apr-fx-rotate .apr-fx-layer,
    .apr-fx-glow .apr-fx-layer,
    .apr-fx-shimmer .apr-fx-layer {
        animation: none;
    }
}
