/* ═══════════════════════════════════════════
   Feed Agora — Timeline
   ═══════════════════════════════════════════ */

.tl-container { margin: 0 auto; }

/* Banner de novas atualizações (estilo Twitter) */
.tl-update-banner {
    position: sticky; top: 70px; z-index: 10;
    text-align: center; padding: 10px 20px; margin: -0.5rem 0 1rem;
    background: var(--bs-primary); color: #fff; border-radius: 10px;
    font-size: .85rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    transition: opacity 0.3s, transform 0.3s;
    animation: tl-slide-in 0.3s ease-out;
}
.tl-update-banner:hover { opacity: .9; }

/* Passado colapsável */
.tl-past-section { margin-top: 1.5rem; border-top: 1px dashed var(--bs-border-color); padding-top: 1rem; }
.tl-past-toggle {
    font-size: .78rem; color: var(--bs-secondary-color); cursor: pointer;
    display: flex; align-items: center; gap: 6px; margin-bottom: .75rem;
    background: none; border: none; padding: 0;
}
.tl-past-toggle:hover { color: var(--bs-primary); }
.tl-past-content { display: none; }
.tl-past-content.show { display: block; }

/* ── Header ── */
.tl-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; padding: 16px 24px; border-radius: 14px;
    margin-bottom: 1.25rem; display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
}
.tl-clock { font-size: 2rem; font-weight: 700; line-height: 1; }
.tl-date { font-size: .85rem; opacity: 0.9; }

/* ── Busca ── */
.tl-search { margin-bottom: 1.25rem; }

/* ── Seletor de dias ── */
.tl-days {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 0;
    margin-bottom: 1.25rem; scrollbar-width: none;
}
.tl-days::-webkit-scrollbar { display: none; }
.tl-day-btn {
    flex-shrink: 0; padding: 8px 0; border: 2px solid var(--bs-border-color);
    border-radius: 14px; background: var(--bs-body-bg); cursor: pointer;
    text-align: center; transition: all 0.2s; position: relative;
    width: 68px; color: var(--bs-body-color);
}
.tl-day-btn:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.tl-day-btn.active {
    background: var(--bs-primary); border-color: var(--bs-primary); color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.tl-day-btn .day-label {
    display: block; font-size: .6rem; text-transform: uppercase; font-weight: 600; opacity: .6;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-day-btn .day-num { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.tl-day-btn .day-dot {
    position: absolute; top: 5px; right: 5px; width: 6px; height: 6px;
    border-radius: 50%; background: var(--bs-success);
}
.tl-day-btn.active .day-label { opacity: 1; color: rgba(255,255,255,.85); }
.tl-day-btn.active .day-num { color: #fff; }
.tl-day-btn.empty { opacity: .45; }
.tl-day-btn.today:not(.active) .day-label { color: var(--bs-primary); font-weight: 700; opacity: 1; }

/* ── Botões de contexto ── */
.tl-contexts {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin-bottom: 1.5rem; padding-bottom: 2px;
}
.tl-contexts::-webkit-scrollbar { display: none; }
.tl-ctx-btn {
    padding: 8px 16px; border: 2px solid var(--bs-border-color);
    border-radius: 24px; background: var(--bs-body-bg); cursor: pointer;
    font-weight: 600; font-size: .85rem; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--bs-body-color); white-space: nowrap; flex-shrink: 0;
}
.tl-ctx-btn:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.tl-ctx-btn.active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.tl-ctx-btn .ctx-count {
    font-size: .65rem; padding: 1px 6px; border-radius: 10px;
    background: rgba(0,0,0,0.08); font-weight: 700; min-width: 18px; text-align: center;
}
.tl-ctx-btn.active .ctx-count { background: rgba(255,255,255,0.25); }

/* ── Timeline ── */
.tl-timeline { position: relative; padding-left: 72px; min-height: 200px; }

/* Linha vertical */
.tl-timeline::before {
    content: ''; position: absolute; left: 56px; top: 0; bottom: 0;
    width: 3px; background: var(--bs-border-color); border-radius: 2px;
}

/* Grupo de hora */
.tl-hour-group { position: relative; margin-bottom: 2.5rem; }

/* Label de hora */
.tl-hour-label {
    position: absolute; left: -72px; top: 0; width: 52px;
    text-align: right; font-size: .85rem; font-weight: 700;
    color: var(--bs-secondary-color); line-height: 1;
    padding-top: 2px;
}

/* Dot na linha do tempo */
.tl-hour-dot {
    position: absolute; left: -20px; top: 4px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--bs-border-color); border: 2px solid var(--bs-body-bg);
    z-index: 1;
}

/* ── NOW marker ── */
.tl-hour-group.tl-now .tl-hour-label {
    color: var(--bs-primary); font-size: .95rem;
}
.tl-hour-group.tl-now .tl-hour-dot {
    background: var(--bs-primary); width: 13px; height: 13px;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.2);
    animation: tl-pulse 2s infinite;
}
.tl-hour-group.tl-now::after {
    content: 'AGORA'; position: absolute; left: -72px; top: 20px;
    font-size: .55rem; font-weight: 800; color: var(--bs-primary);
    text-align: right; width: 52px; letter-spacing: .5px;
}

/* Horas passadas */
.tl-hour-group.tl-past .tl-hour-label { opacity: .4; }
.tl-hour-group.tl-past .tl-hour-dot { opacity: .4; }
.tl-hour-group.tl-past .tl-item { opacity: .5; }

/* ── Cards da timeline ── */
.tl-items { display: flex; flex-direction: column; gap: 14px; }

.tl-item {
    display: flex; gap: 14px; padding: 16px 18px;
    border: 1px solid var(--bs-border-color); border-radius: 14px;
    background: var(--bs-body-bg); text-decoration: none; color: inherit;
    transition: all 0.25s; position: relative; overflow: hidden;
    align-items: center;
}
.tl-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--bs-primary); color: inherit; }

