:root {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-code: #1e293b;
    
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-dark: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Header Navbar */
.app-navbar {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 20px;
    color: var(--primary);
}

.brand-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.brand-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.navbar-search {
    position: relative;
    width: 380px;
}

.navbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.navbar-search input {
    width: 100%;
    padding: 8px 16px 8px 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    font-size: 14px;
    transition: all 0.2s;
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 24px;
}

.section-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 12px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Main Content */
.app-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header .subtitle {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 15px;
    margin-bottom: 32px;
}

/* Catalog View */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.catalog-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.catalog-card__preview {
    background: #f1f5f9;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card__body {
    padding: 20px;
    flex: 1;
}

.catalog-card__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catalog-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.tag-selector {
    font-family: var(--font-mono);
    font-size: 11px;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
}

/* Detail View */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    color: var(--primary);
}

.breadcrumb .divider {
    color: var(--text-muted);
}

.breadcrumb .current {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.detail-header h2 {
    font-size: 32px;
    font-weight: 700;
}

.detail-section {
    margin-bottom: 40px;
}

.detail-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Preview Stage */
.preview-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

/* Code Snippet Box */
.code-block {
    background: var(--bg-code);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.code-block header {
    background: #0f172a;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-dark);
}

.code-block header span {
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: 12px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}

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

.code-block pre {
    padding: 20px;
    color: #f8fafc;
    font-family: var(--font-mono);
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* API Table */
.api-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.api-table th, .api-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.api-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-secondary);
}

.api-table td code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0284c7;
}

/* DEMO COMPONENT CUSTOM STYLES */
/* Card Component Style */
.app-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}
.app-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.app-card__title {
    margin: 0;
    font-weight: 700;
    font-size: 14px;
}
.app-card__body { flex: 1; font-size: 13px; }

/* Key-Value Component Style */
.key-value {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
}
.key-value__title { font-size: 12px; color: #64748b; margin: 0; }
.key-value__divider { font-size: 12px; color: #94a3b8; }
.key-value__value { font-size: 12px; font-weight: 700; color: #0f172a; margin: 0; }