/* ============================================================
   Shaarli Table View Plugin — Styles
   NocoDB / Baserow inspired spreadsheet look
   ============================================================ */

/* ----------------------------------------------------------
   View toggle toolbar
   ---------------------------------------------------------- */
.shaarli-table-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0 14px;
    margin-bottom: 4px;
}

.st-view-label {
    font-size: 12.5px;
    color: #888;
    margin-right: 2px;
}

.st-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none !important;
    color: #555;
    border: 1px solid #d8d8d8;
    background: #fff;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    user-select: none;
}

.st-view-btn:hover {
    background: #f4f4f7;
    border-color: #aaa;
    color: #222;
    text-decoration: none !important;
}

.st-view-btn.active {
    background: #4361ee;
    color: #fff !important;
    border-color: #4361ee;
    font-weight: 600;
    pointer-events: none;
}

.st-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    border: 1px solid #d8d8d8;
    background: #fff;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    user-select: none;
    margin-left: 10px;
    font-family: inherit;
}

.st-copy-btn:hover {
    background: #f4f4f7;
    border-color: #aaa;
    color: #222;
}

.st-copy-btn.copied {
    background: #e8f5e9;
    border-color: #66bb6a;
    color: #2e7d32;
}

/* ----------------------------------------------------------
   Outer wrapper
   ---------------------------------------------------------- */
.st-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    color: #1a1a1a;
    margin-bottom: 48px;
}

/* ----------------------------------------------------------
   Controls bar (search + count)
   ---------------------------------------------------------- */
.st-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

#st-search {
    padding: 7px 12px;
    border: 1px solid #d2d2d2;
    border-radius: 7px;
    font-size: 13px;
    width: 280px;
    outline: none;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    color: #222;
}

#st-search:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.13);
}

#st-tag-filter {
    padding: 7px 12px;
    border: 1px solid #d2d2d2;
    border-radius: 7px;
    font-size: 13px;
    width: 200px;
    outline: none;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    color: #222;
}

#st-tag-filter:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.13);
}

.st-count {
    font-size: 12px;
    color: #999;
}

/* ----------------------------------------------------------
   Scrollable table container
   ---------------------------------------------------------- */
.st-scroll {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 9px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ----------------------------------------------------------
   Table base
   ---------------------------------------------------------- */
.st-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: auto;
}

/* ----------------------------------------------------------
   Header
   ---------------------------------------------------------- */
.st-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.st-table thead tr {
    background: #f6f7fb;
    border-bottom: 2px solid #e0e0e0;
}

.st-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    color: #666;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-right: 1px solid #e8e8e8;
    user-select: none;
    -webkit-user-select: none;
}

.st-table th:last-child {
    border-right: none;
}

.st-table th.sortable {
    cursor: pointer;
}

.st-table th.sortable:hover {
    background: #eceef6;
}

/* Sort indicators */
.sort-icon {
    display: inline-block;
    font-size: 10px;
    color: #ccc;
    margin-left: 3px;
    vertical-align: middle;
    font-style: normal;
}

.st-table th:not(.sort-asc):not(.sort-desc) .sort-icon::after { content: '⇅'; }
.st-table th.sort-asc  .sort-icon::after { content: '▲'; color: #4361ee; }
.st-table th.sort-desc .sort-icon::after { content: '▼'; color: #4361ee; }

/* ----------------------------------------------------------
   Body rows
   ---------------------------------------------------------- */
.st-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.st-table tbody tr:last-child {
    border-bottom: none;
}

.st-table tbody tr.st-row:hover {
    background: #f0f4ff;
}

.st-table tbody tr.st-private {
    background: #fffdf4;
}

.st-table tbody tr.st-private:hover {
    background: #fff8e0;
}

/* Hidden (filtered out) */
.st-table tbody tr.st-hidden {
    display: none;
}

/* ----------------------------------------------------------
   Cells
   ---------------------------------------------------------- */
.st-table td {
    padding: 9px 14px;
    vertical-align: middle;
    border-right: 1px solid #f0f0f0;
    line-height: 1.45;
}

.st-table td:last-child {
    border-right: none;
}

/* ----------------------------------------------------------
   Column sizing
   ---------------------------------------------------------- */
.col-num {
    width: 40px;
    text-align: center;
    color: #c0c0c0;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.col-title {
    min-width: 200px;
    max-width: 340px;
}

.col-url {
    min-width: 150px;
    max-width: 260px;
}

.col-tags {
    min-width: 110px;
    max-width: 240px;
}

.col-desc {
    min-width: 160px;
    max-width: 360px;
    color: #555;
    font-size: 12.5px;
}

.col-date {
    width: 98px;
    white-space: nowrap;
    color: #888;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.col-priv {
    width: 48px;
    text-align: center;
}

.col-actions {
    width: 72px;
    text-align: center;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   Title link
   ---------------------------------------------------------- */
.col-title a {
    color: #1a1a1a;
    font-weight: 500;
    text-decoration: none;
}

.col-title a:hover {
    color: #4361ee;
    text-decoration: underline;
}

/* ----------------------------------------------------------
   URL link
   ---------------------------------------------------------- */
.col-url a {
    color: #4361ee;
    text-decoration: none;
    font-size: 12px;
    word-break: break-all;
}

.col-url a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   Tag pills
   ---------------------------------------------------------- */
.st-tag {
    display: inline-block;
    padding: 2px 9px;
    background: #eef0ff;
    color: #4361ee;
    border-radius: 99px;
    font-size: 11.5px;
    text-decoration: none !important;
    margin: 2px 2px 2px 0;
    transition: background 0.13s, color 0.13s;
    white-space: nowrap;
}

.st-tag:hover {
    background: #dde1ff;
    color: #2c4bd6;
    text-decoration: none !important;
}

/* ----------------------------------------------------------
   Misc
   ---------------------------------------------------------- */
.st-empty {
    color: #d0d0d0;
}

.st-priv-badge {
    font-size: 14px;
}

/* Action icon buttons */
.st-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    text-decoration: none !important;
    color: #777;
    font-size: 14px;
    transition: background 0.13s, color 0.13s;
    vertical-align: middle;
}

.st-act:hover {
    background: #e8edff;
    color: #4361ee;
    text-decoration: none !important;
}

.st-act.st-del:hover {
    background: #ffe8e8;
    color: #d63030;
}

/* ----------------------------------------------------------
   Responsive: hide verbose columns on narrow screens
   ---------------------------------------------------------- */
@media (max-width: 860px) {
    .col-desc {
        display: none;
    }
}

@media (max-width: 600px) {
    .col-url {
        display: none;
    }

    #st-search {
        width: 100%;
    }

    .st-controls {
        flex-wrap: wrap;
    }
}
