/* Inputvelden voor link & shortcode */
.bb-ucweb-link {
    color: #E53935;
    font-weight: 600;
    text-decoration: none;
}

.bb-ucweb-link:hover {
    text-decoration: underline;
}

.bb-copy-click {
    min-width: 50px;
    white-space: nowrap;
    overflow-x: auto;
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
}

.bb-copy-click:focus {
    border-color: #31b16b;
    box-shadow: 0 0 0 2px #dbf9e8;
}

@media (max-width: 600px) {
    .bb-copy-click {
        width: 100%;
    }
}

/* Lange bestandsnamen met horizontale scroll */
.bb-scroll-name {
    max-width: 100%;
    min-width: 300px;
    overflow-x: auto;
    white-space: nowrap;
    padding-right: 10px;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.bb-scroll-name::-webkit-scrollbar {
    height: 6px;
}

.bb-scroll-name::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .bb-scroll-name {
        max-width: 100%;
        min-width: 220px;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Kolom: Bestandsnaam */
@media screen and (min-width: 601px) {
    #bb-files table th:nth-child(2),
    #bb-files table td:nth-child(2) {
        max-width: 100%;
        min-width: 300px;
        overflow: hidden;
        white-space: nowrap;
    }
}

/* --------- BASISKNOPPEN --------- */
.button,
.bb-upload-btn,
.bb-download-btn,
.bb-preview {
    font-size: 13px;
    border-radius: 2em;
    cursor: pointer;
    text-align: center;
    transition: box-shadow 0.18s, filter 0.18s, transform 0.18s, background 0.17s, color 0.18s;
    outline: none;
}

.button:focus-visible,
.bb-upload-btn:focus-visible,
.bb-download-btn:focus-visible,
.bb-preview:focus-visible {
    outline: 3px solid #31b16b;
    outline-offset: 2px;
    filter: brightness(1.10);
}

/* Standaard knoppen */
.button {
    padding: 0.6em 1.5em;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-weight: 500;
    margin-left: 5px;
    box-shadow: 0 1px 6px rgba(91, 64, 0, .05);
}

.button:hover {
    filter: brightness(1.08) saturate(1.12);
    box-shadow: 0 4px 18px rgba(90, 64, 0, 0.10);
    transform: translateY(-2px) scale(1.03);
}

.button-primary {
    background: linear-gradient(90deg, #1662dd 0%, #31b16b 100%);
    color: #fff;
    border: none;
}

.button-primary:hover {
    background: linear-gradient(90deg, #31b16b 0%, #1662dd 100%);
}

.button-secondary {
    background: #f6f7f7;
    color: #23282d;
    border: 1px solid #dcdcde;
}

.button-secondary:hover {
    background: #efefef;
}

.button-danger {
    background-color: #d63638 !important;
    border-color: #b32d2e !important;
    color: #fff !important;
}

.button-danger:hover {
    background-color: #a22728 !important;
    border-color: #861f20 !important;
}

/* Preview knop */
.bb-preview {
    background: linear-gradient(90deg, #1662dd 0%, #31b16b 100%) !important;
    color: #fff !important;
    font-weight: bold;
    border: none !important;
    border-radius: 2em;
    box-shadow: 0 2px 8px rgba(49, 177, 107, 0.13);
    padding: 0.7em 1.5em;
    font-size: 1.05em;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0 8px 0 0;
    gap: 7px;
}

.bb-preview:hover,
.bb-preview:focus {
    background: linear-gradient(90deg, #31b16b 0%, #1662dd 100%) !important;
    color: #fff !important;
    filter: brightness(1.08) saturate(1.13);
}

.bb-preview svg {
    margin-right: 5px;
    vertical-align: middle;
    height: 1.2em;
    width: 1.2em;
    fill: #fff;
    flex-shrink: 0;
}

/* === Vierkante actieknoppen met icoon === */
.button-copy {
    background: #f3f3f3;
    border: 1px solid #ccc;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 1.1em;
    line-height: 1;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, transform 0.2s;
}

.button-copy:hover {
    background: #e6e6e6;
    transform: scale(1.05);
}

/* Tooltip bij hover */
.button-copy[title]:hover::after,
.bb-download-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    background: #333;
    color: #fff;
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 4px;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 99;
    opacity: 0.95;
}

/* Input visuele feedback bij kopieeractie */
input.bb-copy-click.copied {
    border-color: #31b16b !important;
    box-shadow: 0 0 0 3px #dbf9e8;
    transition: border 0.2s, box-shadow 0.2s;
}

input[type="text"].copied {
    border-color: #31b16b !important;
    box-shadow: 0 0 0 3px #dbf9e8;
    transition: border 0.18s, box-shadow 0.18s;
}

/* --------- INPUTS & SEARCH/FILTER --------- */
input[type="text"][readonly],
#bb-search {
    background: #fffef9;
    border: 1px solid #c1b088;
    padding: 4px 10px;
    font-size: 1em;
    border-radius: 6px;
    color: #333;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 1px 2px #eee;
    transition: border 0.15s, box-shadow 0.15s;
}

#bb-search:focus {
    border-color: #dd9933;
    outline: none;
    box-shadow: 0 2px 8px #ffeec2;
}

#bb-ext-filter {
    padding: 0.6em 1.2em;
    border-radius: 6px;
    border: 1px solid #c1b088;
    font-size: 1em;
    background: #fff;
    color: #333;
    margin-right: 6px;
    min-width: 140px;
    transition: border 0.15s;
}

#bb-ext-filter:focus {
    border-color: #31b16b;
}

