/* =========================================
   1. VARIABLES & BASE SETUP
   ========================================= */
:root {
    --primary: #ed2b34; 
    --primary-hover: #c81e25;
    --primary-btn: #dc2626;
    --primary-btn-hover: #b91c1c;
    --surface: rgba(35, 39, 50, 0.75);
    --surface-alt: rgba(25, 28, 37, 0.85);
    --row-bg: rgba(26, 30, 40, 0.6);
    --row-hover: rgba(40, 46, 62, 0.7);
    --text: #F8FAFC;
    --text-muted: #9BA3AF;
    --text-dim: #64748B;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --code-bg: rgba(0, 0, 0, 0.35);
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
}

html {
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #161922;
    background-image: radial-gradient(ellipse at top, #363C4F 0%, #161922 80%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =========================================
   2. LAYOUT & CONTAINERS
   ========================================= */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.nobr {
    white-space: nowrap;
}

/* =========================================
   3. HEADER
   ========================================= */
header {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    min-height: 92px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.logo-container {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-container img {
    height: 40px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.logo-container span {
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--text-muted);
    border-left: 1px solid var(--border);
    padding-left: 12px;
    line-height: 1;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover {
    color: var(--text);
}

/* =========================================
   4. CODE-STYLE HEADER & HERO
   ========================================= */
.page-intro {
    margin-bottom: 2.25rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.4rem 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.terminal-prompt {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 1.4rem;
}

.page-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
    font-family: var(--font-mono);
}

/* Quick navigation / jump index */
.quick-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.15rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.quick-nav-label {
    color: var(--text-dim);
    margin-right: 0.2rem;
    font-weight: 500;
}

.quick-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.quick-nav-num {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
}

.quick-nav-link:hover {
    color: #ffffff;
    border-color: var(--primary);
    background: rgba(237, 43, 52, 0.08);
}

.quick-nav-link:hover .quick-nav-num {
    color: #ffffff;
}

/* =========================================
   5. MINIMALIST CATEGORY SECTIONS
   ========================================= */
.download-section {
    margin-bottom: 2.85rem;
    scroll-margin-top: 85px;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.15rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    letter-spacing: -0.2px;
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.section-desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Target badge (e.g. for StreamTo: FC612 / FC631 Raw) */
.tag-target {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    letter-spacing: 0.3px;
}

/* Cross-reference / Related Tool note inside hardware accordion */
.related-tool-box {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.22);
    border-top: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.related-tool-icon {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: bold;
}

.related-tool-box a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary);
    transition: color 0.15s, border-bottom-color 0.15s;
}

.related-tool-box a:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* =========================================
   6. MINIMALIST PRODUCT GROUPS & LISTING
   ========================================= */
.file-group {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    scroll-margin-top: 115px;
}

.file-group-summary {
    padding: 0.9rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.file-group[open] .file-group-summary {
    border-bottom-color: var(--border);
}

.file-group-summary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.file-group-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #ffffff;
    font-size: 1rem;
}

.file-group-title svg.chevron {
    color: var(--primary);
    transition: transform 0.2s ease;
}

.file-group[open] .file-group-title svg.chevron {
    transform: rotate(90deg);
}

.file-group-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: normal;
}

/* Table layout */
.file-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.file-list th {
    text-align: left;
    padding: 0.6rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.file-list td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    transition: background-color 0.4s ease;
}

.file-list td:first-child {
    border-left: 3px solid transparent;
    transition: background-color 0.4s ease, border-left-color 0.4s ease;
}

.file-list tr {
    scroll-margin-top: calc(50vh - 25px);
}

.file-list tr:last-child td {
    border-bottom: none;
}

.file-list tr:hover td {
    background: var(--row-hover);
}

/* Deep-Link Pulsing Row Highlight (Zero Layout Shift) */
.pulse-row-highlight td {
    animation: row-pulse-highlight 3.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes row-pulse-highlight {
    0% {
        background-color: transparent;
        border-left-color: transparent;
    }
    18% {
        background-color: rgba(237, 43, 52, 0.24);
        border-left-color: var(--primary);
    }
    38% {
        background-color: rgba(237, 43, 52, 0.08);
        border-left-color: rgba(237, 43, 52, 0.4);
    }
    58% {
        background-color: rgba(237, 43, 52, 0.22);
        border-left-color: var(--primary);
    }
    78% {
        background-color: rgba(237, 43, 52, 0.06);
        border-left-color: rgba(237, 43, 52, 0.3);
    }
    100% {
        background-color: transparent;
        border-left-color: transparent;
    }
}

/* Cell content formatting */
.col-file {
    font-family: var(--font-mono);
}

.file-row-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================================
   3 SEMANTIC COLOR TAGS: SOFTWARE, FIRMWARE, DOCUMENT
   ========================================= */
.tag-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    white-space: nowrap;
}

/* 1. Software & Drivers -> Green */
.tag-software {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

/* 2. Firmware -> Amber */
.tag-firmware {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* 3. Documents (Manual, Technical Description, Flyer) -> Blue */
.tag-document {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.file-name-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.file-name-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.file-name-link svg {
    color: var(--primary);
    opacity: 0.75;
    flex-shrink: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.file-name-link:hover svg {
    opacity: 1;
    transform: translateY(1px);
}

.file-note {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.col-date {
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 0.85rem;
    width: 120px;
}

.col-size {
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 0.85rem;
    width: 95px;
    text-align: right;
}

th.col-size {
    text-align: right;
}

/* =========================================
   5b. INLINE ARCHIVE & PREVIOUS RELEASES
   ========================================= */
.archive-group {
    border-top: 1px dashed var(--border);
    background: rgba(0, 0, 0, 0.18);
}

.archive-summary {
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: all 0.15s ease;
}

.archive-summary:hover {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.archive-summary-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.archive-summary svg.chevron {
    color: var(--text-dim);
    transition: transform 0.2s ease;
}

.archive-group[open] .archive-summary svg.chevron {
    transform: rotate(90deg);
}

.archive-group[open] .archive-summary {
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.archive-row {
    opacity: 0.72;
    transition: opacity 0.15s ease;
}

.archive-row:hover {
    opacity: 1;
}

.tag-legacy {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    white-space: nowrap;
}


/* =========================================
   6. FOOTER
   ========================================= */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 2rem 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: center;
}

.footer-col p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
}

.footer-col h4 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1rem;
}

.footer-col a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.25rem 0;
    min-height: 24px;
    box-sizing: border-box;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-middle {
    display: flex;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.footer-middle:hover {
    opacity: 1;
}

.footer-middle img {
    height: 35px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.app-version {
    opacity: 0.45;
    font-size: 0.8rem;
    margin-left: 0.35rem;
}

.footer-container > .footer-col:last-of-type {
    text-align: justify;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.25rem 0;
    min-height: 24px;
    box-sizing: border-box;
}

.footer-links a:hover {
    color: var(--primary);
}

/* =========================================
   7. COOKIE BANNER & SCROLL TO TOP
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(20, 22, 28, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.cookie-banner a {
    color: var(--text);
    text-decoration: underline;
}

.cookie-banner a:hover {
    color: var(--primary);
}

.cookie-banner .btn {
    background: var(--primary-btn);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 2rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.cookie-banner .btn:hover {
    background: var(--primary-btn-hover);
}

.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 90;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* =========================================
   8. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    /* Global Layout & Padding */
    .container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    /* Header - Scaled cleanly for mobile without colliding */
    .header-content {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
        min-height: auto;
    }

    .logo-container {
        gap: 8px;
        flex-shrink: 1;
        min-width: 0;
        min-height: auto;
    }

    .logo-container img {
        height: 26px;
        width: auto;
    }

    .logo-container span {
        font-size: 1.15rem;
        padding-left: 8px;
        white-space: nowrap;
    }

    .header-nav {
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    /* Footer */
    .site-footer {
        margin-top: 3rem;
        padding: 2rem 1rem 1.5rem 1rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-container > .footer-col:last-of-type {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        justify-content: center;
        gap: 1rem;
    }

    /* Cookie Banner */
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
        gap: 1rem;
    }

    .cookie-banner .btn {
        width: 100%;
    }

    /* Table adjustments */
    .file-list td, .file-list th {
        padding: 0.65rem 0.85rem;
    }
}

@media (max-width: 580px) {
    .file-list th.col-date, .file-list td.col-date {
        display: none;
    }
}

