/* 10-tabel-toast.css - Excel-tabel, import/export, toasts, privacyvakje en laadiconen
   Onderdeel van de AperioLibrum-stylesheet. Alle 13 bestanden laden in deze
   volgorde via templates/_stylesheets.html: de volgorde is de cascade, dus niet
   herschikken en geen bestand hernoemen zonder de linktemplate mee te nemen. */
/* ── Excel-like table ── */
.excel-wrap {
    overflow-x: auto;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.excel-table th {
    background: var(--table-header-bg);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.excel-table td {
    padding: 0;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.cell-editable {
    cursor: text;
    padding: 10px 14px;
    min-height: 40px;
    transition: background 0.1s;
}

.cell-editable:hover {
    background: var(--dropdown-hover);
}

.cell-input {
    width: 100%;
    border: 2px solid var(--primary);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--input-bg);
    color: var(--text-main);
}

.cell-select select {
    width: 100%;
    border: 2px solid var(--primary);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--input-bg);
    color: var(--text-main);
}

.cell-code {
    padding: 10px 14px;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 13px;
}

.cell-actions {
    padding: 8px 14px;
    white-space: nowrap;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.cell-actions button {
    padding: 6px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.2;
    height: 30px;
    white-space: nowrap;
}

.cell-actions .icon-btn {
    width: 30px;
    padding: 0;
}

tr.dirty td {
    background: var(--dirty-bg);
}

tr.dirty td.cell-editable:hover {
    background: var(--dirty-hover);
}

tr.new-row td {
    background: var(--new-bg);
}

.row-save, .row-create {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.row-cancel {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
}

.row-delete {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* ── Import section (settings page) ── */
.import-section {
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 0 12px 12px 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.import-samples {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.import-sample-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.import-sample-btn {
    padding: 5px 12px;
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}

.import-sample-btn:hover {
    background: var(--dropdown-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.import-options {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--tab-bg);
    border-radius: 8px;
}

.import-options label {
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.import-file-name {
    font-size: 13px;
    color: var(--text-muted);
    align-self: center;
}

/* ── Export options ── */
.export-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 6px 0 12px;
}

.export-columns label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.export-columns input[type="checkbox"] {
    accent-color: var(--primary);
}

/* ── Toast notifications ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease forwards;
    animation-delay: 0s, 3.7s;
}

.toast.success { background: #27ae60; }
.toast.error { background: #d9534f; }
.toast.info { background: var(--primary); }
.toast.warning { background: #e67e22; }

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    border-radius: 0;
}

.toast-close:hover {
    color: #fff;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }

    .boost-toast {
        min-width: 0;
        max-width: 100%;
    }
}

/* ── Privacy acceptance checkbox ── */
.accept-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 16px 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
}

.accept-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    padding: 0;
    accent-color: var(--primary);
}

.accept-row a {
    color: var(--primary);
    font-weight: 600;
}

/* ── Laad-iconen op formulierknoppen ─────────────────────────── */
.btn-loading {
    opacity: 0.75;
    cursor: progress !important;
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    margin-right: 8px;
    animation: aperio-spin 0.7s linear infinite;
}

@keyframes aperio-spin {
    to { transform: rotate(360deg); }
}

/* <input type="submit"> kan geen kind-elementen hebben: draaiende SVG als achtergrond */
input.btn-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23888' stroke-width='3' stroke-linecap='round' stroke-dasharray='42' stroke-dashoffset='14'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.7s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px 15px;
    padding-right: 34px;
}

/* ── Detailpagina-cover ── */
.book-cover {
    max-width: 150px;
    border-radius: 8px;
    border: 1px solid var(--line);
    margin-bottom: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