/* Flex-row blok met schaduw en achtergrond */
.bb-filter-row {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 12px rgba(221, 153, 51, 0.09);
    padding: 1em;
    margin-bottom: 1.5em;
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 600px) {
    .bb-filter-row {
        flex-direction: column;
        gap: 0.7em;
        padding: 1em 0.5em;
    }
}

/* --------- FILE UPLOAD STIJL --------- */
.bb-file-upload {
    display: inline-block;
    cursor: pointer;
    margin-bottom: 1em;
    background: #fffef9;
    border: 2px dashed #31b16b;
    border-radius: 9px;
    padding: 0.5em 1.4em;
    transition: border 0.25s, background 0.25s;
}

.bb-file-upload.dragover {
    border-color: #1662dd !important;
    background: #e3f0fd;
    color: #1662dd;
}

.bb-file-upload:focus-within {
    border-color: #31b16b;
    background: #f4fff6;
}

.bb-file-upload:hover {
    background: #f6fff5;
    border-color: #1662dd;
}

.bb-file-upload input[type="file"] {
    display: none;
}

.bb-file-upload input[type="file"]:focus + .bb-upload-btn {
    outline: 2px solid #31b16b;
    outline-offset: 2px;
}

/* Upload knop */
.bb-upload-btn {
    color: #fff;
    font-weight: bold;
    padding: 0.7em 1.6em;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 1em;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 6px rgba(91, 64, 0, .07);
    user-select: none;
    height: 46px;
}

.bb-btn-blue {
    background: #1662dd;
}

.bb-btn-blue:hover {
    background: #104baa;
}

.bb-btn-green {
    background: #31b16b;
}

.bb-btn-green:hover {
    background: #258c53;
}

.bb-upload-btn svg {
    transition: transform 0.18s cubic-bezier(.5, 2, .7, 1);
}

.bb-upload-btn:hover svg {
    transform: scale(1.16) rotate(-12deg);
}

/* --------- TABELLEN & PAGINERING --------- */
#bb-files table {
    border-collapse: separate;
    border-spacing: 0 0.5em;
    background: #fffbe7;
    width: 100%;
    font-size: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 16px #ffeec2;
}

#bb-files table th {
    font-weight: 600;
    color: #5b4000;
    background: #fffbf2;
    border-bottom: 2px solid #ffeec2;
    padding: 8px 14px;
    border-radius: 6px 6px 0 0;
}

#bb-files table td {
    padding: 7px 12px;
    border-bottom: 1px solid #f3ead0;
    background: #fff;
}

@media screen and (min-width: 769px) {
    #bb-files table td::before {
        display: none;
    }
}

/* === Flexweergave voor rijen in de tabel === */
.flex-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.bb-pagination {
    margin-top: 1.2em;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
}

.bb-pagination a {
    padding: 5px 10px;
    background: #f1f1f1;
    margin: 2px;
    display: inline-block;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.13s, color 0.13s;
}

.bb-pagination a:hover,
.bb-pagination a:focus {
    background: #e2e2e2;
    color: #dd9933;
}

