/* ================================================================
   shortlink.css
   ================================================================ */

/* ── Warning box ──────────────────────────────────────────────── */
.sl-warning-box {
    background: rgba(251, 176, 64, 0.07);
    border: 1px solid var(--tb-amber-border);
    border-radius: var(--tb-radius-lg);
    padding: 18px 20px;
    margin-bottom: 8px;
}

.sl-warning-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--tb-text-sm);
    font-weight: 600;
    color: var(--tb-amber);
    margin-bottom: 12px;
}

.sl-warning-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sl-warning-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: var(--tb-text-sm);
    color: var(--tb-text-muted);
    line-height: 1.55;
}

.sl-warning-list li i {
    color: var(--tb-amber);
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 14px;
}

/* ── Section label ────────────────────────────────────────────── */
.sl-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--tb-text-sm);
    font-weight: 500;
    color: var(--tb-text);
    margin-bottom: 4px;
}

.sl-section-label i {
    color: var(--tb-primary);
}

/* ── Key input row ────────────────────────────────────────────── */
.sl-key-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.sl-key-row .sl-input-wrap {
    flex: 1;
    min-width: 0;
}

.sl-btn-gen {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 13px;
    padding: 8px 14px;
}

/* Input dengan tombol / ikon di dalamnya */
.sl-input-wrap {
    position: relative;
}

.sl-input-wrap .tb-input {
    width: 100%;
    padding-right: 44px;
    text-overflow: ellipsis;
}

.sl-inline-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--tb-radius);
    cursor: pointer;
    color: var(--tb-text-faint);
    transition: color var(--tb-transition), background var(--tb-transition);
}

.sl-inline-btn:hover {
    color: var(--tb-text);
    background: var(--tb-surface-3);
}

.sl-inline-btn.copied {
    color: var(--tb-green);
}

.sl-input-wrap.has-icon .tb-input {
    padding-left: 38px;
    padding-right: 14px;
}

.sl-input-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: var(--tb-text-faint);
    font-size: 14px;
    pointer-events: none;
}

/* Pemisah antar bagian di panel kiri */
.sl-divider {
    height: 1px;
    background: var(--tb-border);
    margin: 22px 0 18px;
}

/* Bar pencarian di panel kanan */
.sl-search {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tb-border);
}

.sl-search .sl-input-wrap {
    flex: 1;
    min-width: 220px;
}

.sl-lookup-alert {
    margin: 12px 20px 0;
}

/* ── Create result box ────────────────────────────────────────── */
.sl-result-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--tb-green-dim);
    border: 1px solid var(--tb-green-border);
    border-radius: var(--tb-radius);
}

.sl-result-label {
    font-size: 11px;
    color: var(--tb-green);
    font-weight: 500;
    margin-bottom: 6px;
}

.sl-result-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sl-result-url {
    font-size: 15px;
    font-weight: 500;
    color: var(--tb-green);
    text-decoration: none;
    word-break: break-all;
    flex: 1;
}

.sl-result-url:hover {
    text-decoration: underline;
}

.sl-copy-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tb-surface-2);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    cursor: pointer;
    color: var(--tb-text-muted);
    flex-shrink: 0;
    transition: color var(--tb-transition), background var(--tb-transition);
}

.sl-copy-btn:hover {
    color: var(--tb-text);
    background: var(--tb-surface-3);
}

.sl-copy-btn.copied {
    color: var(--tb-green);
    border-color: var(--tb-green-border);
}

.sl-result-original {
    font-size: 11px;
    word-break: break-all;
    line-height: 1.4;
}

/* ── Table panel head ─────────────────────────────────────────── */
.sl-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tb-border);
}

.sl-count-badge {
    font-size: 11px;
    font-weight: 500;
    font-family: var(--tb-font-mono);
    padding: 3px 10px;
    background: var(--tb-primary-dim);
    color: var(--tb-primary);
    border-radius: var(--tb-radius-full);
}

/* ── Empty / loading states ───────────────────────────────────── */
.sl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 24px;
    text-align: center;
}

.sl-empty[hidden],
.sl-loading[hidden],
.sl-table-wrap[hidden] {
    display: none;
}

.sl-empty i {
    font-size: 40px;
    color: var(--tb-text-faint);
}

.sl-empty-title {
    font-size: var(--tb-text-base);
    font-weight: 500;
    color: var(--tb-text-muted);
}

.sl-empty-sub {
    font-size: var(--tb-text-sm);
    color: var(--tb-text-faint);
}

.sl-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 24px;
    font-size: var(--tb-text-sm);
    color: var(--tb-text-muted);
}

.sl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--tb-border-hover);
    border-top-color: var(--tb-primary);
    border-radius: 50%;
    animation: sl-spin 0.7s linear infinite;
}

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

/* ── Table ────────────────────────────────────────────────────── */
.sl-table-wrap {
    overflow-x: auto;
}

.sl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tb-text-sm);
}

.sl-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--tb-text-faint);
    text-align: left;
    background: var(--tb-surface-2);
    border-bottom: 1px solid var(--tb-border);
    white-space: nowrap;
}

.sl-table tbody tr {
    border-bottom: 1px solid var(--tb-border);
    transition: background var(--tb-transition);
}

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

.sl-table tbody tr:hover {
    background: var(--tb-surface-2);
}

.sl-table td {
    padding: 12px 16px;
    vertical-align: middle;
    color: var(--tb-text-muted);
}

.sl-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tb-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sl-short-url-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sl-short-url {
    font-size: 12px;
    font-family: var(--tb-font-mono);
    color: var(--tb-primary);
    text-decoration: none;
    white-space: nowrap;
}

.sl-short-url:hover {
    text-decoration: underline;
}

.sl-copy-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tb-text-faint);
    border-radius: 4px;
    padding: 0;
    transition: color var(--tb-transition);
    font-size: 12px;
}

.sl-copy-inline:hover {
    color: var(--tb-primary);
}

.sl-copy-inline.copied {
    color: var(--tb-green);
}

/* Cell: original url */
.sl-orig-url {
    font-size: 12px;
    color: var(--tb-text-faint);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Cell: date */
.sl-date {
    font-size: 11px;
    font-family: var(--tb-font-mono);
    white-space: nowrap;
    color: var(--tb-text-faint);
}

/* Cell: actions */
.sl-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.sl-btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    cursor: pointer;
    color: var(--tb-text-faint);
    transition: color var(--tb-transition), border-color var(--tb-transition), background var(--tb-transition);
    font-size: 13px;
}

.sl-btn-delete:hover {
    color: var(--tb-coral);
    border-color: var(--tb-coral-border);
    background: var(--tb-coral-dim);
}

/* ── Modal ────────────────────────────────────────────────────── */
.sl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.sl-modal-overlay[hidden] {
    display: none;
}

.sl-modal {
    background: var(--tb-surface);
    border: 1px solid var(--tb-border-hover);
    border-radius: var(--tb-radius-lg);
    padding: 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}

.sl-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tb-coral-dim);
    border: 1px solid var(--tb-coral-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
    color: var(--tb-coral);
}

.sl-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tb-text);
    margin-bottom: 8px;
}

.sl-modal-sub {
    font-size: var(--tb-text-sm);
    color: var(--tb-text-muted);
    margin-bottom: 20px;
    word-break: break-all;
}

.sl-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}