/* Live Ticker Styling */
#liveTickerContainer {
    position: fixed;
    /* Keep fixed on Desktop */
    bottom: 20px;
    left: 20px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.ticker-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    width: auto;
    max-width: 300px;

    /* Animation Desktop: Slide in from Left */
    animation: slideInLeft 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        fadeOut 0.5s ease-in forwards 4.5s;
    opacity: 0;
    transform: translateX(-20px);
}

.ticker-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.ticker-icon.check {
    background: #e0f2fe;
    color: var(--primary-color);
}

.ticker-icon.alert {
    background: #fee2e2;
    color: var(--danger-color);
}

.ticker-content strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

/* Animations */
@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {

    /* 1. STICKY INPUT (RESTORED) */
    .search-card .input-group,
    #mobile-sticky-fix {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: white;
        padding: 15px;
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
        z-index: 2147483647 !important;
        display: flex;
        gap: 10px;
        border-top: 1px solid #e2e8f0;
        margin: 0 !important;
        transform: none !important;
        box-sizing: border-box;
    }

    /* Hide sticky bar when body has class hide-sticky-input (set by JS on non-search views) */
    body.hide-sticky-input .search-card .input-group,
    body.hide-sticky-input #mobile-sticky-fix {
        display: none !important;
    }

    .search-card .input-group button {
        width: auto;
        padding: 0 20px;
        flex-shrink: 0;
        height: 50px;
        /* Specific height for bar */
        margin: 0;
    }

    /* Adjust inputs to fit better in bar */
    .search-card .input-group input {
        height: 50px;
    }

    .combined-input-wrapper {
        height: 50px !important;
    }

    /* Spacer to prevent content being hidden behind sticky bar */
    body {
        padding-bottom: 100px !important;
        /* Ensure enough space */
    }


    /* 2. REPOSITIONED TICKER: Absolute Overlay (Under Logo) */
    #liveTickerContainer {
        display: none !important;
        /* USER REQUEST: Hide on Mobile to avoid clutter */
    }

    .ticker-item {
        /* Responsive Sizing via Clamp */
        background: rgba(255, 255, 255, 0.90);
        backdrop-filter: blur(8px);

        padding: 4px 10px;
        font-size: 0.75rem;
        border-radius: 20px;

        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.6);
        color: #475569;

        display: flex;
        align-items: center;
        gap: 6px;

        /* Animation: Slide In From Left with 2s Delay */
        animation: slideInLeftMobile 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 2s,
            fadeOutMobile 0.5s ease forwards 7.0s;
        /* Start fadeout after slide (2s + 0.6s + wait) -> approx 7s total */
        opacity: 0;
        transform: translateX(-50px);
    }

    .ticker-icon {
        width: clamp(14px, 2vw, 16px);
        height: clamp(14px, 2vw, 16px);
        font-size: clamp(0.5rem, 2vw, 0.6rem);
    }

    .ticker-content strong {
        font-size: clamp(0.6rem, 2.5vw, 0.70rem);
        display: inline;
        margin-right: 4px;
        color: #334155;
    }

    .ticker-content span {
        font-size: clamp(0.55rem, 2vw, 0.65rem) !important;
        color: #94a3b8 !important;
        display: inline !important;
    }
}

@keyframes slideInLeftMobile {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutMobile {
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}