/* ── Collections: Page Layout ── */
.collections-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.collections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.collections-header h1 {
    margin: 0;
    font-family: var(--heading-font);
    color: var(--text-color);
}

/* ── Empty state ── */
.page-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.page-empty-state p {
    margin: 0 0 1rem;
    font-size: 1rem;
}

/* ── Collection create / edit forms ── */
.create-collection-form,
.collection-edit-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.collection-form-actions {
    display: flex;
    gap: 0.75rem;
}

.collection-form-error {
    color: var(--color-danger, #dc3545);
    font-size: 0.875rem;
    margin: 0;
}

/* ── Collection detail: header ── */
.collection-detail {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.collection-header {
    margin-bottom: 1.5rem;
}

.collection-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.collection-title-row h1 {
    margin: 0;
    font-family: var(--heading-font);
    color: var(--text-color);
}

.collection-badges {
    display: flex;
    gap: 0.4rem;
}

.collection-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.collection-entries-section h2 {
    font-family: var(--heading-font);
    color: var(--text-color);
    margin: 0 0 1rem;
    font-size: 1.15rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

/* ── Add-to-Collection modal ── */
.collection-modal {
    max-width: 420px;
    width: 90%;
}

.collection-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.collection-modal-header h4 {
    margin: 0;
    font-family: var(--heading-font);
    color: var(--text-color);
    font-size: 1.1rem;
}

.collection-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.25rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.collection-modal-close:hover {
    color: var(--text-color);
    background: var(--editor-highlight-bg);
}

/* ── Modal: collection option list ── */
.collection-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    max-height: 280px;
    overflow-y: auto;
}

.collection-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--card-bg);
    transition: background 0.15s;
}

.collection-option:hover {
    background: var(--editor-highlight-bg);
}

.collection-option--active {
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 10%, var(--card-bg));
}

.collection-option-name {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-color);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Modal: new collection inline form ── */
.collection-new-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--editor-highlight-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    margin-top: 0.5rem;
}

.collection-new-btn {
    width: 100%;
    margin-top: 0.25rem;
}
