/**
 * Credential Hub - Vault & Filter Panel Styles
 * Bitwarden-style vault grid, filter side panel, table, MCP styles, and report cards.
 */

/* BITWARDEN VAULTS SCREEN */
.bw-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.bw-title { font-size: 22px; font-weight: 700; color: #fff; margin: 0; }
.bw-header-actions { display: flex; align-items: center; gap: 12px; }
.bw-avatar { width: 32px; height: 32px; border-radius: 50%; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.bw-vault-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }

/* BITWARDEN FILTERS SIDE PANEL */
.bw-filter-panel { background: #0b131b; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.bw-filter-header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: 1px; margin-bottom: 12px; }
.bw-help-icon { font-size: 14px; color: #64748b; cursor: pointer; }
.bw-help-icon:hover { color: #38bdf8; }

.bw-search-box { display: flex; align-items: center; gap: 8px; background: #060b10; border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 6px 12px; margin-bottom: 16px; transition: border-color 0.2s; }
.bw-search-box:focus-within { border-color: #38bdf8; box-shadow: 0 0 10px rgba(56,189,248,0.2); }
.bw-search-box .material-icons { font-size: 16px; color: #64748b; }
.bw-search-box input { background: transparent; border: none; outline: none; color: #fff; font-size: 12px; width: 100%; font-family: 'Inter', sans-serif; }

.bw-filter-section { margin-bottom: 10px; }
.bw-filter-item { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #cbd5e1; padding: 7px 8px; border-radius: 6px; cursor: pointer; transition: all 0.15s; user-select: none; }
.bw-filter-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.bw-filter-item.active { color: #38bdf8; background: rgba(56,189,248,0.1); }
.bw-filter-item .arrow { font-size: 16px; color: #64748b; transition: transform 0.2s ease-in-out; }
.bw-filter-item.open .arrow { transform: rotate(90deg); color: #38bdf8; }

.bw-filter-subcontainer { display: none; margin-top: 2px; padding-left: 4px; }
.bw-filter-subcontainer.open { display: block !important; }

.bw-filter-subitem { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; padding: 6px 12px 6px 24px; border-radius: 6px; cursor: pointer; transition: all 0.15s; margin-bottom: 2px; }
.bw-filter-subitem:hover { background: rgba(255,255,255,0.05); color: #f1f5f9; }
.bw-filter-subitem.active { color: #38bdf8; background: rgba(56,189,248,0.15); font-weight: 600; }
.bw-filter-subitem .material-icons { font-size: 15px; color: #64748b; }
.bw-filter-subitem.active .material-icons { color: #38bdf8; }

/* BITWARDEN MAIN VAULT PANEL */
.bw-main-panel { display: flex; flex-direction: column; gap: 12px; }
.bw-vault-table { width: 100%; border-collapse: collapse; }
.bw-vault-table th { background: rgba(15,23,42,0.6); color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.bw-vault-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }

.bw-item-icon { width: 28px; height: 28px; border-radius: 6px; background: rgba(16,185,129,0.15); color: #10b981; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.bw-item-icon.globe { background: rgba(56,189,248,0.15); color: #38bdf8; }
.bw-item-icon.key { background: rgba(168,85,247,0.15); color: #c084fc; }

.bw-owner-tag { display: inline-block; padding: 3px 10px; border-radius: 12px; background: rgba(30,58,138,0.6); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; font-size: 11px; font-weight: 600; }

/* Make table rows clickable */
.bw-vault-table tbody tr, #vaultTableBody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.bw-vault-table tbody tr:hover, #vaultTableBody tr:hover {
    background: rgba(56, 189, 248, 0.08) !important;
}

/* Bitwarden Item Name Link Styling */
.bw-item-title-link {
    font-weight: 600;
    color: #38bdf8;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.bw-vault-table tbody tr:hover .bw-item-title-link,
#vaultTableBody tr:hover .bw-item-title-link,
.bw-item-title-link:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.bw-website-domain-text {
    transition: color 0.15s ease;
}

.bw-vault-table tbody tr:hover .bw-website-domain-text,
a:hover .bw-website-domain-text {
    color: #38bdf8 !important;
}

/* Bitwarden Report Cards */
.bw-report-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.4) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* MCP / API / CLI ACCESS STYLES */
.mcp-code-block {
    background: #060a0f !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
    color: #e2e8f0 !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    overflow-x: auto !important;
}

.mcp-gated-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
}

.mcp-scope-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.mcp-badge-pro {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* DYNAMIC WEBSITES & CHROME EXTENSIONS HIERARCHY TREE */
#bwWebsitesTreeContainer,
#bwExtensionsTreeContainer {
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}
#bwWebsitesTreeContainer::-webkit-scrollbar,
#bwExtensionsTreeContainer::-webkit-scrollbar {
    width: 4px;
}
#bwWebsitesTreeContainer::-webkit-scrollbar-track,
#bwExtensionsTreeContainer::-webkit-scrollbar-track {
    background: transparent;
}
#bwWebsitesTreeContainer::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.25);
    border-radius: 4px;
}
#bwWebsitesTreeContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}
#bwExtensionsTreeContainer::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.25);
    border-radius: 4px;
}
#bwExtensionsTreeContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}
.bw-site-branch, .bw-ext-branch { margin-bottom: 4px; }
.bw-tree-site-item { transition: all 0.15s ease; cursor: pointer; }
.bw-tree-site-item:hover { background: rgba(56,189,248,0.08) !important; color: #fff !important; }
.bw-tree-ext-item { transition: all 0.15s ease; cursor: pointer; }
.bw-tree-ext-item:hover { background: rgba(168,85,247,0.1) !important; color: #fff !important; }
.bw-tree-platform-item { transition: all 0.15s ease; cursor: pointer; }
.bw-tree-platform-item:hover { background: rgba(129,140,248,0.1) !important; color: #e2e8f0 !important; }
.bw-tree-file-item { transition: all 0.15s ease; cursor: pointer; user-select: none; }
.bw-tree-file-item:hover { background: rgba(52,211,153,0.12) !important; color: #6ee7b7 !important; }
.bw-tree-file-item.active { background: rgba(52,211,153,0.2) !important; color: #34d399 !important; font-weight: 600; }
.btn-copy-tree-env:hover { color: #38bdf8 !important; }
.btn-launch-site-link:hover { color: #38bdf8 !important; }
.btn-add-platform-to-site:hover, .btn-add-auth-env:hover, .btn-add-platform-to-ext:hover, .btn-add-ext-auth-env:hover { color: #38bdf8 !important; }

/* SUBTLE VAULT ACTIONS ICON BUTTONS */
.bw-vault-subtle-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 2px;
}
.bw-subtle-icon-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}
.bw-subtle-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    transform: translateY(-1px);
}
.bw-subtle-icon-btn:active {
    transform: translateY(0);
}
.bw-subtle-icon-btn.vault-copy-json:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}
.bw-subtle-icon-btn.vault-copy-text:hover {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.15);
}
.bw-subtle-icon-btn.vault-dl-json:hover {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}
.bw-subtle-icon-btn.vault-dl-txt:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}
.bw-subtle-icon-btn.bw-danger-icon-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.18);
}

