/* ============================================================
   Version Radar - Timeline & Cards
   Uses VS theme variables from site.css
   ============================================================ */

/* ---- Header ---- */
.radar-header {
    padding: 1rem 0;
}

.radar-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-base);
    background: var(--primary-gradient);
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 122, 204, 0.35);
    animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(0, 122, 204, 0.35);
    }

    50% {
        box-shadow: 0 4px 24px rgba(0, 122, 204, 0.55);
    }
}

/* ---- Alert Banner ---- */
.alert-banner {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.08) 0%, rgba(239, 68, 68, 0.08) 100%);
    border: 1px solid rgba(255, 209, 102, 0.25);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.alert-banner-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 209, 102, 0.1);
    color: var(--vs-yellow);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 209, 102, 0.15);
}

.alert-banner-body {
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 209, 102, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(255, 209, 102, 0.12);
    font-size: 0.85rem;
}

.alert-item-name {
    font-weight: 600;
    color: var(--vs-text);
}

.alert-item-date {
    color: var(--vs-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-days-left {
    background: rgba(239, 68, 68, 0.15);
    color: var(--vs-red);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--vs-panel);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--vs-border);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--vs-border);
    border-radius: 8px;
    background: transparent;
    color: var(--vs-muted);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--vs-accent);
    color: var(--vs-accent);
    background: rgba(106, 159, 181, 0.08);
}

.filter-btn.active {
    border-color: var(--vs-accent-strong);
    color: #fff;
    background: var(--vs-accent-strong);
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

/* ---- Legend ---- */
.legend-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: var(--vs-panel-alt);
    border-radius: var(--border-radius-base);
    border: 1px solid var(--vs-border);
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--vs-muted);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-active {
    background: var(--vs-green);
}

.legend-ending-soon {
    background: var(--vs-yellow);
}

.legend-eol {
    background: var(--vs-red);
}

.legend-preview {
    background: var(--vs-accent-strong);
}

.legend-legacy {
    background: #6b7280;
}

.legend-separator {
    width: 1px;
    height: 20px;
    background: var(--vs-border);
}

.badge-adoption {
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-recommended-sm,
.badge-recommended {
    background: rgba(34, 197, 94, 0.15);
    color: var(--vs-green);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-test-sm,
.badge-test {
    background: rgba(0, 122, 204, 0.15);
    color: var(--vs-accent-strong);
    border: 1px solid rgba(0, 122, 204, 0.25);
}

.badge-avoid-sm,
.badge-avoid {
    background: rgba(239, 68, 68, 0.15);
    color: var(--vs-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---- Timeline Container ---- */
.timeline-container {
    background: var(--vs-panel);
    border: 1px solid var(--vs-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
}

.timeline-scroll {
    overflow-x: hidden;
    overflow-y: hidden;
}

.timeline-canvas {
    position: relative;
    width: 100%;
    min-height: 320px;
    padding-bottom: 30px;
}

/* ---- Year Lines ---- */
.timeline-year-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(60, 60, 60, 0.6);
    z-index: 1;
}

.timeline-year-label {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--vs-muted);
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--vs-panel);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--vs-border);
    white-space: nowrap;
}

/* ---- Today Marker ---- */
.timeline-today-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none;
}

.timeline-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: var(--vs-accent-strong);
    box-shadow: 0 0 8px rgba(0, 122, 204, 0.5);
}

/* Glowing dot at top of today line */
.timeline-today-line::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vs-accent-strong);
    box-shadow: 0 0 10px rgba(0, 122, 204, 0.7), 0 0 20px rgba(0, 122, 204, 0.3);
}

/* ---- Timeline Rows ---- */
.timeline-row {
    position: absolute;
    left: 0;
    right: 0;
    height: 48px;
}

.timeline-row-label {
    position: sticky;
    left: 0;
    top: 0;
    width: 120px;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 12px;
    color: var(--vs-text);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--vs-panel);
    z-index: 5;
    border-right: 1px solid var(--vs-border);
    white-space: nowrap;
}

/* ---- Timeline Bars ---- */
.timeline-bar {
    position: absolute;
    top: 8px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.6rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 3;
    min-width: 40px;
    overflow: hidden;
}

.timeline-bar:hover {
    transform: scaleY(1.2);
    z-index: 8;
}

.bar-label {
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bar-badge-lts {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
}

/* Status colors */
.bar-active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.bar-active:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.5);
}

.bar-ending-soon {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
    animation: pulse-ending 2s ease-in-out infinite;
}

.bar-ending-soon:hover {
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.5);
    animation: none;
}

@keyframes pulse-ending {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.75;
    }
}

.bar-eol {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
    opacity: 0.7;
}

