/* Handshake system styles */

.b2b-handshake-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.3);
    transition: all 0.25s ease;
    text-decoration: none;
}

.b2b-handshake-btn:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 148, 136, 0.4);
    color: #fff;
}

.b2b-handshake-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

.b2b-handshake-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.b2b-handshake-status-pending_sent {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: 0 2px 4px rgba(100, 116, 139, 0.3);
}

.b2b-handshake-status-pending_sent:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.b2b-handshake-status-pending_sent:hover .b2b-handshake-text {
    display: none;
}

.b2b-handshake-status-pending_sent:hover .dashicons {
    display: none;
}

.b2b-handshake-status-pending_sent:hover::before {
    content: "Withdraw";
}

.b2b-handshake-status-pending_received {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.b2b-handshake-status-accepted {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.b2b-handshake-status-accepted:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.b2b-handshake-status-accepted:hover .b2b-handshake-text {
    display: none;
}

.b2b-handshake-status-accepted:hover .dashicons {
    display: none;
}

.b2b-handshake-status-accepted:hover::before {
    content: "Remove";
}

/* Profile stats handshake accent (number only — keep chips light) */
.b2b-profile-stats .b2b-stat-item.b2b-stat-handshakes {
    background: transparent;
    box-shadow: none;
}

.b2b-profile-stats .b2b-stat-handshakes .b2b-stat-number {
    color: #0f766e;
}

/* Teaser / owner list cards */
.b2b-handshake-teaser-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.b2b-handshake-teaser-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.b2b-handshake-teaser-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.b2b-handshake-count-number {
    font-size: 36px;
    font-weight: 700;
    color: #0f766e;
    line-height: 1;
}

.b2b-handshake-count-label {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

.b2b-handshake-blurred-avatars {
    display: flex;
    align-items: center;
}

.b2b-handshake-blurred-avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    margin-left: -10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    background: #e2e8f0;
}

.b2b-handshake-blurred-avatars .b2b-handshake-blurred-avatar:first-child {
    margin-left: 0;
}

.b2b-handshake-blurred-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px);
    transform: scale(1.15);
    pointer-events: none;
    user-select: none;
}

.b2b-handshake-blurred-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    margin-left: -10px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 2px solid #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.b2b-handshake-role-mix {
    margin: 0;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.b2b-handshake-mutuals {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 10px;
}

.b2b-handshake-mutuals-avatars {
    display: flex;
    flex-shrink: 0;
}

