/* Adjustments for existing CSS inputs/cards to fit new layout */
.wrap {
    max-width: 1000px;
    margin: 0;
    /* Limit width inside the main panel */
}

/* --- Projects List Customization --- */
.projects-list li.local .link-text {
    color: var(--meta);
}

.projects-list li {
    display: flex;
    /* Use flexbox for the list item itself */
    justify-content: flex-start;
    align-items: center;
    padding-right: 2px;
    /* Space on right */
}

.projects-list li:hover:not(.active) {
    background-color: var(--hover-bg);
}

.project-content {
    display: flex;
    align-items: center;
    flex: 1;
    /* Take remaining space */
    min-width: 0;
    /* Allow shrinking/truncation */
    overflow: hidden;
    height: 100%;
}

/* Collapsed State: Center the project icon */
.sidebar:not(.expanded) .projects-list li {
    justify-content: center;
    /* Center the content */
    padding: 0;
    /* Remove padding */
    width: 40px;
    /* Fixed width */
    margin: 0 auto 4px auto;
    /* Center horizontally */
}

.sidebar:not(.expanded) .project-content {
    justify-content: center;
    /* Center icon inside wrapper */
    flex: 0 0 auto;
    /* Don't stretch */
    width: 100%;
}

.sidebar:not(.expanded) .project-content .link-text {
    display: none;
    /* Already hidden by general rule, but ensuring */
}

.sidebar:not(.expanded) .projects-separator {
    display: none;
}

.project-menu-btn {
    background: none;
    border: none;
    cursor: pointer;

    /* Strict dimensions for circle */
    width: 28px;
    height: 28px;
    min-width: 28px;
    /* Prevent crushing */
    padding: 0;

    border-radius: 50%;
    color: var(--text-color);

    display: none;
    align-items: center;
    justify-content: center;

    margin-left: auto;
    margin-right: -2px;
    flex-shrink: 0;
    /* Don't shrink */

    transition: background-color 0.2s, color 0.2s;
}

.project-menu-btn:hover {
    background-color: #cfd6e0;
    color: var(--color-slate-900);
}

/* Reset margin on the icon inside the delete button 
   otherwise .nav-links li .material-symbols-outlined adds 16px margin-right
   causing the button to be wide/oval.
*/
.project-menu-btn .material-symbols-outlined {
    margin-right: 0 !important;
    font-size: 18px !important;
}

/* Show button on hover */
.projects-list li:hover .project-menu-btn,
.projects-list li:focus-within .project-menu-btn {
    display: flex;
}

/* Keep action button available on mobile where no hover exists */
body.mobile .projects-list .project-menu-btn {
    display: flex;
}

/* Hide action button in collapsed sidebar */
.sidebar:not(.expanded) .project-menu-btn {
    display: none !important;
}

.project-action-menu {
    position: fixed;
    min-width: 148px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    padding: 6px;
    z-index: 12000;
}

.project-action-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 10px 10px;
    color: var(--color-slate-900);
    font-size: 0.9rem;
    cursor: pointer;
}

.project-action-item .material-symbols-outlined {
    margin-right: 0 !important;
    font-size: 18px !important;
}

.project-action-item:hover {
    background: #f3f4f6;
    color: var(--color-slate-900);
}

.project-action-sheet-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    background: rgba(15, 23, 42, 0);
    transition: background-color 160ms ease;
    z-index: 13000;
}

.project-action-sheet-backdrop.open {
    background: rgba(15, 23, 42, 0.35);
}

.sidebar-live-indicator {
    display: none;
}

.mobile-editor-actions {
    display: none;
    position: relative;
    margin-left: auto;
}

#mobile-editor-menu-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

#mobile-editor-menu-btn .material-symbols-outlined {
    font-size: 20px;
}

.mobile-editor-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 188px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    flex-direction: column;
    z-index: 12060;
}

.mobile-editor-menu.show-menu {
    display: flex;
}

.mobile-editor-menu-item {
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-slate-900);
    font-size: 0.9rem;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
}

.mobile-editor-menu-item:hover {
    background: #f3f4f6;
}

@media (max-width: 600px) {
    .sidebar:not(.expanded) .sidebar-header .sidebar-brand {
        order: 1;
        margin-left: 8px;
        margin-right: auto;
    }

    .sidebar:not(.expanded) .mobile-editor-actions {
        display: inline-flex;
        align-items: center;
        order: 2;
        margin-left: 0;
        margin-right: 0;
    }

    .sidebar:not(.expanded) .sidebar-live-indicator.recording {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 3;
        margin-left: auto;
        margin-right: 0;
        color: #dc2626;
        font-size: 20px;
        line-height: 1;
        pointer-events: none;
    }
}

.project-action-sheet {
    width: 100%;
    background: var(--bg);
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--border);
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 160ms ease;
}

.project-action-sheet.open {
    transform: translateY(0);
}

.project-action-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--color-slate-300);
    margin: 0 auto 10px;
}

@media (min-width: 601px) {
    .project-action-sheet-backdrop {
        display: none !important;
    }
}

/* Screen reader only utility class for SEO and web accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
