/* ==========================================================================
   NxSpot Relationship System — Shared Design System
   Prefix: nxspot-rel-
   Brand color: #f5a623 (orange)
   Scoped with all:initial to avoid theme conflicts
   ========================================================================== */

/* Page Reset — isolate from WordPress theme */
.nxspot-rel-page {
    all: initial;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nxspot-rel-page *,
.nxspot-rel-page *::before,
.nxspot-rel-page *::after {
    box-sizing: border-box;
}

/* Wide layout for dashboard pages */
.nxspot-rel-page--wide {
    background: #f7f8fa;
    min-height: 100vh;
    padding: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.nxspot-rel-page h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.nxspot-rel-page h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.nxspot-rel-page h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
}

.nxspot-rel-page p {
    margin: 0;
    color: #555;
}

.nxspot-rel-page a {
    color: #f5a623;
    text-decoration: none;
}

.nxspot-rel-page a:hover {
    text-decoration: underline;
}

/* Contact rows are <a> tags — never underline */
a.nxspot-rel-contact-row,
a.nxspot-rel-contact-row:hover,
a.nxspot-rel-contact-row:focus,
a.nxspot-rel-contact-row:active {
    text-decoration: none !important;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.nxspot-rel-container {
    width: 100%;
    padding: 24px 24px;
}

.nxspot-rel-container--with-sidebar {
    display: flex;
    gap: 24px;
    width: 100%;
    padding: 24px 24px;
}

.nxspot-rel-main {
    flex: 1;
    min-width: 0;
}

.nxspot-rel-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* ==========================================================================
   Header Bar
   ========================================================================== */

.nxspot-rel-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-right: 56px; /* Clear the notification bell fallback position */
}

.nxspot-rel-container--with-sidebar .nxspot-rel-header-bar {
    padding-right: 0; /* Sidebar pages don't need bell clearance */
}

.nxspot-rel-header-bar__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nxspot-rel-header-bar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.nxspot-rel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.nxspot-rel-btn--primary {
    background: #f5a623;
    color: #fff;
}

.nxspot-rel-btn--primary:hover {
    background: #e09510;
}

.nxspot-rel-btn--outline {
    background: transparent;
    color: #f5a623;
    border: 1.5px solid #f5a623;
}

.nxspot-rel-btn--outline:hover {
    background: rgba(245, 166, 35, 0.08);
}

.nxspot-rel-btn--ghost {
    background: transparent;
    color: #555;
    border: 1.5px solid #ddd;
}

.nxspot-rel-btn--ghost:hover {
    background: #f5f5f5;
}

.nxspot-rel-btn--sm {
    padding: 6px 12px;
    font-size: 13px;
}

.nxspot-rel-btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #555;
}

.nxspot-rel-btn--icon:hover {
    background: #f5f5f5;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.nxspot-rel-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
}

.nxspot-rel-card--elevated {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: none;
}

/* ==========================================================================
   Avatar
   ========================================================================== */

.nxspot-rel-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.nxspot-rel-avatar--sm {
    width: 40px;
    height: 40px;
}

.nxspot-rel-avatar--lg {
    width: 80px;
    height: 80px;
}

.nxspot-rel-avatar--xl {
    width: 100px;
    height: 100px;
    border: 3px solid #fff;
}

.nxspot-rel-avatar-wrap {
    position: relative;
    display: inline-block;
}

.nxspot-rel-avatar-wrap__status {
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #4caf50;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.nxspot-rel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.nxspot-rel-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.nxspot-rel-tab:hover {
    color: #555;
}

.nxspot-rel-tab--active {
    color: #1a1a1a;
    border-bottom-color: #f5a623;
}

/* ==========================================================================
   Badge / Tag
   ========================================================================== */

.nxspot-rel-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(245, 166, 35, 0.12);
    color: #f5a623;
}

/* ==========================================================================
   Modal / Overlay
   ========================================================================== */

.nxspot-rel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.nxspot-rel-modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.nxspot-rel-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.nxspot-rel-modal::-webkit-scrollbar { display: none; }

