/* ===== VoltHub — Universal Container Index ===== */
/* Design: Dark theme, fire orange accent, ArmoredGate language */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-input: #16161f;
    --border: #1e1e2a;
    --border-hover: #2a2a3a;
    --text: #ffffff;
    --text-secondary: #8a8a9a;
    --text-dim: #5a5a6a;
    --accent: #ff4d00;
    --accent-glow: rgba(255, 77, 0, 0.15);
    --accent-hover: #ff6a2a;
    --green: #22c55e;
    --blue: #3b82f6;
    --yellow: #eab308;
    --red: #ef4444;
    --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

code, .mono { font-family: var(--font-mono); }

/* ===== Navigation ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 18px;
}
.nav-brand:hover { color: var(--text); }

.nav-icon { font-size: 24px; }

.nav-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 80px 24px 48px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    position: relative;
}

.hero h1 .accent { color: var(--accent); }

.hero .tagline {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 40px;
    position: relative;
}

/* ===== Search ===== */
.search-container {
    max-width: 600px;
    margin: 0 auto 48px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--text-dim); }

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 18px;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 50;
}

.search-results.active { display: block; }

.search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }

.search-result-item .result-icon { font-size: 20px; }
.search-result-item .result-name { font-weight: 500; }
.search-result-item .result-tag {
    color: var(--text-dim);
    font-size: 13px;
    font-family: var(--font-mono);
    margin-left: auto;
}

/* ===== Stats ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: var(--max-width);
    margin: 0 auto 64px;
    padding: 0 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-value.loading {
    color: var(--text-dim);
    font-size: 20px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Section Headers ===== */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 64px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
}

.section-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}

/* ===== Image Cards ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.image-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 77, 0, 0.08);
}

.image-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.image-card-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.image-card-info { flex: 1; min-width: 0; }

.image-card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    word-break: break-all;
}

.image-card-namespace {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.image-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tag-pill {
    font-size: 12px;
    font-family: var(--font-mono);
    padding: 3px 10px;
    background: rgba(255, 77, 0, 0.1);
    color: var(--accent);
    border-radius: 20px;
    border: 1px solid rgba(255, 77, 0, 0.2);
}

.image-card-pull {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    font-size: 14px;
}

.copy-btn:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

.copy-btn.copied { color: var(--green); }

/* ===== Image Badges ===== */
.image-card-badges {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-yellow { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-dim { background: rgba(90, 90, 106, 0.15); color: var(--text-dim); }

/* ===== Browse Page ===== */
.page-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===== Image Detail Page ===== */
.detail-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px 24px;
}

.detail-breadcrumb {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.detail-breadcrumb a { color: var(--text-secondary); }
.detail-breadcrumb a:hover { color: var(--text); }

.detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-all;
}

.detail-pull-box {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 32px;
}

.detail-pull-cmd {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.detail-pull-cmd .prompt { color: var(--accent); }
.detail-pull-cmd .cmd { color: var(--text-secondary); }

.detail-sections {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

.detail-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-card h3 .card-icon { font-size: 18px; }

.detail-table {
    width: 100%;
    font-size: 14px;
}

.detail-table tr { border-bottom: 1px solid var(--border); }
.detail-table tr:last-child { border-bottom: none; }

.detail-table td {
    padding: 8px 0;
    vertical-align: top;
}

.detail-table td:first-child {
    color: var(--text-dim);
    font-weight: 500;
    width: 140px;
    white-space: nowrap;
    padding-right: 16px;
}

.detail-table td:last-child {
    font-family: var(--font-mono);
    font-size: 13px;
    word-break: break-all;
}

/* Layers */
.layer-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.layer-item:last-child { border-bottom: none; }

.layer-index {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    min-width: 24px;
}

.layer-digest {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-size {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    white-space: nowrap;
}

/* ===== Loading ===== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-dim);
    font-size: 14px;
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-dim);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--text-secondary); margin-bottom: 8px; }

/* ===== Artifact Badges ===== */
.artifacts-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.artifact-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
}

.artifact-badge.available {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.artifact-badge.unavailable {
    background: rgba(90, 90, 106, 0.08);
    color: var(--text-dim);
    border: 1px solid rgba(90, 90, 106, 0.15);
}

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-dim);
}

.footer-brand { font-weight: 500; }

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.footer-sep { color: var(--border); }
.footer-copy { font-size: 13px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero { padding: 48px 24px 32px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .image-grid { grid-template-columns: 1fr; }
    .detail-sections { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 13px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .nav-badge { display: none; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== Error Banner ===== */
.error-banner {
    max-width: var(--max-width);
    margin: 24px auto;
    padding: 16px 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    color: var(--red);
    font-size: 14px;
    text-align: center;
}