/* Kolombreedtes */
#bb-files table th:nth-child(2),
#bb-files table td:nth-child(2) {
    width: 100px;
    white-space: nowrap;
}

#bb-files table th:nth-child(3),
#bb-files table td:nth-child(3) {
    width: 130px;
    white-space: nowrap;
}

#bb-files table th:nth-child(4),
#bb-files table td:nth-child(4),
#bb-files table th:nth-child(5),
#bb-files table td:nth-child(5) {
    width: 280px;
}

/* --------- GROTE DOWNLOAD KNOP --------- */
.bb-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 18px 40px;
    min-height: 60px;

    background: linear-gradient(90deg, #5b4000 0%, #dd9933 100%);
    color: #fff !important;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;

    border: none;
    border-radius: 50px;

    text-decoration: none !important;
    box-shadow: 0 4px 16px rgba(91, 64, 0, 0.15);

    cursor: pointer;
    position: relative;
    margin: 1em 0 0.3em 0;

    transition: background 0.2s, transform 0.15s, box-shadow 0.2s, filter 0.18s;
}

.bb-download-btn:hover,
.bb-download-btn:focus {
    background: linear-gradient(90deg, #dd9933 0%, #5b4000 100%);
    color: #fff !important;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 22px rgba(221, 153, 51, 0.22);
    text-decoration: none !important;
    filter: brightness(1.04);
}

.bb-download-btn svg {
    width: 30px;
    height: 30px;
    margin-right: 0 !important;
    flex-shrink: 0;
}

/* Downloadknop in admin-tabellen compacter houden */
#bb-files .bb-download-btn {
    padding: 7px 10px;
    min-height: auto;
    font-size: 1.1em;
    border-radius: 6px;
    gap: 0;
    margin: 0;
    box-shadow: none;
}

/* --------- NOTICE STIJL --------- */
.notice-success {
    background: #f8fff5 !important;
    border-left: 4px solid #31b16b !important;
    color: #297342 !important;
}

.notice-error {
    background: #fff4f4 !important;
    border-left: 4px solid #d63638 !important;
    color: #9b2323 !important;
}

/* Alleen op jouw pluginpagina toepassen */
body.toplevel_page_beveiligde-bestanden .wrap {
    background: #fffbe7;
    border-radius: 12px;
    padding: 2em;
    margin-top: 1.4em;
    box-shadow: 0 4px 22px rgba(221, 153, 51, 0.09);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.bb-upload-status {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.bb-upload-filename {
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
    word-break: break-word;
}

.bb-upload-progress {
    width: 100%;
    height: 16px;
    background: #e9edf3;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}

.bb-upload-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #1662dd 0%, #31b16b 100%);
    transition: width 0.2s ease;
}

.bb-upload-percent {
    margin-top: 6px;
    font-size: 14px;
    color: #333;
}

/* --------- MOBIELE LAYOUT --------- */
@media screen and (max-width: 768px) {
    .bb-filter-row {
        flex-direction: column;
        gap: 0.7em;
        padding: 1em 0.7em;
    }

    #bb-search,
    #bb-ext-filter,
    #bb-reset {
        margin-bottom: 0.8em;
        width: 100%;
        min-width: 0;
    }

    .bb-file-upload,
    .bb-upload-btn {
        width: 100%;
        justify-content: center;
        min-width: 0;
        margin-bottom: 1em;
    }

    #bb-files table thead {
        display: none;
    }

    #bb-files table,
    #bb-files table tbody,
    #bb-files table tr,
    #bb-files table td {
        display: block;
        width: 100%;
    }

    #bb-files table tr {
        margin-bottom: 1em;
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 10px;
        background: #fff;
    }

    #bb-files table td {
        padding: 6px 10px;
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
    }

    #bb-files table td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 2px;
        color: #555;
    }

    .flex-cell {
        flex-wrap: wrap;
    }

    .bb-pagination {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .bb-download-btn {
        width: 100%;
        max-width: 420px;
        padding: 16px 24px;
        font-size: 20px;
    }
}

.bb-text-preview {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    max-height: 70vh;
    overflow: auto;
    background: #fffef9;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    margin: 0 auto 1em auto;
    color: #222;
    font-size: 14px;
    line-height: 1.6;
    font-family: Consolas, Monaco, 'Courier New', monospace;
}