/* Shared styles used by DevHabit.RazorLib components (Sidebar, ContributionGrid, …). */

/* Sidebar */
.sidebar {
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    width: 0;
    overflow: hidden;
    transition: width 0.3s;
    z-index: 1040;
}

.sidebar.open {
    width: 250px;
}

.sidebar-overlay {
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1030;
}

.main-content {
    margin-left: 0;
    transition: margin-left 0.3s;
}

/* Contribution grid */
.contribution-grid-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.contribution-grid {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    grid-auto-flow: column;
    gap: 4px;
    justify-content: center;
    min-width: max-content;
}

.contribution-cell {
    width: 28px;
    height: 28px;
    cursor: pointer;
}

/* Desktop: sidebar pushes content */
@media (min-width: 768px) {
    .main-content.sidebar-open {
        margin-left: 250px;
    }

    .contribution-grid {
        gap: 6px;
    }

    .contribution-cell {
        width: 36px;
        height: 36px;
    }
}

/* Touch-friendly targets on mobile */
@media (max-width: 767.98px) {
    .nav-link {
        padding: 0.75rem 1rem;
    }

    .form-select-sm {
        min-height: 38px;
    }

    .btn-sm {
        min-height: 38px;
        min-width: 38px;
        padding: 0.4rem 0.65rem;
    }

    .card-body {
        padding: 0.875rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .table th,
    .table td {
        font-size: 0.85rem;
        padding: 0.5rem 0.4rem;
    }
}
