/* Shared styles across all Kafka Explorer pages */

:root {
    --navbar-height: 44px;
    --space-4x: 16px;
    --space-8x: 32px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-size-small: 14px;
    --font-size-extra-small: 12px;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-900: #111827;
    --color-success-50: #f0fdf4;
    --color-danger-50: #fef2f2;
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;
    --color-warning-50: #fffbeb;
    --color-orange-50: #fff7ed;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: var(--font-family); background: white; }

/* Screen reader only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Brand bar */
.brand-bar {
    position: fixed; top: 0; left: 0; width: 100%;
    background: white; border-bottom: 1px solid var(--color-gray-200);
    z-index: 5; padding: 0 var(--space-4x);
    display: flex; align-items: center; gap: 0;
    height: var(--navbar-height);
}

.brand-logo {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none; color: var(--color-gray-900); flex-shrink: 0;
    padding-right: 1rem; margin-right: 0.25rem;
    border-right: 1px solid var(--color-gray-200);
}

.brand-bar img { height: 20px; width: auto; }

.brand-nav-links { display: flex; gap: 0; flex-shrink: 0; }

.brand-nav-links a {
    padding: 0.5rem 0.85rem; text-decoration: none;
    font-size: var(--font-size-small); font-weight: 500;
    color: #6b7280; border-bottom: 2px solid transparent;
    transition: all 150ms;
}

.brand-nav-links a:hover { color: var(--color-gray-900); background: var(--color-gray-50); }
.brand-nav-links a.active { color: hsl(209, 99%, 50%); border-bottom-color: hsl(209, 99%, 50%); }

.brand-description {
    font-size: var(--font-size-small); color: #9ca3af;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-left: 0.75rem; padding-left: 0.75rem;
    border-left: 1px solid var(--color-gray-200);
}

/* Nav toolbar */
.nav-menu {
    position: fixed; top: var(--navbar-height); left: 0; width: 100%;
    background: white; border-bottom: 1px solid var(--color-gray-200);
    z-index: 4; overflow-x: auto; white-space: nowrap;
    padding: 0.75rem var(--space-4x);
    display: flex; gap: 0.5rem; align-items: center;
    scrollbar-width: thin;
}

.nav-menu::-webkit-scrollbar { height: 4px; }
.nav-menu::-webkit-scrollbar-thumb { background: var(--color-gray-200); border-radius: 2px; }

/* Search */
.search-input {
    max-width: 250px; padding: 0.5rem;
    border: 1px solid var(--color-gray-200); border-radius: 6px;
    font-size: var(--font-size-small); font-family: var(--font-family);
    color: var(--color-gray-900); background: white; outline: none;
    transition: all 200ms ease;
}
.search-input:focus { border-color: hsl(209, 99%, 50%); }
.search-input::placeholder { color: #9ca3af; }

/* Category dropdown */
.category-dropdown { position: relative; }
.category-dropdown-btn {
    padding: 0.5rem 1rem; background: var(--color-gray-100);
    border: 1px solid var(--color-gray-200); border-radius: 6px;
    font-size: var(--font-size-small); font-family: var(--font-family);
    font-weight: 500; color: var(--color-gray-900);
    cursor: pointer; white-space: nowrap;
}
.category-dropdown-btn:hover { background: var(--color-primary-100); }
.category-dropdown-menu {
    display: none; position: fixed; background: white;
    border: 1px solid var(--color-gray-200); border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 50;
    min-width: 220px; max-height: 400px; overflow-y: auto; padding: 0.4rem 0;
}
.category-dropdown-menu.open { display: block; }
.category-dropdown-menu label {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.75rem; font-size: var(--font-size-small);
    cursor: pointer; white-space: nowrap;
}
.category-dropdown-menu label:hover { background: var(--color-gray-50); }
.category-dropdown-menu .cat-count { color: #9ca3af; font-size: 11px; margin-left: auto; }

/* View toggle */
.view-toggle { display: flex; gap: 0; border: 1px solid var(--color-gray-200); border-radius: 6px; overflow: hidden; }
.view-btn {
    padding: 0.4rem 0.75rem; font-size: var(--font-size-small);
    font-family: var(--font-family); font-weight: 500;
    border: none; background: white; color: #6b7280;
    cursor: pointer; transition: all 200ms;
}
.view-btn:not(:last-child) { border-right: 1px solid var(--color-gray-200); }
.view-btn:hover { background: var(--color-gray-50); }
.view-btn.active { background: var(--color-primary-50); color: hsl(209, 99%, 50%); font-weight: 600; }

/* Version filter */
.version-filter {
    display: inline-flex; align-items: center; gap: 0;
    font-size: var(--font-size-small); font-weight: 500; white-space: nowrap;
    border: 1px solid var(--color-gray-200); border-radius: 6px; overflow: hidden;
}
.version-filter label { color: #6b7280; padding: 0.4rem 0.5rem; }
.version-filter select {
    padding: 0.4rem 0.3rem; background: white;
    border: none; border-left: 1px solid var(--color-gray-200);
    font-size: var(--font-size-small); font-family: var(--font-family);
    color: var(--color-gray-900); cursor: pointer; outline: none;
    -webkit-appearance: none; appearance: none;
}
.version-filter select:hover { background: var(--color-gray-50); }
.version-arrow { color: #9ca3af; padding: 0 0.15rem; font-size: 12px; }

/* Diff stats */
.version-diff {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: var(--font-size-extra-small); white-space: nowrap;
    background: var(--color-gray-100); padding: 0.3rem 0.6rem;
    border-radius: 6px; border: 1px solid var(--color-gray-200);
}
.version-diff:empty { display: none; }
.diff-added { color: #15803d; }
.diff-removed { color: #b91c1c; }
.diff-new { color: #1d4ed8; }
.diff-none { color: #9ca3af; }
.diff-sep { color: var(--color-gray-200); }

/* Out-of-range columns (version filter) */
th[data-in-range="false"],
td[data-in-range="false"] { opacity: 0.2; }

/* Page offset */
.page-offset { height: 100px; }
[id] { scroll-margin-top: 112px; }

/* Changelog shared */
.cl-release { margin: 0 var(--space-4x) 1.5rem; }
.cl-version { font-size: var(--font-size-small); font-weight: 700; color: var(--color-gray-900); margin: 0 0 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--color-gray-200); }
.cl-category { margin-bottom: 0.5rem; }
.cl-cat-name { font-size: var(--font-size-small); font-weight: 600; color: var(--color-gray-900); text-transform: capitalize; }
.cl-cat-count { font-size: 11px; color: #9ca3af; }
.cl-new { font-size: 10px; font-weight: 700; color: #92400e; }
.cl-note { font-size: var(--font-size-extra-small); color: #6b7280; margin-left: 1rem; line-height: 1.4; }
.cl-item { font-size: var(--font-size-extra-small); font-family: monospace; margin-left: 1rem; }
.cl-added { color: #16a34a; }
.cl-removed { color: #dc2626; }
.cl-modified { color: #2563eb; }
.cl-val { color: #9ca3af; }

/* Footer */
.site-footer {
    text-align: center; padding: var(--space-8x) var(--space-4x);
    font-size: var(--font-size-small); color: #6b7280;
    border-top: 1px solid var(--color-gray-200);
}
.site-footer a { color: #6b7280; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Toast */
.copy-toast {
    position: fixed; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%) translateY(0.5rem);
    background: var(--color-gray-900); color: white;
    padding: 0.4rem 0.9rem; border-radius: 6px;
    font-size: var(--font-size-small); opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease;
    pointer-events: none; z-index: 100;
}
.copy-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Filter buttons (KIPs page) */
.filter-toggle { display: flex; gap: 0; border: 1px solid var(--color-gray-200); border-radius: 6px; overflow: hidden; }
.filter-btn {
    padding: 0.4rem 0.75rem; font-size: var(--font-size-small);
    font-family: var(--font-family); font-weight: 500;
    border: none; background: white; color: #6b7280;
    cursor: pointer; transition: all 200ms;
}
.filter-btn:not(:last-child) { border-right: 1px solid var(--color-gray-200); }
.filter-btn:hover { background: var(--color-gray-50); }
.filter-btn.active { background: var(--color-primary-50); color: hsl(209, 99%, 50%); font-weight: 600; }
.filter-btn:not(.active) { color: #6b7280; }

/* KIP link style */
.kip-link-dark { color: #2563eb; text-decoration: underline; }

/* Search highlight */
mark.search-hl { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }

/* Page title + intro — visible for SEO/AIO but compact */
h1.page-title { font-size: var(--font-size-small); font-weight: 500; color: #6b7280; margin: 0; padding: 0.25rem var(--space-4x) 0; }
.page-intro { font-size: var(--font-size-extra-small); color: #9ca3af; margin: 0; padding: 0 var(--space-4x) 0.25rem; }
