/* ============================================================
   FOCUS TIMELINE — Premium Day Story View
   ============================================================ */

/* ── Dashboard Tabs ─────────────────────────────────────── */
.dashboard-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: fit-content;
    margin-bottom: 1.75rem;
}

.dashboard-tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: calc(var(--radius-lg) - 4px);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s var(--ease-smooth);
    white-space: nowrap;
}

.dashboard-tab-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.dashboard-tab-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 12px var(--primary-glow);
    border: 1px solid var(--primary-color);
}

.dashboard-tab-panel { display: none; }
.dashboard-tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* ── Timeline View Panel ────────────────────────────────── */
#timeline-panel {
    animation: tlPanelIn 0.35s var(--ease-out) both;
}

@keyframes tlPanelIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Day Selector ────────────────────────────────────────── */
.tl-day-selector-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.75rem;
}

.tl-day-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.tl-day-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 9px 36px 9px 14px;
    cursor: pointer;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 200px;
}

.tl-day-select:hover,
.tl-day-select:focus {
    border-color: rgba(124, 58, 237, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.tl-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.tl-empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.25;
    margin-bottom: 1rem;
    stroke: var(--text-muted);
    fill: none;
}

.tl-empty-state p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

/* ── Stats Cards Row ─────────────────────────────────────── */
.tl-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .tl-stats-row { grid-template-columns: repeat(2, 1fr); }
}

.tl-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s, transform 0.2s;
    animation: statCardIn 0.4s var(--ease-spring) both;
}

.tl-stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.tl-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.tl-stat-icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tl-stat-icon.focus   { background: rgba(124,58,237,0.12); color: var(--primary-light); }
.tl-stat-icon.break   { background: rgba(6,182,212,0.12);  color: var(--accent-light); }
.tl-stat-icon.longest { background: rgba(245,158,11,0.12); color: var(--timer-work); }
.tl-stat-icon.count   { background: rgba(16,185,129,0.12); color: var(--success-color); }
.tl-stat-icon.avg     { background: rgba(236,72,153,0.12); color: #ec4899; }
.tl-stat-icon.top     { background: rgba(139,92,246,0.12); color: #a78bfa; }

.tl-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.tl-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@keyframes statCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tl-stat-card:nth-child(1) { animation-delay: 0.05s; }
.tl-stat-card:nth-child(2) { animation-delay: 0.10s; }
.tl-stat-card:nth-child(3) { animation-delay: 0.15s; }
.tl-stat-card:nth-child(4) { animation-delay: 0.20s; }
.tl-stat-card:nth-child(5) { animation-delay: 0.25s; }
.tl-stat-card:nth-child(6) { animation-delay: 0.30s; }

/* ── Timeline Heading ────────────────────────────────────── */
.tl-section-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tl-section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ── Vertical Timeline ───────────────────────────────────── */
.tl-list {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 0;
}

/* ── Timeline Event Wrapper ──────────────────────────────── */
.tl-event {
    display: flex;
    gap: 0;
    position: relative;
    animation: tlEventIn 0.45s var(--ease-spring) both;
}

@keyframes tlEventIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* stagger delays for events */
.tl-event:nth-child(1)  { animation-delay: 0.05s; }
.tl-event:nth-child(2)  { animation-delay: 0.10s; }
.tl-event:nth-child(3)  { animation-delay: 0.15s; }
.tl-event:nth-child(4)  { animation-delay: 0.20s; }
.tl-event:nth-child(5)  { animation-delay: 0.25s; }
.tl-event:nth-child(6)  { animation-delay: 0.30s; }
.tl-event:nth-child(7)  { animation-delay: 0.35s; }
.tl-event:nth-child(8)  { animation-delay: 0.40s; }
.tl-event:nth-child(9)  { animation-delay: 0.45s; }
.tl-event:nth-child(10) { animation-delay: 0.50s; }

/* ── Timeline Spine ──────────────────────────────────────── */
.tl-spine {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 40px;
    position: relative;
}

.tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
    margin-top: 18px;
}

.tl-dot.focus-dot {
    background: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.2), 0 0 12px rgba(124,58,237,0.35);
}

.tl-dot.break-dot {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-hover);
}

.tl-line {
    width: 1px;
    flex: 1;
    min-height: 12px;
    background: linear-gradient(to bottom, rgba(124,58,237,0.3), rgba(124,58,237,0.06));
    margin-top: 2px;
    margin-bottom: 2px;
}

.tl-event:last-child .tl-line { display: none; }

/* ── Focus Session Card ──────────────────────────────────── */
.tl-card {
    flex: 1;
    margin-bottom: 12px;
    margin-left: 4px;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.tl-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tl-card:hover {
    transform: translateX(2px);
    border-color: var(--border-hover);
}

/* Focus Session Card */
.tl-focus-card {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.15);
}

.tl-focus-card::before {
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

.tl-focus-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 4px 24px rgba(124,58,237,0.12);
}

.tl-focus-card:hover::before { opacity: 1; }

/* Break Cards */
.tl-break-card {
    background: var(--surface-subtle);
    border-color: var(--divider-color);
    border-style: dashed;
    padding: 12px 18px;
}

.tl-break-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-raised);
}

/* ── Card Header ─────────────────────────────────────────── */
.tl-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.tl-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.tl-duration-badge {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tl-focus-card .tl-duration-badge {
    background: var(--surface-raised);
    color: var(--primary-light);
    border: 1px solid var(--border-color);
}

.tl-break-card .tl-duration-badge {
    background: var(--surface-raised);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ── Card Meta ───────────────────────────────────────────── */
.tl-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tl-time-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
}

.tl-time-tag svg {
    width: 10px;
    height: 10px;
    opacity: 0.6;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tl-category-capsule {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 22px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0.02em !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.tl-pause-capsule {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 22px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: rgba(245, 158, 11, 0.16) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #f59e0b !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.tl-break-capsule {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 22px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    background: rgba(245, 158, 11, 0.18) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #f59e0b !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15) !important;
}

/* ── Sleek Glassmorphic Break Cards ──────────────────────── */
.tl-break-card {
    background: linear-gradient(135deg, rgba(20, 16, 36, 0.6) 0%, rgba(10, 8, 20, 0.75) 100%) !important;
    border: 1px dashed rgba(245, 158, 11, 0.25) !important;
}

.break-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary) !important;
}

.tl-break-icon {
    font-size: 1rem;
    line-height: 1;
}

.break-duration {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

/* ── Day Transition Animation ────────────────────────────── */
.tl-list.changing {
    animation: tlSlideOut 0.18s ease forwards;
}

@keyframes tlSlideOut {
    to { opacity: 0; transform: translateY(8px); }
}

.tl-list.entering {
    animation: tlSlideIn 0.3s var(--ease-spring) both;
}

@keyframes tlSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Pro Gate ────────────────────────────────────────────── */
.tl-pro-gate {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(124,58,237,0.04);
    border: 1px solid rgba(124,58,237,0.12);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tl-pro-gate svg {
    width: 40px;
    height: 40px;
    color: var(--primary-light);
    opacity: 0.7;
    stroke: currentColor;
    fill: none;
}

.tl-pro-gate h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.tl-pro-gate p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 320px;
    margin: 0;
}
