:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Main Navigation Tabs */
.main-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.main-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.main-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--primary);
}

.main-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.main-tab.btn-suggest {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.main-tab.btn-suggest:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Legacy header-nav (kept for fallback) */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--primary);
}

.header-nav .btn-suggest {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.header-nav .btn-suggest:hover {
    background: var(--primary-dark);
    color: white;
}

/* Main Content */
main {
    padding: 2rem 0;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

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

.skill-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.skill-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.skill-provider {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.skill-provider.anthropics {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.skill-provider.openai {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.skill-provider.github {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.skill-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.skill-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-updated {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.skill-category {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg);
    border-radius: 4px;
    color: var(--text-muted);
}

.skill-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 3px;
    color: var(--primary);
}

.skill-features {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.feature-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.feature-badge.scripts {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.feature-badge.references {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.feature-badge.assets {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    position: relative;
    margin: 2rem auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--bg-card-hover);
}

#modal-body {
    padding: 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.modal-header .skill-provider {
    display: inline-block;
    margin-right: 0.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.modal-section p {
    color: var(--text);
    line-height: 1.7;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.modal-link:hover {
    background: var(--primary-dark);
}

.modal-link.secondary {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.modal-link.secondary:hover {
    background: var(--bg-card-hover);
}

.modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Footer */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.update-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.api-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.api-info code {
    display: inline-block;
    margin-top: 0.5rem;
    background: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
}

.api-info code a {
    color: var(--info);
}

/* Info Sections */
.info-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.info-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.intro-text strong {
    color: var(--text);
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.comparison-card {
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.comparison-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.comparison-card ul {
    list-style: none;
    margin-bottom: 1rem;
}

.comparison-card li {
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.comparison-card code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.comparison-card.old-way {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.comparison-card.new-way {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
}

.comparison-problems,
.comparison-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comparison-problems span,
.comparison-benefits span {
    font-size: 0.85rem;
}

/* Skill Structure */
.skill-structure {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 12px;
}

.skill-structure h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.skill-structure pre {
    margin: 0;
    overflow-x: auto;
}

.skill-structure code {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
}

/* Skill Quality & Scoping Sections */
.skill-quality,
.skill-scoping,
.skill-template {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.skill-quality h3,
.skill-scoping h3,
.skill-template h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.skill-quality ul {
    list-style: none;
    padding-left: 0;
}

.skill-quality li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.skill-quality li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
}

.skill-scoping p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.scoping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.scoping-table th,
.scoping-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.scoping-table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.scoping-table td code {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.scoping-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.skill-template pre {
    margin: 0;
    overflow-x: auto;
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
}

.skill-template code {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
}

/* Method Tabs */
.method-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.method-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.method-tab:hover {
    color: var(--text);
    background: var(--bg);
}

.method-tab.active {
    color: var(--primary);
    background: var(--bg);
    font-weight: 500;
}

.method-content {
    padding: 1rem 0;
}

.method-content.hidden {
    display: none;
}

.method-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.method-content > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
}

.step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.step-content pre {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
}

.step-content code {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

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

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    margin-top: 3rem;
}

.cta-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
