/* ==========================================
   LIVE FEED BOTTOM PANEL
   ========================================== */

.live-feed-panel {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 400px;
    height: 400px; /* Default open height */
    min-height: 50px; /* Minimized height */
    max-height: 95vh;
    background: white;
    border: 1px solid #e8eaed;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(calc(100% - 50px)); /* Start minimized */
    transition: transform 0.3s ease, height 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    resize: vertical; /* Allow vertical resizing */
    overflow: hidden;
}

.live-feed-panel.open {
    transform: translateY(0);
}

.live-feed-panel.minimized {
    transform: translateY(calc(100% - 50px));
}

.live-feed-panel.closed {
    display: none; /* Completely hide when closed */
}

.feed-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.feed-resize-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.feed-resize-handle:hover::before {
    background: rgba(0, 0, 0, 0.2);
}

.live-feed-header {
    padding: 12px 16px;
    background: #1a73e8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    user-select: none;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.live-feed-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.live-feed-badge {
    background: #d32f2f;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.live-feed-controls {
    display: flex;
    gap: 8px;
}

.feed-control-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.feed-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.live-feed-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.feed-item {
    background: white;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.feed-item:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}

.feed-item.critical {
    border-left: 4px solid #d32f2f;
}

.feed-item.warning {
    border-left: 4px solid #f9ab00;
}

.feed-item.info {
    border-left: 4px solid #1a73e8;
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.feed-item-time {
    font-size: 11px;
    color: #5f6368;
}

.feed-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    line-height: 1.3;
    margin-bottom: 6px;
}

.feed-item-description {
    font-size: 12px;
    color: #5f6368;
    line-height: 1.4;
    margin-bottom: 8px;
}

.feed-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #5f6368;
}

.feed-location-link {
    cursor: pointer;
    color: #5f6368;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.feed-location-link:hover {
    color: #1a73e8;
    text-decoration: underline;
}

.feed-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e8eaed;
}

.feed-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e8f0fe;
    border: 1px solid #d2e3fc;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    color: #1967d2;
}

.feed-tag svg {
    width: 10px;
    height: 10px;
}

.feed-item-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #e8eaed;
    margin-top: 8px;
}

.feed-action-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.2s;
}

.feed-action-btn:hover {
    background: #f1f3f4;
    color: #1a73e8;
}

.feed-action-btn.flagged {
    background: #fef7e0;
    color: #f9ab00;
}

.feed-action-btn.saved {
    background: #e8f5e9;
    color: #0f9d58;
}

.feed-action-btn.liked {
    background: #fef7e0;
    color: #f9ab00;
}

.feed-action-btn.shared {
    background: #e8f0fe;
    color: #1a73e8;
}

/* Like Animation */
@keyframes likeAnimation {
    0% { transform: scale(1); }
    25% { transform: scale(1.3) rotate(-10deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    75% { transform: scale(1.3) rotate(-10deg); }
    100% { transform: scale(1); }
}

.feed-action-btn.liked svg {
    animation: likeAnimation 0.6s ease-in-out;
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
    .live-feed-panel {
        right: 0;
        left: 0;
        width: 100%;
        height: 100%; /* Full screen on mobile */
        border-radius: 0;
        transform: translateY(100%); /* Start completely off-screen */
        transition: transform 0.3s ease;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .live-feed-panel.open {
        transform: translateY(0);
    }

    .live-feed-panel.minimized {
        /* On mobile, minimized means closed, but the button is visible */
        transform: translateY(100%);
    }

    .live-feed-panel.closed {
        display: none;
    }

    .live-feed-header {
        border-radius: 0;
    }

    /* Floating lightning icon for mobile */
    .mobile-live-feed-icon {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: #1a73e8;
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        z-index: 10000;
        transition: transform 0.2s ease, background 0.2s ease;
    }

    .mobile-live-feed-icon:hover {
        transform: scale(1.05);
        background: #1765cc;
    }

    .mobile-live-feed-icon.hidden {
        display: none;
    }
}
