/**
 * FreeGiftZone Ad Integration Styles
 * Styles for banner and interstitial (rewarded) ads
 */

/* ==========================================================================
   Interstitial Ad Overlay (Full-Screen)
   ========================================================================== */

.fgz-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000 !important;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fgz-ad-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: #000;
}

.fgz-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.fgz-ad-close {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fgz-ad-close:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fgz-ad-close:not(:disabled):hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.fgz-interstitial-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.fgz-interstitial-slot iframe,
.fgz-interstitial-slot>div {
    max-width: 100%;
    max-height: 100%;
}

/* ==========================================================================
   Banner Ad Containers
   ========================================================================== */

.ad-banner-container {
    text-align: center;
    width: 100%;
}

.ad-slot {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 90px;
    background: hsl(var(--muted)/0.3);
    border-radius: var(--radius);
}

/* Hide empty ad slots (ad blocker detection) */
.ad-slot:empty,
.ad-slot.fgz-ad-empty {
    display: none !important;
}

.ad-banner-container:has(.ad-slot:empty),
.ad-banner-container:has(.fgz-ad-empty) {
    display: none !important;
}

.ad-slot iframe,
.ad-slot>div {
    max-width: 100%;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
    .ad-slot {
        min-height: 50px;
    }
}

/* ==========================================================================
   Blog Reading Reward Toast Notification
   ========================================================================== */

.fgz-reward-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, hsl(142 76% 36%) 0%, hsl(142 71% 45%) 100%);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 99998;
    opacity: 0;
    transform: translateY(1rem) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
}

.fgz-reward-toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.fgz-reward-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.fgz-reward-toast-content {
    flex: 1;
    min-width: 0;
}

.fgz-reward-toast-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.fgz-reward-toast-message {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin-top: 0.125rem;
}

.fgz-reward-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.fgz-reward-toast-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .fgz-reward-toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
        bottom: 1rem;
    }
}

/* ==========================================================================
   Blog Reading Tracker Overlay (Compact)
   ========================================================================== */

.fgz-rt {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 200px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    z-index: 99990;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
    color: #e2e8f0;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.fgz-rt.fgz-rt-show {
    opacity: 1;
    transform: translateY(0);
}

/* Top bar with title + minimize */
.fgz-rt-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.fgz-rt-lbl {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #a5b4fc;
}

.fgz-rt-tog {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 4px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background 0.15s ease;
}

.fgz-rt-tog:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Collapsible body */
.fgz-rt-body {
    padding: 0.5rem 0.625rem 0.625rem;
}

/* Stats row */
.fgz-rt-row {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.fgz-rt-c {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 0.375rem;
    padding: 0.25rem;
}

.fgz-rt-sl {
    font-size: 0.5625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.fgz-rt-sv {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Phase rows */
.fgz-rt-ph {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.375rem;
    border-radius: 0.375rem;
    background: rgba(30, 41, 59, 0.4);
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

/* Phase indicator dot (CSS-only, no emoji) */
.fgz-rt-pi {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #475569;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.fgz-rt-pl {
    flex: 1;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
}

.fgz-rt-pt {
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #475569;
}

/* Phase states */
.fgz-rt-act {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
}

.fgz-rt-act .fgz-rt-pi {
    background: #818cf8;
}

.fgz-rt-act .fgz-rt-pl {
    color: #c7d2fe;
}

.fgz-rt-act .fgz-rt-pt {
    color: #a5b4fc;
}

.fgz-rt-warn {
    background: rgba(234, 179, 8, 0.06);
    border-color: rgba(234, 179, 8, 0.15);
}

.fgz-rt-warn .fgz-rt-pi {
    background: #eab308;
}

.fgz-rt-warn .fgz-rt-pl {
    color: #fde68a;
}

.fgz-rt-warn .fgz-rt-pt {
    color: #fbbf24;
}

.fgz-rt-done {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.15);
}

.fgz-rt-done .fgz-rt-pi {
    background: #22c55e;
}

.fgz-rt-done .fgz-rt-pl {
    color: #86efac;
}

.fgz-rt-done .fgz-rt-pt {
    color: #4ade80;
}

.fgz-rt-lock {
    opacity: 0.4;
}

/* Status message */
.fgz-rt-msg {
    font-size: 0.625rem;
    font-weight: 500;
    text-align: center;
    padding: 0.25rem;
    border-radius: 0.25rem;
    background: rgba(30, 41, 59, 0.4);
    color: #64748b;
    margin-top: 0.125rem;
}

.fgz-rt-msg-go {
    background: rgba(99, 102, 241, 0.08);
    color: #a5b4fc;
}

.fgz-rt-msg-warn {
    background: rgba(234, 179, 8, 0.08);
    color: #fbbf24;
}

.fgz-rt-msg-ok {
    background: rgba(34, 197, 94, 0.08);
    color: #4ade80;
}

/* Mobile: compact bottom strip */
@media (max-width: 640px) {
    .fgz-rt {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        width: auto;
    }

    .fgz-rt-row {
        gap: 0.5rem;
    }
}