/* public/assets/css/components/bookmarks-view.css */

/* --- HEADER WITH LIGHT BLUR --- */
.bookmarks-view .section-header {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

.bookmarks-view .section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
}


/* --- MODIFICATION START: Key changes for scrollable body --- */
.table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    /* Set a max-height. The table body will scroll within this height. */
    /* Adjust this value based on your screen design */
    max-height: calc(100vh - 250px); 
    overflow-y: auto; /* Make the wrapper scrollable */
}
/* --- MODIFICATION END --- */

/* --- TABLE --- */
.bookmarks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bookmarks-table th,
.bookmarks-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.bookmarks-table td:first-child,
.bookmarks-table th:first-child {
    border-left: none;
}


/* --- MODIFICATION START: Make the header sticky --- */
.bookmarks-table thead {
    position: sticky;
    top: 0;
    z-index: 2; /* Ensure header is above the body content */
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}
/* --- MODIFICATION END --- */

.bookmarks-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* --- BODY ROWS --- */
.bookmarks-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

/* --- COLUMN SIZES --- */
.col-num {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}
.col-category {
    width: 120px;
    white-space: nowrap;
}
.col-quiz {
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.col-question {
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
}
.col-action {
    width: 90px;
    text-align: center;
}

/* --- ACTION BUTTON --- */
.bookmarks-table .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: color-mix(in srgb, var(--primary) 85%, black);
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}
.empty-state .feather {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    stroke-width: 1.5;
}
.empty-state p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.empty-state span {
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

/* --- PAGINATION --- */
.pagination {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}
.pagination .page-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pagination .page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .bookmarks-table {
        font-size: 0.8rem;
    }
    .bookmarks-table th,
    .bookmarks-table td {
        padding: 0.4rem 0.5rem;
    }
    .col-quiz,
    .col-question {
        white-space: normal;
    }
}

/* --- CATEGORY NAV BAR --- */
.bookmark-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bookmark-nav .nav-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookmark-nav .nav-btn:hover {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border-color: var(--primary);
    color: var(--primary);
}

.bookmark-nav .nav-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}