/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
    background: transparent;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: -0.5px;
}
.nav-brand:hover { text-decoration: none; color: #fbbf24; }
.nav-links { display: flex; gap: 1rem; }
.nav-links a { color: #94a3b8; font-size: 0.9rem; }
.nav-links a:hover { color: #e2e8f0; text-decoration: none; }
.nav-search { margin-left: auto; }
.nav-search input {
    background: #0f172a;
    border: 1px solid #475569;
    color: #e2e8f0;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    width: 250px;
    font-size: 0.875rem;
}
.nav-search input:focus { outline: none; border-color: #60a5fa; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; flex: 1; }

/* Hero */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.5rem; color: #f8fafc; margin-bottom: 0.5rem; }
.hero-sub { color: #94a3b8; font-size: 1.1rem; }
.hero-detail { color: #64748b; font-size: 0.9rem; margin-top: 0.25rem; }

/* Gender sections */
.gender-sections { display: flex; gap: 2.5rem; justify-content: center; }
.gender-section h2 { color: #f1f5f9; margin-bottom: 1rem; font-size: 1.3rem; text-align: center; }

/* Apparatus grid */
.apparatus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 500px; margin: 0 auto; }
.apparatus-grid.wag-grid { grid-template-columns: repeat(2, 1fr); max-width: 340px; }
.apparatus-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s, border-color 0.15s;
}
.apparatus-card:hover {
    transform: translateY(-2px);
    border-color: #60a5fa;
    text-decoration: none;
}
.apparatus-card.mag { border-top: 2px solid #3b82f6; }
.apparatus-card.wag { border-top: 2px solid #ec4899; }
.apparatus-code {
    font-size: 1.75rem;
    font-weight: 800;
    color: #f8fafc;
}
.apparatus-name { color: #94a3b8; font-size: 0.85rem; text-align: center; }

/* Breadcrumb */
.breadcrumb { color: #64748b; font-size: 0.85rem; margin-bottom: 1rem; }
.breadcrumb a { color: #60a5fa; }

/* Difficulty filter */
.difficulty-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filter-label { color: #94a3b8; font-size: 0.85rem; margin-right: 0.5rem; }
.diff-btn {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    cursor: pointer;
}
.diff-btn:hover { border-color: var(--diff-color, #60a5fa); text-decoration: none; }
.diff-btn.active {
    background: var(--diff-color, #60a5fa);
    color: #fff;
    border-color: var(--diff-color, #60a5fa);
}

/* Category section */
.category-section { margin-bottom: 2rem; }
.category-header {
    color: #f1f5f9;
    font-size: 1.1rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Skills grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.skill-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
}
.skill-card:hover { border-color: #60a5fa; text-decoration: none; }
.skill-image {
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 150px;
    overflow: hidden;
}
.skill-image img { width: 100%; height: auto; object-fit: contain; }
.skill-info { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.skill-number { font-weight: 700; color: #94a3b8; font-size: 0.8rem; }
.skill-desc { color: #cbd5e1; font-size: 0.85rem; line-height: 1.4; }
.difficulty-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    width: fit-content;
}
.difficulty-badge.vault-score { background: #6366f1; }
.difficulty-badge.large { font-size: 0.9rem; padding: 0.25rem 0.75rem; }
.named-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f59e0b;
    color: #1e293b;
    width: fit-content;
}
.named-badge.large { font-size: 0.85rem; padding: 0.2rem 0.75rem; }

/* Skill detail */
.skill-detail { max-width: 800px; }
.skill-detail-header { margin-bottom: 1.5rem; }
.skill-detail-header h1 {
    font-size: 1.75rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.skill-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.meta-item {
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    background: #1e293b;
    border-radius: 4px;
}
.skill-detail-image {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.skill-detail-image img { max-width: 100%; height: auto; }
.skill-description, .skill-notes {
    background: #1e293b;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.skill-description h2, .skill-notes h2 {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}
.skill-description p, .skill-notes p {
    color: #e2e8f0;
    line-height: 1.6;
}

/* Search */
.search-form { margin-bottom: 1.5rem; }
.search-input-group { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.search-input-group input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}
.search-input-group input:focus { outline: none; border-color: #60a5fa; }
.search-input-group button {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.search-input-group button:hover { background: #2563eb; }
.search-filters { display: flex; gap: 1rem; }
.search-filters label { color: #94a3b8; font-size: 0.9rem; cursor: pointer; }
.search-filters input { margin-right: 0.25rem; }
.results-count { color: #64748b; font-size: 0.85rem; margin-bottom: 1rem; }

/* Search results */
.search-results-list { display: flex; flex-direction: column; gap: 0.5rem; }
.search-result-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s;
}
.search-result-card:hover { border-color: #60a5fa; text-decoration: none; }
.result-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.result-apparatus {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}
.result-apparatus.mag { background: #1e3a5f; color: #60a5fa; }
.result-apparatus.wag { background: #4a1942; color: #f472b6; }
.result-desc { color: #cbd5e1; font-size: 0.85rem; line-height: 1.4; }
.result-category { color: #64748b; font-size: 0.75rem; }
.no-results { color: #64748b; text-align: center; padding: 2rem; }

/* Category buttons (float above apparatus bar) */
.category-bar {
    position: fixed;
    bottom: 52px;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 0.5rem 0.35rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    pointer-events: none;
}
.cat-btn {
    pointer-events: auto;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 800;
    background: #0f172a;
    border: 1px solid #334155;
    color: #f8fafc;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s;
    min-width: 56px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-btn.mag { border-top: 2px solid #3b82f6; }
.cat-btn.wag { border-top: 2px solid #ec4899; }
.cat-btn:hover {
    transform: translateY(-2px);
    border-color: #60a5fa;
    color: #fff;
    text-decoration: none;
}
.cat-btn.active {
    background: #1e3a5f;
    border-color: #60a5fa;
    color: #fff;
}
.cat-btn.wag.active {
    background: #4a1942;
    border-color: #ec4899;
}
.cat-btn.wag:hover { border-color: #ec4899; }

/* Apparatus bottom bar (shown on apparatus/skill pages) */
.apparatus-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.4rem 0.5rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    pointer-events: none;
}
.apparatus-bar .bar-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: #0f172a;
    border: 1px solid #334155;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s;
    min-width: 56px;
    height: 36px;
}
.apparatus-bar .bar-btn:hover {
    transform: translateY(-2px);
    border-color: #60a5fa;
    text-decoration: none;
}
.apparatus-bar .bar-btn.active {
    border-color: #60a5fa;
    background: #1e3a5f;
}
.apparatus-bar .bar-btn.mag { border-top: 2px solid #3b82f6; }
.apparatus-bar .bar-btn.wag { border-top: 2px solid #ec4899; }
.apparatus-bar .bar-btn .bar-code {
    font-size: 1rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1;
}
/* Add bottom padding to main content so it doesn't hide behind the bars */
body.has-apparatus-bar .container { padding-bottom: 100px; }
body.has-apparatus-bar .footer { display: none; }

/* Footer */
.footer {
    background: #1e293b;
    border-top: 1px solid #334155;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .gender-sections { flex-direction: column; }
    .skills-grid { grid-template-columns: 1fr; }
    .apparatus-grid { grid-template-columns: repeat(2, 1fr); }
    .apparatus-bar { gap: 0.2rem; padding: 0.3rem; }
    .apparatus-bar .bar-btn { min-width: 42px; padding: 0.25rem 0.35rem; }
    .apparatus-bar .bar-btn .bar-code { font-size: 0.75rem; }
    .category-bar { gap: 0.2rem; flex-wrap: wrap; }
    .cat-btn { padding: 0.25rem 0.35rem; font-size: 0.85rem; min-width: 42px; }
}
