/* ---- Global button radius (overrides individual radii below) ---- */
.gplvilla-key-actions button,
.gplvilla-modal-actions button,
.gplvilla-bulk button,
.gplvilla-col-actions button,
.gplvilla-row-remove, .gplvilla-row-ban, .gplvilla-row-unban,
.gplvilla-bulk-remove, .gplvilla-bulk-ban, .gplvilla-bulk-unban {
    border-radius: 4px !important;
}

/* ---- Cards & headers ---- */
.gplvilla-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(180deg, #f4f9fd 0%, #ecf3fb 100%);
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.gplvilla-card-header h2 { margin: 0 0 2px; font-size: 1.25em; }
.gplvilla-card-header p  { margin: 0; color: #5b6b7c; }
.gplvilla-card-icon {
    width: 40px; height: 40px;
    background: rgb(89 97 255); color: #fff; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.gplvilla-card-icon svg { width: 20px; height: 20px; }
.gplvilla-card-subhead { color: #5b6b7c; font-size: 13px; margin: 0 0 16px; }

/* Inline stat strip in the card header */
.gplvilla-card-title { flex: 1; min-width: 0; }
.gplvilla-card-title h2 { margin: 0; font-size: 1.25em; }
.gplvilla-card-title p {
    margin: 4px 0 0;
    color: #5b6b7c; font-size: 13px;
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.gplvilla-card-title p strong { color: #1c1c1c; font-weight: 600; }
.gplvilla-stat-sep { color: #cbd5e1; margin: 0 4px; }

.gplvilla-info-banner {
    display: flex; flex-direction: row; align-items: flex-start; gap: 14px;
    background: #f5fafe;
    border-left: 4px solid rgb(89 97 255);
    padding: 14px 18px; border-radius: 6px;
    margin-bottom: 18px;
}
.gplvilla-info-banner-icon {
    flex-shrink: 0;
    color: rgb(89 97 255);
    margin-top: 2px;
}
.gplvilla-info-banner-icon svg { width: 22px; height: 22px; display: block; }
.gplvilla-info-banner-text { display: flex; flex-direction: column; gap: 6px; }
.gplvilla-info-banner p { margin: 0; }
.gplvilla-info-banner .gplvilla-warn { color: #d28720; }

/* ---- API Key page ---- */
.gplvilla-key-display {
    display: flex; align-items: center;
    background: #f5f8fb; border: 1px solid #d8e2ec;
    border-radius: 8px; padding: 12px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    margin-bottom: 14px;
    word-break: break-all;
}
.gplvilla-key-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.gplvilla-key-actions .button { border-radius: 24px; padding: 6px 18px; }
.gplvilla-key-actions button {
    display: inline-flex; align-items: center; gap: 6px;
}
.gplvilla-key-actions button svg { width: 14px; height: 14px; flex-shrink: 0; }
.gplvilla-key-actions .gplvilla-key-show       { background: #e9eef3; color: #2c3e50; }
.gplvilla-key-actions .gplvilla-key-copy       { background: rgb(89 97 255); color: #fff; }
.gplvilla-key-actions .gplvilla-key-regenerate { background: #fff; color: #d54545; border: 1px solid #d54545; }
.gplvilla-key-hint { font-size: 13px; color: #5b6b7c; margin-top: 8px; }

/* ---- Counts ---- */
.gplvilla-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.gplvilla-count {
    background: #fff; border: 1px solid #e1e7ee; border-radius: 4px;
    padding: 10px 14px; display: flex; flex-direction: row; align-items: center; gap: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.gplvilla-count-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.gplvilla-count-icon svg { width: 16px; height: 16px; display: block; }
.gplvilla-count-active .gplvilla-count-icon { background: rgba(26, 162, 96, 0.12); color: #1aa260; }
.gplvilla-count-banned .gplvilla-count-icon { background: rgba(213, 69, 69, 0.12);  color: #d54545; }
.gplvilla-count-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gplvilla-count-label {
    font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: #6c7a89;
    display: inline-flex; align-items: center; gap: 4px;
}
.gplvilla-count-value { font-size: 1.4em; font-weight: 600; line-height: 1.1; }
.gplvilla-count-active .gplvilla-count-value { color: #1aa260; }
.gplvilla-count-banned .gplvilla-count-value { color: #d54545; }

/* ---- Tooltip (used inside count label) ---- */
.gplvilla-tooltip {
    position: relative;
    display: inline-flex; align-items: center;
    color: #9aa6b3; cursor: help;
    outline: none;
}
.gplvilla-tooltip svg { width: 13px; height: 13px; }
.gplvilla-tooltip:hover, .gplvilla-tooltip:focus { color: #5b6b7c; }
.gplvilla-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 8px 10px;
    background: #1c1c1c;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
    white-space: normal;
}
.gplvilla-tooltip:hover::after,
.gplvilla-tooltip:focus::after { opacity: 1; }

/* ---- Search ---- */
.gplvilla-search { margin-bottom: 16px; }
.gplvilla-search input {
    width: 100%; padding: 8px 14px; border: 1px solid #d8e2ec;
    border-radius: 4px; font-size: 13px;
}

/* ---- Panel: single neutral card holding tabs + search + lists ---- */
.gplvilla-panel {
    background: #fff;
    border: 1px solid #e1e7ee;
    border-radius: 4px;
    overflow: hidden;
}
.gplvilla-panel-top {
    display: flex; align-items: center; gap: 16px;
    padding: 4px 14px 0;
    border-bottom: 1px solid #eef2f7;
    flex-wrap: wrap;
}

/* ---- Tabs ---- */
.gplvilla-tabs {
    display: inline-flex; gap: 0; margin-right: auto;
    flex-shrink: 0;
}
.gplvilla-tab {
    background: transparent; border: 0; cursor: pointer;
    padding: 12px 4px; margin: 0 16px 0 0;
    color: #6c7a89; font-size: 14px; font-weight: 500;
    border-bottom: 2px solid transparent;
    display: inline-flex; align-items: center; gap: 8px;
    transition: color 0.12s, border-color 0.12s;
    border-radius: 0 !important; /* override the global 4px */
}
.gplvilla-tab:hover { color: #1c1c1c; }
.gplvilla-tab.is-active {
    color: rgb(89 97 255);
    border-bottom-color: rgb(89 97 255);
}
.gplvilla-tab-count {
    display: inline-block; min-width: 18px;
    padding: 0 6px; font-size: 11px; font-weight: 600;
    background: #eef2f7; color: #6c7a89;
    border-radius: 9px; line-height: 18px; text-align: center;
}
.gplvilla-tab.is-active .gplvilla-tab-count {
    background: rgba(89, 97, 255, 0.12); color: rgb(89 97 255);
}

/* ---- Tab panes ---- */
.gplvilla-tabpane { display: none; }
.gplvilla-tabpane.is-active { display: block; }
.gplvilla-tabpane[hidden] { display: none !important; }

/* ---- Search (slimmer, inline with tabs) ---- */
.gplvilla-search {
    position: relative;
    margin-bottom: 0;
    flex: 1; min-width: 180px;
    padding: 6px 0 8px;
}
.gplvilla-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: #9aa6b3; pointer-events: none;
}
.gplvilla-search input {
    width: 100%; padding: 6px 10px 6px 32px;
    border: 1px solid #e1e7ee; border-radius: 4px;
    font-size: 13px; background: #f8fafd;
}
.gplvilla-search input:focus {
    background: #fff; border-color: rgba(89, 97, 255, 0.5);
    outline: 0; box-shadow: 0 0 0 3px rgba(89, 97, 255, 0.12);
}

/* ---- Bulk bar — slides into the active pane when ≥1 row selected ---- */
.gplvilla-bulk {
    display: none; align-items: center; gap: 8px;
    padding: 8px 14px; background: #f8fafd;
    border-bottom: 1px solid #eef2f7;
}
.gplvilla-bulk.is-visible { display: flex; }
.gplvilla-bulk-count { color: #6c7a89; font-size: 12px; }
.gplvilla-bulk > button:first-of-type { margin-left: auto; }

/* ---- Domain list (replaces the table) ---- */
.gplvilla-domain-list { list-style: none; margin: 0; padding: 0; }
.gplvilla-domain-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f3f7;
}
.gplvilla-domain-row:last-child { border-bottom: 0; }
.gplvilla-domain-row:hover { background: #fafbfd; }
.gplvilla-domain-row-blocked { opacity: 0.85; }
.gplvilla-domain-name {
    flex: 1; min-width: 0;
    font-size: 14px; color: #1c1c1c;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gplvilla-row-actions {
    display: flex; gap: 6px; flex-shrink: 0;
}
.gplvilla-row-actions button {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; font-size: 12px;
    border: 1px solid transparent;
    background: transparent; color: #6c7a89;
    cursor: pointer;
}
.gplvilla-row-actions button svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---- Row buttons: subtle ghost — visible but quiet ---- */
.gplvilla-row-remove { color: rgb(89 97 255); }
.gplvilla-row-remove:hover {
    background: rgba(89, 97, 255, 0.10); border-color: rgba(89, 97, 255, 0.30);
}
.gplvilla-row-ban { color: #6c7a89; }
.gplvilla-row-ban:hover {
    background: #f1f4f8; border-color: #cbd5e1; color: #2c3e50;
}
.gplvilla-row-unban { color: #1aa260; }
.gplvilla-row-unban:hover {
    background: rgba(26, 162, 96, 0.10); border-color: rgba(26, 162, 96, 0.30);
}

/* ---- Bulk buttons: solid filled, more prominent ---- */
.gplvilla-bulk button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; font-size: 12px; font-weight: 500;
    color: #fff; cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.gplvilla-bulk button svg { width: 13px; height: 13px; flex-shrink: 0; }
.gplvilla-bulk-remove { background: rgb(89 97 255); }
.gplvilla-bulk-remove:not(:disabled):hover { background: rgb(72 80 235); }
.gplvilla-bulk-ban    { background: #2c3e50; }
.gplvilla-bulk-ban:not(:disabled):hover    { background: #1f2d3a; }
.gplvilla-bulk-unban  { background: #1aa260; }
.gplvilla-bulk-unban:not(:disabled):hover  { background: #168550; }
.gplvilla-bulk button:disabled {
    background: #d8e2ec; color: #fff; box-shadow: none;
}

/* ---- Favicon ---- */
.gplvilla-favicon {
    width: 18px; height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: contain;
    background: #f1f4f8;
}
.gplvilla-favicon-placeholder {
    background: #f1f4f8;
    border: 1px dashed #d8e2ec;
}

/* Legacy emoji icon (retained in case any tooling still emits it) */
.gplvilla-domain-icon { margin-right: 6px; opacity: 0.6; }

/* ---- Custom checkboxes ---- */
.gplvilla-row-select,
.gplvilla-select-all {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px;
    border: 1.5px solid #cbd5e1; border-radius: 4px;
    background: #fff; cursor: pointer; margin: 0 0 0px 16px !important;
    vertical-align: middle; display: inline-block!important; position: relative;
    transition: background-color 0.12s, border-color 0.12s;
}
.gplvilla-row-select:hover,
.gplvilla-select-all:hover { border-color: #9aa6b3; }
.gplvilla-row-select:checked,
.gplvilla-select-all:checked {
    background: rgb(89 97 255); border-color: rgb(89 97 255);
}
.gplvilla-row-select:checked::after,
.gplvilla-select-all:checked::after {
    content: ''; position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.gplvilla-row-select:focus-visible,
.gplvilla-select-all:focus-visible {
    outline: 2px solid rgba(89, 97, 255, 0.35); outline-offset: 2px;
}

/* ---- Empty state (now inside the list as a single li) ---- */
.gplvilla-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    padding: 24px 14px;
    color: #9aa6b3; font-size: 13px;
    list-style: none;
}
.gplvilla-empty .gplvilla-empty-icon {
    width: 32px; height: 32px;
    border-radius: 50%; background: #f1f4f8;
    display: flex; align-items: center; justify-content: center;
}
.gplvilla-empty .gplvilla-empty-icon svg { width: 16px; height: 16px; }

/* Hide the inline stats counts/big-cards block if some old template still renders it */
.gplvilla-counts { display: none; }

/* ---- Modal ---- */
.gplvilla-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.gplvilla-modal[hidden] { display: none; }
.gplvilla-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    animation: gplvillaFadeIn 120ms ease-out;
}
.gplvilla-modal-dialog {
    position: relative;
    background: #fff; border-radius: 14px;
    max-width: 480px; width: calc(100% - 32px);
    padding: 28px 28px 22px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
    animation: gplvillaPopIn 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.gplvilla-modal-x {
    position: absolute; top: 10px; right: 12px;
    width: 32px; height: 32px; border-radius: 50%;
    background: transparent; border: 0;
    font-size: 24px; line-height: 1; cursor: pointer;
    color: #6c7a89;
}
.gplvilla-modal-x:hover { background: #f1f4f8; color: #1c1c1c; }

/* Optional icon above the title (set via JS) */
.gplvilla-modal-icon {
    display: none;
    width: 56px; height: 56px;
    margin: 4px auto 14px;
    border-radius: 50%;
    align-items: center; justify-content: center;
}
.gplvilla-modal-icon.has-icon { display: flex; }
.gplvilla-modal-icon svg { width: 28px; height: 28px; }
.gplvilla-modal-icon.is-danger  { background: rgba(213, 69, 69, 0.12); color: #d54545; }
.gplvilla-modal-icon.is-warning { background: rgba(44, 62, 80, 0.10);  color: #2c3e50; }

.gplvilla-modal-title  { margin: 0 0 12px; font-size: 1.15em; text-align: center; }
.gplvilla-modal-body   { color: #4a5568; line-height: 1.55; margin-bottom: 22px; font-size: 14px; text-align: center; }
.gplvilla-modal-body p { margin: 0 0 10px; }
.gplvilla-modal-body p:last-child { margin-bottom: 0; }
.gplvilla-modal-body strong { color: #1c1c1c; }
.gplvilla-modal-body a { color: rgb(89 97 255); text-decoration: underline; font-weight: 600;}
.gplvilla-modal-body a:hover { color: rgb(60 70 230); }

.gplvilla-modal-actions {
    display: flex; gap: 10px; justify-content: center;
}
.gplvilla-modal-actions button {
    border-radius: 22px; padding: 8px 22px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; cursor: pointer; font-size: 14px;
}
.gplvilla-modal-cancel  { background: #eef2f7; color: #2c3e50; }
.gplvilla-modal-confirm { background: rgb(89 97 255); color: #fff; }
.gplvilla-modal-confirm.is-danger  { background: #d54545; }
.gplvilla-modal-confirm.is-warning { background: #2c3e50; }
.gplvilla-modal-confirm svg { width: 14px; height: 14px; flex-shrink: 0; stroke: currentColor; }

@keyframes gplvillaFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes gplvillaPopIn  { from { opacity: 0; transform: translateY(8px) scale(0.97) } to { opacity: 1; transform: none } }