.bar-eol:hover {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.bar-preview {
    background: linear-gradient(135deg, #007acc 0%, #0055aa 100%);
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

.bar-preview:hover {
    box-shadow: 0 4px 16px rgba(0, 122, 204, 0.5);
}

.bar-legacy {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.2);
    opacity: 0.65;
}

.bar-legacy:hover {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

/* ---- Tooltip ---- */
.radar-tooltip {
    position: fixed;
    z-index: 1000;
    background: var(--vs-panel);
    border: 1px solid var(--vs-border);
    border-radius: var(--border-radius-base);
    box-shadow: var(--card-shadow);
    max-width: 340px;
    min-width: 260px;
    pointer-events: none;
}

.tooltip-header {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--vs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tooltip-title {
    font-weight: 700;
    color: var(--vs-text);
    font-size: 0.9rem;
}

.tooltip-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tooltip-body {
    padding: 0.65rem 0.85rem;
}

.tooltip-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    color: var(--vs-muted);
}

.tooltip-row i {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

.tooltip-adoption-row {
    margin-top: 0.3rem;
}

.tooltip-features {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--vs-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tooltip-feature-tag {
    background: rgba(106, 159, 181, 0.1);
    color: var(--vs-accent);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.7rem;
    border: 1px solid rgba(106, 159, 181, 0.15);
}

.tooltip-links {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.tooltip-link {
    font-size: 0.75rem;
    color: var(--vs-accent-strong);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ---- Version Cards Grid ---- */
.version-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.version-card {
    background: var(--vs-panel);
    border: 1px solid var(--vs-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    border-left: 3px solid transparent;
}

.version-card.selected {
    border-color: var(--vs-accent-strong);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.35), var(--card-shadow-hover);
}

.version-card.shake {
    animation: radar-shake 0.35s ease-in-out;
}

@keyframes radar-shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.version-card:hover {
    border-color: var(--vs-accent);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-status-active {
    border-left-color: var(--vs-green);
}

.card-status-ending {
    border-left-color: var(--vs-yellow);
}

.card-status-eol {
    border-left-color: var(--vs-red);
}

.card-status-preview {
    border-left-color: var(--vs-accent-strong);
}

.card-status-legacy {
    border-left-color: #6b7280;
}

.version-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--vs-border);
    background: rgba(0, 0, 0, 0.1);
}

.version-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.version-card-title h3 {
    color: var(--vs-text);
}

.version-card-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.badge-type {
    padding: 0.12rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-lts {
    background: rgba(34, 197, 94, 0.15);
    color: var(--vs-green);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-sts {
    background: rgba(167, 139, 250, 0.15);
    color: var(--vs-purple);
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.badge-preview-card {
    background: rgba(0, 122, 204, 0.15);
    color: var(--vs-accent-strong);
    border: 1px solid rgba(0, 122, 204, 0.25);
}

.badge-legacy {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.version-card-body {
    padding: 0.85rem 1rem;
}

.version-card-dates {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--vs-muted);
}

.eol-countdown {
    background: rgba(255, 209, 102, 0.1);
    border: 1px solid rgba(255, 209, 102, 0.2);
    color: var(--vs-yellow);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    animation: pulse-ending 2s ease-in-out infinite;
}

.version-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
}

.feature-tag {
    background: rgba(106, 159, 181, 0.08);
    color: var(--vs-accent);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    border: 1px solid rgba(106, 159, 181, 0.12);
}

.version-card-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    text-decoration: none;
    color: var(--vs-accent);
    background: rgba(106, 159, 181, 0.08);
    border: 1px solid rgba(106, 159, 181, 0.12);
    transition: var(--transition-base);
}

.card-link-btn:hover {
    background: rgba(106, 159, 181, 0.18);
    color: #fff;
    border-color: var(--vs-accent);
}

.card-link-migration {
    color: var(--vs-purple);
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.12);
}

.card-link-migration:hover {
    background: rgba(167, 139, 250, 0.18);
    color: #fff;
    border-color: var(--vs-purple);
}

/* Hidden cards via filter */
.version-card.hidden-card,
.timeline-row.hidden-row {
    display: none !important;
}

/* ---- Responsive ---- */

/* Small screens: enable horizontal scroll with minimal scrollbar */
@media (max-width: 1200px) {
    .timeline-scroll {
        overflow-x: auto;
        cursor: grab;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 122, 204, 0.4) transparent;
    }

    .timeline-scroll:active {
        cursor: grabbing;
    }

    .timeline-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .timeline-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .timeline-scroll::-webkit-scrollbar-thumb {
        background: rgba(0, 122, 204, 0.35);
        border-radius: 4px;
    }

    .timeline-scroll::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 122, 204, 0.6);
    }

    .timeline-canvas {
        width: 1400px;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .filter-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .legend-bar {
        gap: 0.5rem;
        font-size: 0.72rem;
    }

    .version-cards-grid {
        grid-template-columns: 1fr;
    }

    .timeline-row-label {
        width: 90px;
        font-size: 0.7rem;
        padding-left: 6px;
    }

    .alert-banner-body {
        flex-direction: column;
    }

    .timeline-canvas {
        width: 1000px;
    }
}