/* E7 Analytics — "Filter Timeframe" merged timeline + filter component */

.e7-tf {
    position: relative;
    background:
        radial-gradient(1200px 120px at 20% -40%, rgba(129,140,248,0.18), transparent 70%),
        linear-gradient(135deg, rgba(30,30,60,0.85), rgba(20,20,40,0.85));
    border: 1px solid rgba(129, 140, 248, 0.35);
    border-radius: 16px;
    padding: 18px 22px 20px;
    margin-bottom: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.e7-tf-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.e7-tf-head-left { flex: 1; min-width: 280px; }
.e7-tf-title {
    font-size: 1.15em;
    font-weight: 700;
    background: linear-gradient(90deg, #f472b6, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}
.e7-tf-subtitle { font-size: 0.76em; color: #8a8aa0; margin: 6px 0 0; max-width: 760px; line-height: 1.5; }

/* Head controls (clickable dates + rank), top-right */
.e7-tf-head-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.e7-tf-datebtn {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(129,140,248,0.12);
    border: 1px solid rgba(129,140,248,0.4);
    border-radius: 10px;
    padding: 5px 12px;
    cursor: pointer;
    min-width: 84px;
    transition: all 0.15s;
}
.e7-tf-datebtn:hover { background: rgba(129,140,248,0.28); border-color: #818cf8; }
.e7-tf-datebtn .lbl { font-size: 0.6em; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }
.e7-tf-datebtn .val { font-size: 0.95em; color: #fff; font-weight: 600; }
.e7-tf-datesep { color: #818cf8; font-size: 1.1em; }
.e7-tf-hidden-date {
    position: absolute;
    left: 10px; bottom: 0;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0; padding: 0;
    color-scheme: dark;
}
.e7-tf-rank-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(129,140,248,0.12);
    border: 1px solid rgba(129,140,248,0.4);
    border-radius: 10px;
    padding: 5px 12px;
}
.e7-tf-rank-wrap .lbl { font-size: 0.6em; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }
.e7-tf-select {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    color: #fff;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    color-scheme: dark;
}
.e7-tf-select:focus { outline: none; }
.e7-tf-select option { background: #1a1a3e; color: #eee; }

/* ── Timeline track ──────────────────────────────── */
.e7-tf-track-wrap {
    position: relative;
    height: 96px;
}
/* Inset coordinate space so the Season Start / Now anchors don't clip the edges */
.e7-tf-rail {
    position: absolute;
    top: 0; bottom: 0;
    left: 72px; right: 72px;
}
.e7-tf-track {
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 5px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, rgba(129,140,248,0.45), rgba(244,114,182,0.45));
    border-radius: 4px;
}
.e7-tf-band {
    position: absolute;
    top: 50%;
    height: 11px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, rgba(129,140,248,0.55), rgba(244,114,182,0.55));
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(129,140,248,0.5);
    pointer-events: none;
    transition: left 0.15s ease, width 0.15s ease;
}

/* Markers */
.e7-tf-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 3;
}
.e7-tf-marker:hover { z-index: 20; }

/* Portrait markers (launch / patch / equipment all use a hero portrait) */
.e7-tf-portrait {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid #818cf8;
    background: #1a1a3e;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}
.e7-tf-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.e7-tf-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #c7d2fe; font-size: 0.8em; font-weight: 700;
}
.e7-tf-marker:hover .e7-tf-portrait { transform: scale(1.14); }
.e7-tf-ring-launch { border-color: #818cf8; box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 10px rgba(129,140,248,0.5); }
.e7-tf-ring-patch  { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 10px rgba(251,191,36,0.55); }
.e7-tf-ring-equip  { border-color: #ec4899; box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 10px rgba(244,114,182,0.5); }

/* Type badge in the corner of the portrait (overlaid, not clipped) */
.e7-tf-badge {
    position: absolute;
    bottom: -3px; right: -3px;
    width: 16px; height: 16px;
    border: 2px solid #14142b;
    z-index: 5;
}
.e7-tf-badge-launch { background: radial-gradient(circle at 35% 35%, #a5b4fc, #6366f1); border-radius: 50%; }
.e7-tf-badge-patch { background: linear-gradient(135deg,#fcd34d,#f59e0b); border-radius: 2px; transform: rotate(45deg); }
.e7-tf-badge-equip { background: linear-gradient(135deg,#f9a8d4,#ec4899); border-radius: 4px; }

/* Anchors — season start / now pills ON the line (solid so the track doesn't show through) */
.e7-tf-anchor .e7-tf-shape {
    padding: 5px 11px;
    border-radius: 999px;
    background: #2a2a52;
    border: 1px solid rgba(255,255,255,0.4);
    color: #e5e7ff;
    font-size: 0.66em;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: all 0.15s;
}
.e7-tf-marker.e7-tf-anchor:hover .e7-tf-shape { background: #3b3b73; border-color: #818cf8; color: #fff; }

/* Selected endpoint emphasis */
.e7-tf-marker.endpoint .e7-tf-portrait { box-shadow: 0 0 0 3px rgba(244,114,182,0.9), 0 0 14px rgba(244,114,182,0.6) !important; }
.e7-tf-marker.endpoint .e7-tf-shape { box-shadow: 0 0 0 3px rgba(244,114,182,0.8), 0 0 14px rgba(244,114,182,0.5) !important; }

/* Tooltip */
.e7-tf-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.74em;
    color: #eee;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 30;
}
.e7-tf-marker:hover .e7-tf-tip { opacity: 1; pointer-events: auto; }
.e7-tf-tip .e7-tf-tip-date { color: #9ca3af; display: block; margin-top: 2px; }
.e7-tf-tip a { color: #60a5fa; text-decoration: none; }
.e7-tf-tip a:hover { text-decoration: underline; }

/* New-season placeholder (shown instead of the track during the young window) */
.e7-tf-placeholder {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(129,140,248,0.08);
    border: 1px dashed rgba(129,140,248,0.45);
    border-radius: 12px;
    padding: 20px 22px;
    margin-top: 4px;
}
.e7-tf-ph-text { font-size: 0.85em; color: #c7d2fe; line-height: 1.5; }
.e7-tf-ph-text strong { color: #fff; }

/* ── Footer: legend (left) + actions (right) ─────── */
.e7-tf-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.e7-tf-footer-young { justify-content: flex-end; }
.e7-tf-actions { display: flex; gap: 8px; align-items: center; }
.e7-tf-alert {
    display: none;
    align-items: center;
    background: rgba(251,191,36,0.15);
    border: 1px solid rgba(251,191,36,0.55);
    color: #fcd34d;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.78em;
    max-width: 380px;
    line-height: 1.3;
}
.e7-tf-alert.show { display: inline-flex; }
.e7-tf-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 9px 22px;
    color: #ddd;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 0.88em;
    transition: all 0.2s;
}
.e7-tf-btn:hover { background: rgba(255, 255, 255, 0.16); }
.e7-tf-btn-primary {
    background: linear-gradient(90deg, #818cf8, #f472b6);
    border: none;
    color: #fff;
    font-weight: 600;
}
.e7-tf-btn-primary:hover { filter: brightness(1.1); box-shadow: 0 2px 12px rgba(129,140,248,0.5); }
.e7-tf-btn-primary:disabled { opacity: 0.6; cursor: default; filter: none; box-shadow: none; }

/* Legend */
.e7-tf-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.72em;
    color: #9ca3af;
}
.e7-tf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.e7-tf-sw { width: 11px; height: 11px; display: inline-block; }
.e7-tf-sw-patch { background: linear-gradient(135deg,#fcd34d,#f59e0b); border-radius: 2px; transform: rotate(45deg); }
.e7-tf-sw-launch { background: #818cf8; border-radius: 50%; }
.e7-tf-sw-equip { background: linear-gradient(135deg,#f9a8d4,#ec4899); border-radius: 3px; }

/* Mobile */
@media (max-width: 900px) {
    .e7-tf { padding: 14px 14px 16px; }
    .e7-tf-track-wrap { height: 88px; }
    .e7-tf-portrait { width: 34px; height: 34px; }
    .e7-tf-head { gap: 12px; }
    .e7-tf-head-controls { gap: 8px; width: 100%; }
    .e7-tf-footer { gap: 10px; }
    .e7-tf-actions { margin-left: auto; }
}
