/* ============================================================
   Links Manager — frontend grid
   ============================================================ */

.linksmanager-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 0;
}

.linksmanager-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* ── Responsive breakpoints ────────────────────────────────────────────── */
@media (max-width: 767px) {
    .linksmanager-column {
        flex: 0 0 calc(50% - 8px);
    }
}
@media (max-width: 479px) {
    .linksmanager-column {
        flex: 0 0 100%;
    }
}

.linksmanager-category {
    background: #f6f6f2;
    border: 1px solid #000;
    border-radius: 7px;
    overflow: hidden;
}

.linksmanager-category-header {
    background-size: cover;
    background-position: left center;
    color: #fff;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'FrancoisOne', Arial, sans-serif;
    font-size: 0.78rem;
    line-height: 1.2;
    text-align: center;
    border-radius: 5px 5px 0 0;
    text-shadow: 0 1px 0 #fff;
    min-height: 26px;
}

.category-title {
    flex: 1;
}

.linksmanager-links {
    padding: 5px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.linksmanager-links a {
    display: block;
    color: #000000;
    text-decoration: none;
    border-bottom: none;
    font-size: 0.75rem;
    line-height: 1.35;
    margin-left: 4px;
}

.linksmanager-links a:hover {
    color: #000000;
    text-decoration: none;
    border-bottom: none;
}

.lm-btn-toggle-edit {
    background: #555;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    flex: 0 0 auto;
}

.lm-btn-toggle-edit:hover { background: #333; }

.lm-btn-toggle-edit.lm-edit-active {
    background: #c06000;
}

.lm-btn-toggle-edit.lm-edit-active:hover { background: #a05000; }

/* ============================================================
   Admin mode
   ============================================================ */

.lm-admin-controls {
    display: none;
    gap: 4px;
    align-items: center;
    margin-left: auto;
}

.lm-edit-mode .lm-admin-controls {
    display: flex;
}

.lm-drag-handle {
    cursor: grab;
    font-size: 1.1rem;
    color: #aaa;
    user-select: none;
    padding: 0 2px;
}

.lm-drag-handle:active {
    cursor: grabbing;
}

.lm-btn-edit,
.lm-btn-delete {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.lm-btn-edit:hover  { opacity: 1; background: rgba(255,255,255,0.2); }
.lm-btn-delete:hover { opacity: 1; background: rgba(200,50,50,0.5); }

.lm-admin-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.lm-btn-add-category,
.lm-btn-add-column {
    display: none;
}

.lm-edit-mode .lm-btn-add-category,
.lm-edit-mode .lm-btn-add-column {
    display: block;
}

.lm-btn-add-category,
.lm-btn-add-column {
    padding: 6px;
    background: #f0f0f0;
    border: 1px dashed #aaa;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.lm-btn-add-category:hover,
.lm-btn-add-column:hover {
    background: #e0e0e0;
}

/* Sortable drag ghost — placeholder op de droppositie */
.sortable-ghost {
    opacity: 0.6;
    outline: 2px dashed #5599ff;
}

/* ============================================================
   Modal
   ============================================================ */

.lm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
}

.lm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9001;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.lm-modal-header {
    background: #222;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-radius: 6px 6px 0 0;
}

.lm-modal-header h3 {
    margin: 0;
    flex: 1;
    font-size: 0.85rem;
}

.lm-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.lm-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.lm-modal-footer {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid #eee;
}

.lm-field {
    margin-bottom: 14px;
}

.lm-field label:first-child {
    display: block;
    font-weight: bold;
    font-size: 0.78rem;
    margin-bottom: 4px;
    color: #333;
}

.lm-field input[type="text"] {
    width: 100%;
    padding: 4px 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.78rem;
    box-sizing: border-box;
}

.lm-radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 16px;
    font-size: 0.78rem;
    font-weight: normal;
    cursor: pointer;
}

/* Links lijst in modal */
#lm-links-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.lm-link-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.lm-link-row .lm-link-drag {
    cursor: grab;
    color: #aaa;
    font-size: 1rem;
    user-select: none;
    flex-shrink: 0;
}

.lm-link-row input {
    flex: 1;
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.75rem;
}

.lm-link-row .lm-btn-remove-link {
    background: none;
    border: none;
    color: #c00;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    flex-shrink: 0;
}

.lm-btn-add-link {
    background: none;
    border: 1px dashed #aaa;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #555;
    width: 100%;
}

.lm-btn-add-link:hover { background: #f5f5f5; }

.lm-btn-save,
.lm-btn-save-new {
    background: #222;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
}

.lm-btn-save:hover,
.lm-btn-save-new:hover { background: #444; }

.lm-btn-cancel {
    background: #eee;
    color: #333;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
}

.lm-btn-cancel:hover { background: #ddd; }