/* Ao vivo / aberto agora */
.tl-item.tl-live {
    border-left: 4px solid var(--bs-primary);
    background: linear-gradient(90deg, rgba(102,126,234,.04) 0%, transparent 30%);
}

/* Promoção ativa */
.tl-item.tl-promo {
    border-left: 4px solid var(--bs-success);
    background: linear-gradient(90deg, rgba(25,135,84,.04) 0%, transparent 30%);
}

/* Empresa fechada (item acontecendo hoje mas negócio está fechado agora) */
.tl-item.tl-closed {
    opacity: .7;
    border-left: 4px solid var(--bs-secondary-color);
}
.tl-item.tl-closed .tl-item-title { color: var(--bs-secondary-color); }
.tl-item.tl-closed:hover { opacity: .95; }

/* Item futuro ("Aproveite Amanhã", outros dias) — NÃO é fechado, é programado */
.tl-item.tl-upcoming {
    border-left: 4px solid #0891b2;
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.04) 0%, transparent 30%);
}
[data-bs-theme='dark'] .tl-item.tl-upcoming {
    border-left-color: #22d3ee;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.06) 0%, transparent 30%);
}

.tl-item-logo {
    width: 44px; height: 44px; border-radius: 10px;
    object-fit: cover; flex-shrink: 0;
}
.tl-item-body { flex: 1; min-width: 0; }
.tl-item-title {
    font-size: .92rem; font-weight: 600; line-height: 1.3; margin-bottom: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-item-sub {
    font-size: .76rem; color: var(--bs-secondary-color);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tl-item-meta {
    flex-shrink: 0; text-align: right; font-size: .72rem;
    color: var(--bs-secondary-color); min-width: 60px;
}
.tl-item-badge {
    font-size: .6rem; font-weight: 700; padding: 2px 8px;
    border-radius: 4px; display: inline-block; margin-top: 2px;
}
.tl-badge-live { background: var(--bs-primary); color: #fff; animation: tl-pulse 2s infinite; }
.tl-badge-promo { background: var(--bs-success); color: #fff; }
.tl-badge-event { background: #7c3aed; color: #fff; }

.tl-item-price {
    font-size: .82rem; font-weight: 700; color: var(--bs-success); margin-top: 2px;
}

/* ── Separador de período ── */
.tl-period-sep {
    position: relative; text-align: center; margin: 2rem 0 1.5rem -72px;
    padding-left: 72px;
}
.tl-period-sep span {
    background: var(--bs-body-bg); padding: 0 16px; position: relative; z-index: 1;
    font-size: .8rem; font-weight: 700; color: var(--bs-secondary-color);
    text-transform: uppercase; letter-spacing: 1px;
}
.tl-period-sep::after {
    content: ''; position: absolute; left: 72px; right: 0;
    top: 50%; height: 1px; background: var(--bs-border-color);
}

/* ── Contexto temporal (banner) ── */
.tl-time-context {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: 12px; margin-bottom: 1.25rem;
    font-size: .85rem; font-weight: 500;
}
.tl-time-context.morning { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.tl-time-context.lunch   { background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); color: #9a3412; }
.tl-time-context.afternoon { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e40af; }
.tl-time-context.evening { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: #3730a3; }
.tl-time-context.night   { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); color: #c7d2fe; }

/* ── Estado vazio ── */
.tl-empty {
    text-align: center; padding: 3rem 1.5rem; margin-left: -72px;
}
.tl-empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .5; }
.tl-empty-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.tl-empty-text { font-size: .85rem; color: var(--bs-secondary-color); margin-bottom: 1rem; }
.tl-empty-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 24px; background: var(--bs-primary); color: #fff;
    border-radius: 10px; text-decoration: none; font-weight: 600;
    transition: opacity 0.2s;
}
.tl-empty-cta:hover { opacity: .9; color: #fff; }

/* ── Loading ── */
.tl-loading { text-align: center; padding: 3rem 0; margin-left: -72px; }

/* ── Animações ── */
@keyframes tl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}
.tl-item-enter {
    animation: tl-slide-in 0.4s ease-out;
}
@keyframes tl-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Dark mode ── */
[data-bs-theme='dark'] .tl-item { border-color: #333; }
[data-bs-theme='dark'] .tl-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
[data-bs-theme='dark'] .tl-day-btn { border-color: #444; }
[data-bs-theme='dark'] .tl-ctx-btn { border-color: #444; }
[data-bs-theme='dark'] .tl-timeline::before { background: #444; }
[data-bs-theme='dark'] .tl-hour-dot { background: #555; border-color: var(--bs-body-bg); }
[data-bs-theme='dark'] .tl-ctx-btn .ctx-count { background: rgba(255,255,255,0.1); }

/* ── Responsivo ── */
@media (max-width: 600px) {
    .tl-timeline { padding-left: 56px; }
    .tl-timeline::before { left: 40px; }
    .tl-hour-label { left: -56px; width: 36px; font-size: .75rem; }
    .tl-hour-group.tl-now::after { left: -56px; width: 36px; }
    .tl-hour-dot { left: -20px; }
    .tl-clock { font-size: 1.6rem; }
    .tl-ctx-btn { padding: 8px 14px; font-size: .8rem; }
    .tl-item { padding: 10px 12px; gap: 10px; }
    .tl-item-logo { width: 36px; height: 36px; }
    .tl-empty, .tl-loading { margin-left: -56px; }
    .tl-period-sep { margin-left: -56px; padding-left: 56px; }
    .tl-period-sep::after { left: 56px; }
}
@media (max-width: 375px) {
    .tl-timeline { padding-left: 44px; }
    .tl-timeline::before { left: 28px; }
    .tl-hour-label { left: -44px; width: 28px; font-size: .65rem; }
    .tl-hour-group.tl-now::after { left: -44px; width: 28px; font-size: .5rem; }
    .tl-hour-dot { left: -20px; width: 9px; height: 9px; }
    .tl-header { padding: 12px 14px; }
    .tl-clock { font-size: 1.3rem; }
    .tl-item-title { font-size: .82rem; }
    .tl-item-sub { font-size: .68rem; }
    .tl-empty, .tl-loading { margin-left: -44px; }
    .tl-period-sep { margin-left: -44px; padding-left: 44px; }
    .tl-period-sep::after { left: 44px; }
}