.b2b-handshake-mutual-avatar {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    margin-left: -8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.b2b-handshake-mutuals-avatars .b2b-handshake-mutual-avatar:first-child {
    margin-left: 0;
}

.b2b-handshake-mutual-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.b2b-handshake-mutuals-text {
    margin: 0;
    font-size: 13px;
    color: #0f766e;
    line-height: 1.45;
    font-weight: 500;
}

.b2b-handshake-mutuals-text a {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

.b2b-handshake-mutuals-text a:hover {
    text-decoration: underline;
}

.b2b-handshake-teaser-note,
.b2b-handshake-empty {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.b2b-handshake-list-count {
    font-weight: 500;
    color: #64748b;
    font-size: 0.85em;
    margin-left: 4px;
}

.b2b-handshake-manage-link {
    display: inline-block;
    margin-top: 14px;
    color: #0d9488;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.b2b-handshake-manage-link:hover {
    color: #0f766e;
    text-decoration: underline;
}

.b2b-handshake-list-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.b2b-handshake-list-footer .b2b-handshake-manage-link {
    margin-top: 0;
}

.b2b-handshake-view-all {
    display: inline-flex;
    align-items: center;
    color: #0d9488;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.b2b-handshake-view-all:hover {
    color: #0f766e;
    text-decoration: underline;
}

.b2b-handshake-partner-list--preview .b2b-handshake-partner-item {
    padding: 8px 10px;
}

.b2b-handshake-partner-list--preview .b2b-handshake-partner-avatar {
    width: 40px;
    height: 40px;
}

.b2b-handshake-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.b2b-handshake-search input[type="search"] {
    flex: 1;
    min-width: 180px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}

.b2b-handshake-search button {
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.b2b-handshake-search button:hover {
    background: #0f766e;
}

.b2b-handshake-search-clear {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.b2b-handshake-search-clear:hover {
    color: #0f766e;
}

.b2b-handshake-partners-meta {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
}

.b2b-handshake-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.b2b-handshake-pagination a {
    color: #0d9488;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.b2b-handshake-pagination a:hover {
    text-decoration: underline;
}

.b2b-handshake-partner-list,
.b2b-handshake-request-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.b2b-handshake-partner-item,
.b2b-handshake-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.b2b-handshake-partner-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1;
}

.b2b-handshake-partner-link:hover .b2b-handshake-partner-name {
    color: #0d9488;
}

.b2b-handshake-partner-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.b2b-handshake-partner-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.b2b-handshake-partner-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.b2b-handshake-partner-role,
.b2b-handshake-partner-time {
    font-size: 13px;
    color: #64748b;
}

.b2b-handshake-request-note {
    font-size: 13px;
    color: #475569;
    font-style: italic;
    margin-top: 4px;
}

.b2b-handshake-request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.b2b-handshake-accept-btn,
.b2b-handshake-decline-btn,
.b2b-handshake-withdraw-btn,
.b2b-handshake-remove-btn,
.b2b-handshake-modal-send,
.b2b-handshake-modal-cancel {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.b2b-handshake-accept-btn,
.b2b-handshake-modal-send {
    background: #0d9488;
    color: #fff;
}

.b2b-handshake-accept-btn:hover,
.b2b-handshake-modal-send:hover {
    background: #0f766e;
}

.b2b-handshake-decline-btn,
.b2b-handshake-withdraw-btn,
.b2b-handshake-remove-btn,
.b2b-handshake-modal-cancel {
    background: #e2e8f0;
    color: #475569;
}

.b2b-handshake-decline-btn:hover,
.b2b-handshake-withdraw-btn:hover,
.b2b-handshake-remove-btn:hover,
.b2b-handshake-modal-cancel:hover {
    background: #cbd5e1;
}

/* Management page */
.b2b-handshakes-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.b2b-handshakes-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #0f172a;
}

.b2b-handshakes-header p {
    margin: 0 0 24px;
    color: #64748b;
    font-size: 15px;
}

.b2b-handshakes-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.b2b-handshakes-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.b2b-handshakes-tab:hover {
    color: #0d9488;
}

.b2b-handshakes-tab.is-active {
    color: #0d9488;
    border-bottom-color: #0d9488;
}

.b2b-handshakes-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0d9488;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.b2b-handshakes-tab-badge-muted {
    background: #94a3b8;
}

.b2b-handshakes-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Modal */
.b2b-handshake-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.b2b-handshake-modal.is-open,
.b2b-handshake-modal:not([hidden]) {
    display: flex;
}

.b2b-handshake-modal[hidden] {
    display: none !important;
}

.b2b-handshake-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.b2b-handshake-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.b2b-handshake-modal-dialog h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #0f172a;
}

.b2b-handshake-modal-dialog p {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 14px;
}

.b2b-handshake-modal-dialog textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.b2b-handshake-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Toast */
.b2b-handshake-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
}

.b2b-handshake-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.b2b-handshake-toast-error {
    background: #b91c1c;
}

@media (max-width: 640px) {
    .b2b-handshake-partner-item,
    .b2b-handshake-request-item {
        flex-direction: column;
        align-items: stretch;
    }

    .b2b-handshake-request-actions {
        justify-content: stretch;
    }

    .b2b-handshake-request-actions button,
    .b2b-handshake-remove-btn {
        flex: 1;
    }

    .b2b-profile-actions {
        flex-wrap: wrap;
    }
}
