/* ==========================================================================
   realtime-news.css — Realtime Live News Engine & Cron Popup
   ----------------------------------------------------------------------------
   Extrahiert aus js/realtime-news.js (vorher per JS-String injiziert → FOUC,
   nicht browser-cache-bar). Nutzt konsistent die Design-Tokens aus
   default.css / theme_3.css (--color-*, --glass-*, --radius-*, --shadow-*),
   damit das White-Labeling automatisch durchschlaegt.
   Last updated: 2026-08-04
   ========================================================================== */

/* --- Animations --------------------------------------------------------- */
@keyframes pulseDot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--color-red, #ef4444); opacity: 1; }
    70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes slideUpDrawer {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Live Pulsing Dot --------------------------------------------------- */
.live-pulsing-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-red, #ef4444);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: pulseDot 2s infinite;
}

/* --- High-Contrast Search Box (dark, fix white-on-white) ---------------- */
#news-search-input {
    background-color: var(--color-primary-mid, #1e293b) !important;
    color: var(--color-text-heading, #f8fafc) !important;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.18)) !important;
    font-size: 0.85rem !important;
}
#news-search-input::placeholder {
    color: var(--color-text-muted, #94a3b8) !important;
    opacity: 1 !important;
}
#news-search-input:focus {
    background-color: var(--color-primary, #0f172a) !important;
    color: #ffffff !important;
    border-color: var(--color-blue, #3b82f6) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.3) !important;
    outline: none !important;
}

/* --- Glassmorphic Header Action Buttons --------------------------------- */
.realtime-action-pill-push {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #fbbf24 !important;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(4px);
}
.realtime-action-pill-push:hover,
.realtime-action-pill-push:focus {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4) !important;
    outline: none !important;
}

.realtime-action-pill-audio {
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(4px);
}
.realtime-action-pill-audio:hover,
.realtime-action-pill-audio:focus {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
    outline: none !important;
}

/* --- Custom Scrollbar --------------------------------------------------- */
#news-popup-scrollbody::-webkit-scrollbar {
    width: 8px;
}
#news-popup-scrollbody::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
}
#news-popup-scrollbody::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.4);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
#news-popup-scrollbody::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.8);
}

/* --- News Item Card ----------------------------------------------------- */
.news-item-card {
    background: var(--glass-bg, rgba(30, 41, 59, 0.7));
    backdrop-filter: var(--glass-blur, blur(8px));
    border: 1px solid var(--glass-border, rgba(51, 65, 85, 0.6));
    transition: all 0.25s ease-in-out;
}
.news-item-card:hover,
.news-item-card:focus-within {
    border-color: var(--color-blue, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* --- Toast Banner ------------------------------------------------------- */
#news-toast-banner {
    position: sticky;
    top: 0;
    z-index: 1050;
    animation: fadeInDown 0.4s ease-out;
}

/* --- Trigger Button (Countdown) ---------------------------------------- */
.realtime-trigger-btn {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: var(--color-text-heading, #f8fafc) !important;
    font-size: 0.825rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.realtime-trigger-btn:hover,
.realtime-trigger-btn:focus {
    background: var(--color-red, #ef4444) !important;
    color: #ffffff !important;
    border-color: var(--color-red, #ef4444) !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-1px);
    outline: none;
}

/* --- Category Pills ----------------------------------------------------- */
.category-pill {
    background: rgba(51, 65, 85, 0.5);
    color: var(--color-text-muted, #cbd5e1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.category-pill:hover,
.category-pill:focus,
.category-pill.active {
    background: #2563eb;
    color: #ffffff;
    border-color: var(--color-blue, #3b82f6);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    outline: none;
}

.animate-pulse {
    animation: pulseGlow 1.5s infinite;
}

/* --- Mobile Slide-Up Drawer (< 768px) ---------------------------------- */
@media (max-width: 767.98px) {
    #news-popup {
        width: 100vw !important;
        height: 85vh !important;
        max-width: 100vw !important;
        max-height: 85vh !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        transform: translateY(0) !important;
        border-radius: 18px 18px 0 0 !important;
        border-bottom: none !important;
        animation: slideUpDrawer 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .mobile-drawer-handle {
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        margin: 5px auto 2px auto;
    }

    .popup-header {
        padding: 10px 14px !important;
    }

    .popup-controls {
        padding: 10px 14px !important;
        gap: 8px !important;
    }

    .popup-scrollbody {
        padding: 12px 14px !important;
    }

    .popup-footer {
        padding: 10px 14px !important;
    }

    .news-item-card {
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }

    .news-item-card h3 {
        font-size: 0.875rem !important;
        line-height: 1.35 !important;
    }

    .search-box {
        min-width: 120px !important;
        flex-grow: 1;
    }
}

/* --- Accessibility: Reduced Motion (Phase 3.3) -------------------------- */
@media (prefers-reduced-motion: reduce) {
    .live-pulsing-dot,
    .animate-pulse,
    #news-popup,
    #news-toast-banner,
    .news-item-card {
        animation: none !important;
        transition: none !important;
    }

    #news-popup {
        animation: none !important;
    }
}
