/* ============================================
   ACTIVITY.CSS - Styles du feed d'activité
   ============================================ */

/* ============================================
   LIGNE PROMO ÉVÉNEMENT (au-dessus du feed)
   ============================================ */
.event-promo-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(247, 147, 26, 0.4);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-promo-line:hover {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.25), rgba(139, 92, 246, 0.25));
    border-color: rgba(247, 147, 26, 0.6);
    transform: translateY(-1px);
}

.event-promo-line:active {
    transform: scale(0.99);
}

.event-promo-icon {
    font-size: 18px;
}

.event-promo-text {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.event-promo-cta {
    color: #f7931a;
    font-size: 14px;
    font-weight: 700;
}

/* ============================================
   TICKER (barre dans l'onglet Jeu)
   ============================================ */
.feed-ticker-container {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.feed-ticker-container:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
}

.feed-ticker-container:active {
    transform: scale(0.99);
}

.feed-ticker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.feed-ticker-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-ticker-live {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--success-color);
}

.feed-ticker-live .live-dot {
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    animation: feedPulse 2s infinite;
}

@keyframes feedPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.feed-ticker-content {
    padding: 10px 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.feed-ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.feed-ticker-item.fade-out {
    opacity: 0;
}

.feed-ticker-item.fade-in {
    opacity: 1;
}

.feed-event-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.feed-event-text {
    font-size: 13px;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-event-text strong {
    color: var(--primary-color);
}

.feed-highlight {
    color: var(--secondary-color);
    font-weight: 600;
}

/* ============================================
   MODAL (slide-up depuis le bas)
   ============================================ */
.feed-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 10000;
}

.feed-modal-overlay.open {
    display: flex;
}

.feed-modal {
    background: var(--background-card);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: feedSlideUp 0.3s ease;
}

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

.feed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--background-card);
    flex-shrink: 0;
    gap: 16px;
}

.feed-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex: 1;
}

.feed-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
    line-height: 1;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-modal-close:hover {
    color: var(--text-color);
}

.feed-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    max-height: calc(80vh - 70px);
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   LISTE DES EVENTS
   ============================================ */

/* Message épinglé */
.feed-pinned-message {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(247, 147, 26, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.feed-pinned-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.feed-pinned-content {
    flex: 1;
}

.feed-pinned-text {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.4;
}

.feed-pinned-text strong {
    color: var(--primary-color);
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.feed-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Couleurs par type d'event */
.feed-item-icon.badge {
    background: rgba(247, 147, 26, 0.2);
}

.feed-item-icon.level {
    background: rgba(0, 212, 255, 0.2);
}

.feed-item-icon.streak {
    background: rgba(239, 68, 68, 0.2);
}

.feed-item-icon.win {
    background: rgba(16, 185, 129, 0.2);
}

.feed-item-icon.newuser {
    background: rgba(0, 212, 255, 0.2);
}

.feed-item-icon.challenge {
    background: rgba(0, 212, 255, 0.2);
}

.feed-item-icon.soullink {
    background: rgba(139, 92, 246, 0.2);
}

.feed-item-icon.ghost {
    background: rgba(247, 147, 26, 0.2);
}

.feed-item-content {
    flex: 1;
    min-width: 0;
}

.feed-item-text {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
}

.feed-item-text strong {
    color: var(--primary-color);
}

.feed-item-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   ÉTAT VIDE
   ============================================ */
.feed-empty {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--text-secondary);
}

.feed-empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.feed-empty p {
    margin: 0;
    font-size: 14px;
}

.feed-empty-hint {
    font-size: 12px !important;
    margin-top: 8px !important;
    opacity: 0.7;
}

/* ============================================
   BOUTON REFRESH
   ============================================ */
.feed-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    margin-top: var(--spacing-md);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.feed-refresh-btn:hover:not(:disabled) {
    background: rgba(0, 212, 255, 0.2);
}

.feed-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .feed-ticker-header {
        padding: 6px 10px;
    }
    
    .feed-ticker-content {
        padding: 8px 10px;
        min-height: 36px;
    }
    
    .feed-event-text {
        font-size: 12px;
    }
    
    .feed-modal-header {
        padding: var(--spacing-sm);
    }
    
    .feed-modal-content {
        padding: var(--spacing-sm);
    }
    
    .feed-item {
        padding: 10px;
        gap: 10px;
    }
    
    .feed-item-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .feed-item-text {
        font-size: 13px;
    }
}

/* Safe area pour iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .feed-modal-content {
        padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
    }
}
