/* ==================== TRACKER PAGE STYLES ==================== */

body {
    font-family: Arial, sans-serif;
    background: #0f1218;
    color: var(--text);
    margin: 0;
    padding: 0;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;

    background: linear-gradient(
        180deg,
        #0a0e13 0%,
        #0b0f14 30%,
        #0e141c 100%
    );
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

body.bg-ready::before {
    opacity: 1;
    transition: opacity 600ms ease-out;
}

h1 {
    font-size: 60px;
    margin-bottom: 8px;
}

/* HEADER */

#title {
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Info Box */
.info-box {
    max-width: 1200px;
    margin: 0 auto 28px;
    padding: 24px 24px;
    
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    
    min-height: 95px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    align-items: center;
    
    opacity: 0;
}

.info-box.box-render-active {
    opacity: 1;
}

/* Box morphing styles inherited from common.css */

.info-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.info-label {
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-value {
    display: flex;
    align-items: center;
    justify-content: center;
}

.meta {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 2px;
}

.warning {
    color: #e06c75;
}

/* Nav button styles inherited from common.css */

/* TABLE */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;

    background: transparent;

    border-radius: 10px;

    position: relative;
    z-index: 1;
}

/* ---------- SCANNER (CLEAN + REFINED) ---------- */

#table-container {
    position: relative;

    overflow: hidden;

    opacity: 0;
    z-index: 0;

    isolation: isolate;

    border-radius: 10px;

    border: 1px solid transparent;

    background:
        linear-gradient(
            180deg,
            rgba(21,26,35,0.985),
            rgba(16,21,29,0.985)
        );
}

#table-container.visible {
    opacity: 1;
}

/* Box morphing styles inherited from common.css */

/* scan beam */
#table-container::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;

    height: 110px;
    top: -110px;

    pointer-events: none;
    opacity: 0;

    background: linear-gradient(
        to bottom,
        rgba(95,208,255,0.0) 0%,
        rgba(95,208,255,0.10) 25%,
        rgba(95,208,255,0.35) 45%,
        rgba(95,208,255,0.20) 55%,
        rgba(95,208,255,0.08) 70%,
        rgba(95,208,255,0.0) 100%
    );

    filter: blur(6px);

    z-index: 2;
}

/* active scan */
#table-container.scanning::after {
    opacity: 1;
    animation: table-scan 2000ms linear forwards;
}

#table-body tr {
    position: relative;
}

#table-body tr::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0.06),
        rgba(255,255,255,0)
    );

    opacity: 0;
    transition: opacity 180ms ease-out;
}

#table-body tr.scan-hit::after {
    opacity: 1;
}

#table-body {
    opacity: 0;
}

#table-container.visible #table-body {
    opacity: 1;
}

/* motion */
@keyframes table-scan {
    from { top: -70px; }
    to { top: 100%; }
}

/* TABLE CONTENT */

thead{
    position:relative;
}

thead::after{
    content:"";
    position:absolute;

    left:0;
    right:0;
    bottom:0;

    height:1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(95,208,255,0.14),
            transparent
        );

    pointer-events:none;
}

th, td {
    padding: 12px 14px;
    text-align: left;
}

th {
    background:
        linear-gradient(
            180deg,
            rgba(28,36,50,0.92),
            rgba(18,24,34,0.96)
        );

    color: #8fd8ff;
    font-weight: 600;

    text-shadow:
        0 0 6px rgba(95,208,255,0.18);
}

tr {
    will-change: transform;
    height: 48px;
    position: relative;

    transition:
        background 180ms ease,
        transform 180ms ease;
}

tr::before{
    content:"";
    position:absolute;
    inset:0;

    background:
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--strip-color) 8%, transparent),
            transparent 58%
        );

    opacity:0;
    pointer-events:none;

    transition:opacity 180ms ease;
}

@media (hover: hover) {
    tr:hover::before {
        opacity: 1;
    }

    tr:hover {
        background: rgba(255,255,255,0.018);
    }

    tr:hover .category-strip::before {
        filter: saturate(1.2) brightness(1.15);
        box-shadow: 0 0 8px var(--strip-color), inset 0 0 8px rgba(255,255,255,0.3);
        transition: none;
    }
}

td {
    border-bottom: 1px solid rgba(255,255,255,0.025);
    vertical-align: middle;
}

tbody tr:first-child td{
    border-top:none;
}

th:nth-child(4),
td:nth-child(4) {
    width: 160px;
    white-space: nowrap;
}

/* CATEGORY STRIP */

.category-strip {
    position: relative;
    width: 16px;
    min-width: 16px;
    max-width: 16px;
    padding: 0 !important;
}

.category-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--strip-color, #fff);
    filter: none;
    transition: filter 400ms ease-out, box-shadow 400ms ease-out;
}

/* MOD LINKS */

.mod-name a {
    color: var(--accent);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    text-decoration: none;

    text-shadow:
        0 0 4px rgba(95,208,255,0.08);

    transition:
        color .18s ease,
        text-shadow .18s ease;
}

.mod-name a:hover {
    text-decoration: none;

    color: #8fddff;

    text-shadow:
        0 0 8px rgba(95,208,255,0.45),
        0 0 18px rgba(95,208,255,0.18);
}

/* STATUS */

.status {
    position: relative;
    height: 100%;
}

.status-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.status-text.fade-out {
    opacity: 0;
    transform: translateY(-4px);
}

.status-text.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.status-text.hidden {
    opacity: 0;
}

.status-update {
    color: #e06c75;
}

.status-ok {
    color: var(--muted);
}

/* UPDATE HIGHLIGHT */

.updated-highlight {
    background-color: rgba(95, 208, 255, 0.08);
    transition: background-color 1s ease-out;
}

/* ==================== MOBILE/TABLET: below 1210px ==================== */

@media (max-width: 1209px) {
    h1 {
        font-size: clamp(32px, 6vw, 48px);
    }

    .container {
        margin: 24px auto;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .info-box {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 12px;
        min-height: unset;
    }

    /* Prevent SVG-rendered values from overflowing the info box on narrow screens */
    .info-value {
        max-width: 100%;
        overflow: hidden;
    }

    /* Scale down SVG text to fit container width */
    .info-value svg {
        max-width: 100%;
        height: auto;
    }

    /* Allow rows to grow with wrapped content */
    tr {
        height: auto;
        min-height: 48px;
    }

    /* Let mod name soft-wrap, capped at 4 lines */
    .mod-name a {
        white-space: normal;
        word-break: break-word;
        overflow: hidden;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
    }

    /* Status column: allow wrap */
    th:nth-child(4),
    td:nth-child(4) {
        width: 120px;
        white-space: normal;
        word-break: break-word;
    }

    /* Date column: allow wrap */
    th:nth-child(3),
    td:nth-child(3) {
        width: 160px;
        white-space: normal;
    }

    /* Status text: normal flow so it shows in variable-height rows */
    .status-text {
        position: static;
        transform: none;
    }

    /* Tighten padding */
    th, td {
        padding: 8px 10px;
    }
}

/* ==================== PHONE: precise column widths for 393px+ screens ==================== */

@media (max-width: 500px) {
    /* Budget on 393px phone (369px table, 60px padding across 3 non-strip cells):
       Strip 16px + Date 95px + Status 80px + padding 60px = 251px fixed
       MOD gets 369 - 251 = 118px — enough for soft-wrap at 4 lines */
    th:nth-child(3),
    td:nth-child(3) {
        width: 95px;
    }

    th:nth-child(4),
    td:nth-child(4) {
        width: 80px;
    }
}
