/* Page Header */
.page-header {
    padding: 120px 0 60px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #888888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Component List */
.components-list {
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background-color: var(--border-color); /* Creates the grid lines */
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2rem;
        background: linear-gradient(180deg, #ffffff 0%, #888888 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* Component Cards */
.component-card {
    background-color: var(--bg-color);
    padding: 32px;
    text-decoration: none;
    transition: all 0.2s;
    display: block;
    border: 1px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.component-card:hover {
    background-color: var(--card-bg);
    border-color: rgba(255, 193, 7, 0.1);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--card-bg);
    transition: all 0.2s;
    border: 1px solid var(--highlight-color);
    margin-right: 1rem;
}

.component-card:hover .card-icon {
    background: var(--card-bg);
    border-color: var(--highlight-color);
    color: var(--highlight-color);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    stroke: var(--highlight-color);
}

.component-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: color 0.2s;
}

.component-card:hover h3 {
    color: var(--highlight-color);
}

.component-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.main-nav a.active {
    color: var(--highlight-color);
}

/* Documentation Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.docs-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--highlight-color);
}

.component-nav h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.component-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.component-nav li {
    margin-bottom: 0.25rem;
}

.component-nav a {
    display: block;
    color: #64748b;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.component-nav a:hover {
    background-color: #f1f5f9;
    color: var(--highlight-color);
}

.component-nav a.active {
    background-color: var(--highlight-color);
    color: white;
}

/* Docs Content moved to styles.css */

.docs-content__header {
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
}

.docs-content__header h1 {
    font-size: 3rem;
    margin-bottom: 16px;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-section {
    margin-bottom: 60px;
}

.demo-section h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.demo-section p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.preview-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 20px 20px;
}

.code-block {
    background: #111;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--border-color);
    border-top: none;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e6e6e6;
}

@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .docs-sidebar {
        position: static;
        order: 2;
    }
}

/* In-page Navigation Layout */
.container {
    /* display: flex; */
    /* flex-direction: row; */
    width: 100%;
}

.content {
    flex: 1 1 0;
    min-width: 0;
}

ui-portal-inpage-nav {
    width: 180px;
    flex: 0 0 180px;
}

/* Component Detail Header */
.docs-content__header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    margin-top: 5rem;
}

.docs-content__header .card-icon {
    width: 48px;
    height: 48px;
    background: var(--highlight-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
}

.docs-content__header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    /* color: #1e293b; */
    margin: 0 0 1rem;
}

.docs-content__content > p:first-of-type,
.docs-content__content > load-demo > p:first-of-type,
.docs-content__content .lead {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    margin-bottom: 5rem;
    border-top: 1px solid var(--text-secondary);
    padding-top: 2rem;
}

.docs-content__content {
    max-width: none;
}

/* Demo sections */
.docs-content__content .demo-section {
    margin-bottom: 3rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.docs-content__content .preview-box {
    padding: 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.docs-content__content .code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    overflow-x: auto;
}

.docs-content__content .code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .docs-content__content h1 {
        font-size: 2rem;
    }
}

mdjs-preview > pre.astro-code {
    visibility: hidden;
}

mdjs-preview:defined > pre.astro-code {
    visibility: visible;
}