.nxspot-rel-modal__title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.nxspot-rel-modal__subtitle {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-bottom: 24px;
}

.nxspot-rel-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nxspot-rel-modal__action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: #1a1a1a;
    width: 100%;
    text-align: left;
}

.nxspot-rel-modal__action-item:hover {
    background: #fafafa;
}

.nxspot-rel-modal__action-item--locked {
    color: #aaa;
}

.nxspot-rel-modal__action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nxspot-rel-modal__action-icon--scan {
    background: #e8f5e9;
    color: #4caf50;
}

.nxspot-rel-modal__action-icon--sync {
    background: #fff3e0;
    color: #f5a623;
}

.nxspot-rel-modal__action-icon--manual {
    background: #e3f2fd;
    color: #2196f3;
}

.nxspot-rel-modal__action-lock {
    margin-left: auto;
    color: #ccc;
}

.nxspot-rel-modal__dismiss {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 16px;
    padding: 10px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.nxspot-rel-modal__dismiss:hover {
    color: #555;
}

/* ==========================================================================
   FAB (Floating Action Button)
   ========================================================================== */

.nxspot-rel-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f5a623;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.4);
    transition: all 0.2s ease;
    padding: 0;
}

.nxspot-rel-fab:hover {
    background: #e09510;
    transform: scale(1.08);
}

/* ==========================================================================
   Pro Card (Sidebar)
   ========================================================================== */

.nxspot-rel-pro-card {
    background: #fdf3e4;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #f5e0be;
}

.nxspot-rel-pro-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.nxspot-rel-pro-card__subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.nxspot-rel-pro-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.nxspot-rel-pro-card__features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 14px;
    color: #333;
}

.nxspot-rel-pro-card__features li svg {
    color: #f5a623;
    flex-shrink: 0;
}

.nxspot-rel-pro-card__btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f5a623;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

.nxspot-rel-pro-card__btn:hover {
    background: #e09510;
}

/* ==========================================================================
   Contact Detail — Hero Header
   ========================================================================== */

.nxspot-rel-hero {
    background: #f5a623;
    border-radius: 12px;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
}

.nxspot-rel-hero__info {
    flex: 1;
}

.nxspot-rel-hero__name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.nxspot-rel-hero__subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.nxspot-rel-hero__back {
    position: absolute;
    top: 12px;
    left: 12px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.nxspot-rel-hero__menu {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

/* Quick Actions (Email / Call / Text) */
.nxspot-rel-quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.nxspot-rel-quick-action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #f5a623;
}

.nxspot-rel-quick-action:hover {
    background: #fdf8ef;
    border-color: #f5a623;
}

.nxspot-rel-quick-action__icon {
    width: 28px;
    height: 28px;
    color: #f5a623;
}

/* ==========================================================================
   Contact Info Grid
   ========================================================================== */

.nxspot-rel-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 0;
}

.nxspot-rel-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.nxspot-rel-info-item__icon {
    width: 20px;
    height: 20px;
    color: #f5a623;
    flex-shrink: 0;
    margin-top: 2px;
}

.nxspot-rel-info-item__label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.nxspot-rel-info-item__value {
    font-size: 13px;
    color: #888;
}

/* ==========================================================================
   Linked NxSpot Page Card
   ========================================================================== */

.nxspot-rel-linked-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f5a623;
    border-radius: 12px;
    margin-top: 20px;
}

.nxspot-rel-linked-card__info {
    flex: 1;
}

.nxspot-rel-linked-card__name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.nxspot-rel-linked-card__subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Pro Badge
   ========================================================================== */

.nxspot-rel-pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #f5a623;
    color: #fff;
}

/* ==========================================================================
   Integration Row
   ========================================================================== */

.nxspot-rel-integration-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 16px;
}

.nxspot-rel-integration-row__left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .nxspot-rel-container--with-sidebar {
        flex-direction: column;
    }

    .nxspot-rel-sidebar {
        width: 100%;
    }

    .nxspot-rel-info-grid {
        grid-template-columns: 1fr;
    }

    .nxspot-rel-quick-actions {
        flex-direction: row;
    }
}
