/* ---------- Sticky button (bottom-left) ---------- */
.flashnews-toggle {
    position: fixed;
    left: 12px;
    bottom: 12px;
    background: #d32f2f;
    color: #fff;
    padding: 8px 14px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9998;
    transition: all .3s ease;
    min-width: 120px;
    justify-content: center;
}
.flashnews-toggle:hover,
.flashnews-toggle:active {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.flashnews-icon {
    font-size: 1.5em;
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0%,100% { opacity:1; }
    50% { opacity:.5; }
}

/* ---------- Popup (ABOVE BUTTON – RESPONSIVE) ---------- */
.flashnews-popup {
    position: fixed;
    left: 12px;
    bottom: 80px;                    /* above button */
    width: calc(100vw - 24px);       /* full width minus margins */
    max-width: 225px;
    max-height: 60vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,.5);
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.85);
    transition: all .5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border: 4px solid transparent;
}
.flashnews-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    border-color: #fff;
    animation: glow 1.6s ease-in-out infinite alternate;
}
@keyframes glow {
    from { box-shadow: 0 0 20px #000, 0 0 40px #000; }
    to   { box-shadow: 0 0 35px #000, 0 0 70px #000; }
}

/* Header */
.flashnews-header {
    background: linear-gradient(135deg, #fab21d, #fff);
    color: #000;
    padding: 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0;
}
.flashnews-close {
    background: none;
    border: none;
    color: #000;
    font-size: 2em;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: transform .2s;
}
.flashnews-close:hover,
.flashnews-close:active { 
    transform: rotate(90deg); 
}

/* Content */
.flashnews-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    background: #fdfdfd;
    font-size: 0.95em;
    line-height: 1.6;
}

/* ---------- Lightning flash ---------- */
#flashnews-lightning {
    position: fixed;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
}
#flashnews-lightning.flash {
    animation: lightning 1.5s steps(6) forwards;
}
@keyframes lightning {
    0%   { background:#fff; opacity:.95; }
    15%  { background:#fff; opacity:.75; }
    30%  { background:transparent; opacity:0; }
    45%  { background:#fff; opacity:.85; }
    60%  { background:transparent; opacity:0; }
    75%  { background:#fff; opacity:.7; }
    100% { background:transparent; opacity:0; }
}

/* Icon shake */
.flashnews-icon.shake {
    animation: shake .8s ease-in-out;
}
@keyframes shake {
    0%,100% { transform: translateX(0) rotate(0); }
    15% { transform: translateX(-7px) rotate(-6deg); }
    30% { transform: translateX(7px) rotate(6deg); }
    45% { transform: translateX(-5px) rotate(-4deg); }
    60% { transform: translateX(5px) rotate(4deg); }
    75% { transform: translateX(-3px) rotate(-2deg); }
    90% { transform: translateX(3px) rotate(2deg); }
}

/* ---------- MOBILE OPTIMIZATIONS ---------- */
@media (max-width: 480px) {
    .flashnews-toggle {
        left: 8px;
        bottom: 8px;
        padding: 7px 12px;
        font-size: 13px;
        gap: 6px;
    }
    .flashnews-icon {
        font-size: 1.3em;
    }
    .flashnews-popup {
        left: 8px;
        bottom: 70px;
        width: calc(100vw - 16px);
        max-width: none;
        border-radius: 14px;
    }
    .flashnews-header {
        padding: 10px 14px;
        font-size: 1em;
    }
    .flashnews-close {
        font-size: 1.8em;
        padding: 10px;
    }
    .flashnews-content {
        padding: 14px;
        font-size: 0.9em;
    }
}