.header-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.search-box {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Two column layout: sidebar + content */
.page-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    position: sticky;
    top: 20px;
    background: transparent;
    border: none;
    padding: 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-nav-header {
    display: none;
}

.sidebar-nav h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 700;
    padding: 0;
}

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

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: block;
    padding: 0.65rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-radius: 4px;
    position: relative;
    line-height: 1.3;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
    transition: height 0.15s ease;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: rgba(74, 158, 255, 0.08);
}

.sidebar-nav a:hover::before {
    height: 70%;
}

.sidebar-nav a.active {
    color: var(--accent-primary);
    background: rgba(74, 158, 255, 0.12);
    font-weight: 600;
}

.sidebar-nav a.active::before {
    height: 100%;
}

.sidebar-nav .shortcut-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
    display: inline-block;
    margin-left: 0.5rem;
    font-weight: 600;
}

.sidebar-nav a.active .shortcut-count {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Main content area */
.shortcuts-container {
    min-width: 0; /* Prevents grid blowout */
}

.shortcut-section {
    margin-bottom: 3rem;
    scroll-margin-top: 20px;
}

.shortcut-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-primary);
}

.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shortcut-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: all 0.2s;
}

.shortcut-card:hover {
    border-color: var(--accent-primary);
    background: rgba(74, 158, 255, 0.05);
    transform: translateX(4px);
}

.shortcut-card.hidden {
    display: none;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    flex-wrap: wrap;
    min-width: 180px;
    flex-shrink: 0;
}

.shortcut-desc {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.shortcut-desc-detail {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.back-link {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.no-results {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 2rem 0;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-results p {
    color: var(--text-secondary);
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 200px 1fr;
        gap: 1.5rem;
    }

    .sidebar-nav {
        padding: 1rem;
    }

    .shortcut-keys {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar-nav {
        position: static;
        max-height: none;
        margin-bottom: 1.5rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.5rem;
    }

    .sidebar-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        cursor: pointer;
        background: transparent;
        border-radius: 6px;
        user-select: none;
    }

    .sidebar-nav-header:hover {
        background: rgba(74, 158, 255, 0.05);
    }

    .sidebar-nav-header h3 {
        margin: 0;
        padding: 0;
        font-size: 0.85rem;
    }

    .sidebar-nav-toggle {
        font-size: 1rem;
        color: var(--accent-primary);
        transition: transform 0.3s;
    }

    .sidebar-nav-toggle.open {
        transform: rotate(180deg);
    }

    .sidebar-nav ul {
        display: none;
        padding: 0.5rem;
    }

    .sidebar-nav ul.open {
        display: block;
    }

    .shortcut-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .shortcut-keys {
        min-width: auto;
    }

    .shortcut-section h2 {
        font-size: 1.3rem;
    }
}
