/*
 * Privaire Platform — Front-End Stylesheet
 * Theme: Gold #c9a84c | Ash Gray #a8a49e | Black #121212
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────
   CSS Custom Properties
───────────────────────────────────────── */
:root {
    --pv-bg:           #0e0e0e;
    --pv-surface:      #1a1a18;
    --pv-surface-2:    #242422;
    --pv-surface-3:    #2e2e2c;
    --pv-border:       #363634;
    --pv-gold:         #c9a84c;
    --pv-gold-light:   #dcb85c;
    --pv-gold-muted:   rgba(201, 168, 76, 0.15);
    --pv-gold-border:  rgba(201, 168, 76, 0.3);
    --pv-text:         #f0ece4;
    --pv-text-muted:   #a8a49e;
    --pv-text-dim:     #706c68;
    --pv-success:      #2ecc71;
    --pv-success-bg:   rgba(46, 204, 113, 0.12);
    --pv-error:        #e74c3c;
    --pv-error-bg:     rgba(231, 76, 60, 0.12);
    --pv-warn:         #f39c12;
    --pv-warn-bg:      rgba(243, 156, 18, 0.12);
    --pv-radius-sm:    6px;
    --pv-radius:       10px;
    --pv-radius-lg:    14px;
    --pv-shadow:       0 4px 20px rgba(0, 0, 0, 0.4);
    --pv-shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.6);
    --pv-transition:   0.2s ease;
}

/* ─────────────────────────────────────────
   Dashboard Wrapper / Layout
───────────────────────────────────────── */
.pv-dashboard-wrapper {
    background-color: var(--pv-bg);
    color: var(--pv-text);
    padding: 48px 24px 64px;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

.pv-dashboard-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────
   Dashboard Header
───────────────────────────────────────── */
.pv-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--pv-border);
}

.pv-dashboard-header-text {}

.pv-dashboard-title {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: var(--pv-text);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.pv-dashboard-title span {
    color: var(--pv-gold);
}

.pv-dashboard-subtitle {
    color: var(--pv-text-muted);
    margin: 0;
    font-size: 15px;
    font-weight: 400;
}

/* ─────────────────────────────────────────
   Stats Grid
───────────────────────────────────────── */
.pv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.pv-stat-card {
    background: linear-gradient(135deg, var(--pv-surface) 0%, var(--pv-surface-2) 100%);
    border: 1px solid var(--pv-border);
    padding: 24px 20px;
    border-radius: var(--pv-radius-lg);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--pv-transition), transform var(--pv-transition);
}

.pv-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pv-gold), transparent);
    opacity: 0;
    transition: opacity var(--pv-transition);
}

.pv-stat-card:hover {
    border-color: var(--pv-gold-border);
    transform: translateY(-1px);
}

.pv-stat-card:hover::before {
    opacity: 1;
}

.pv-stat-icon {
    font-size: 20px;
    width: 40px; height: 40px;
    background: var(--pv-gold-muted);
    border: 1px solid var(--pv-gold-border);
    border-radius: var(--pv-radius);
    display: flex; align-items: center; justify-content: center;
}

.pv-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.pv-stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--pv-gold);
    line-height: 1;
}

/* ─────────────────────────────────────────
   Dashboard Grid Layout
───────────────────────────────────────── */
.pv-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .pv-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────
   Cards
───────────────────────────────────────── */
.pv-card {
    background-color: var(--pv-surface);
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius-lg);
    padding: 28px;
    transition: border-color var(--pv-transition);
}

.pv-card + .pv-card {
    margin-top: 24px;
}

.pv-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--pv-text);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pv-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pv-card-title .pv-card-icon {
    font-size: 16px;
    opacity: 0.8;
}

.pv-card-desc {
    color: var(--pv-text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: -8px 0 20px 0;
}

/* Highlight card variant */
.pv-card-gold {
    border-color: var(--pv-gold-border);
    background: linear-gradient(135deg, var(--pv-surface) 0%, rgba(201, 168, 76, 0.04) 100%);
}

/* ─────────────────────────────────────────
   Empty States
───────────────────────────────────────── */
.pv-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--pv-text-muted);
    border: 1px dashed var(--pv-border);
    border-radius: var(--pv-radius);
}

.pv-empty-state .pv-empty-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.pv-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ─────────────────────────────────────────
   Partner Rows
───────────────────────────────────────── */
.pv-partners-list,
.pv-members-list,
.pv-pending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pv-partner-row,
.pv-member-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background-color: var(--pv-surface-2);
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
    gap: 14px;
    transition: border-color var(--pv-transition), background-color var(--pv-transition);
}

.pv-partner-row:hover,
.pv-member-row:hover {
    border-color: var(--pv-gold-border);
    background-color: var(--pv-surface-3);
}

.pv-partner-avatar img,
.pv-member-avatar img {
    border-radius: 50%;
    display: block;
    border: 2px solid var(--pv-gold-border);
    width: 44px;
    height: 44px;
    object-fit: cover;
}

.pv-partner-info,
.pv-member-info {
    flex-grow: 1;
    min-width: 0;
}

.pv-partner-name,
.pv-member-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--pv-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pv-partner-email,
.pv-member-email {
    font-size: 12px;
    color: var(--pv-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pv-partner-meta,
.pv-member-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────
   Badges
───────────────────────────────────────── */
.pv-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pv-badge-gold {
    background: var(--pv-gold-muted);
    color: var(--pv-gold);
    border: 1px solid var(--pv-gold-border);
}

.pv-badge-gray {
    background: rgba(168, 164, 158, 0.1);
    color: var(--pv-text-muted);
    border: 1px solid rgba(168, 164, 158, 0.2);
}

.pv-badge-success {
    background: var(--pv-success-bg);
    color: var(--pv-success);
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.pv-badge-warn {
    background: var(--pv-warn-bg);
    color: var(--pv-warn);
    border: 1px solid rgba(243, 156, 18, 0.25);
}

/* Tier badges on profiles */
.privaire-tier-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

/* ─────────────────────────────────────────
   Pending Invite Rows
───────────────────────────────────────── */
.pv-pending-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background-color: var(--pv-surface-2);
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
    gap: 12px;
    flex-wrap: wrap;
}

.pv-pending-info { flex-grow: 1; min-width: 0; }

.pv-pending-email {
    font-weight: 500;
    font-size: 14px;
    color: var(--pv-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pv-pending-date {
    font-size: 11px;
    color: var(--pv-text-dim);
}

.pv-pending-role {
    font-size: 11px;
    color: var(--pv-text-muted);
    text-transform: capitalize;
}

.pv-pending-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   Action Buttons
───────────────────────────────────────── */
.pv-action-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--pv-radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--pv-transition), opacity var(--pv-transition);
    display: inline-block;
    line-height: 1.5;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pv-btn-view {
    background: rgba(168, 164, 158, 0.1);
    color: var(--pv-text-muted);
    border-color: rgba(168, 164, 158, 0.2);
}

.pv-btn-view:hover {
    background: rgba(168, 164, 158, 0.2);
    color: var(--pv-text);
}

.pv-btn-resend {
    background: var(--pv-gold-muted);
    color: var(--pv-gold);
    border-color: var(--pv-gold-border);
}

.pv-btn-resend:hover {
    background: rgba(201, 168, 76, 0.25);
}

.pv-btn-revoke {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.25);
}

.pv-btn-revoke:hover {
    background: rgba(231, 76, 60, 0.2);
}

.pv-btn-danger-outline {
    background: transparent;
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.4);
}

.pv-btn-danger-outline:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* ─────────────────────────────────────────
   Gold Primary Button
───────────────────────────────────────── */
.pv-btn-gold {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--pv-gold) 0%, var(--pv-gold-light) 100%);
    border: none;
    border-radius: var(--pv-radius);
    color: #0e0e0e;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: opacity var(--pv-transition), transform var(--pv-transition);
    letter-spacing: 0.2px;
}

.pv-btn-gold:hover { opacity: 0.9; }
.pv-btn-gold:active { transform: scale(0.99); }

/* ─────────────────────────────────────────
   Form Elements
───────────────────────────────────────── */
.pv-form-card { }

.pv-field-group {
    margin-bottom: 18px;
}

.pv-field-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--pv-text-muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.pv-field-group input[type="text"],
.pv-field-group input[type="email"],
.pv-field-group input[type="password"],
.pv-field-group input[type="number"],
.pv-field-group input[type="file"] {
    width: 100%;
    padding: 11px 14px;
    /* !important on both background AND text color together — the
     * active theme's own global input styling loads after this
     * stylesheet and was winning on one property but not the other
     * (e.g. forcing a white background while our light text color
     * stayed), which made typed text unreadable. Forcing both keeps
     * them in sync no matter what the theme does. */
    background-color: var(--pv-surface-3) !important;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
    color: var(--pv-text) !important;
    -webkit-text-fill-color: var(--pv-text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color var(--pv-transition), box-shadow var(--pv-transition);
    outline: none;
}

.pv-field-group input:focus {
    border-color: var(--pv-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

/* ─────────────────────────────────────────
   Alerts / Notices
───────────────────────────────────────── */
.privaire-alert {
    padding: 12px 16px;
    border-radius: var(--pv-radius);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.privaire-alert-success {
    background: var(--pv-success-bg);
    color: var(--pv-success);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-left: 3px solid var(--pv-success);
}

.privaire-alert-error {
    background: var(--pv-error-bg);
    color: var(--pv-error);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-left: 3px solid var(--pv-error);
}

.privaire-alert p { margin: 0; }

/* ─────────────────────────────────────────
   Circle Info Banner (Partner Dashboard)
───────────────────────────────────────── */
.pv-circle-banner {
    background: linear-gradient(135deg, var(--pv-surface) 0%, rgba(201, 168, 76, 0.06) 100%);
    border: 1px solid var(--pv-gold-border);
    border-radius: var(--pv-radius-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pv-circle-banner-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.pv-circle-banner-text {}

.pv-circle-banner-name {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--pv-text);
    margin-bottom: 4px;
}

.pv-circle-banner-meta {
    font-size: 13px;
    color: var(--pv-text-muted);
}

.pv-circle-banner-link {
    color: var(--pv-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: opacity var(--pv-transition);
}

.pv-circle-banner-link:hover { opacity: 0.8; }

/* ─────────────────────────────────────────
   Section Tabs (optional future use)
───────────────────────────────────────── */
.pv-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--pv-surface-2);
    padding: 4px;
    border-radius: var(--pv-radius);
    border: 1px solid var(--pv-border);
}

.pv-tab {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    border-radius: var(--pv-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--pv-text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--pv-transition), color var(--pv-transition);
}

.pv-tab.active,
.pv-tab:hover {
    background: var(--pv-surface-3);
    color: var(--pv-text);
}

.pv-tab.active {
    color: var(--pv-gold);
}

/* ─────────────────────────────────────────
   Network Name Banner (Host)
───────────────────────────────────────── */
.pv-network-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--pv-gold-muted);
    border: 1px solid var(--pv-gold-border);
    border-radius: 20px;
    padding: 5px 14px 5px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pv-gold);
}

.pv-network-badge .dot {
    width: 7px; height: 7px;
    background: var(--pv-gold);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Smaller variant used under the header title (Section: dashboard header
   redesign — the top-right slot is now used by the identity card below) */
.pv-network-badge-inline {
    margin-top: 12px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ─────────────────────────────────────────
   Header Identity Card (Host/Partner logo + business name + profile link)
───────────────────────────────────────── */
.pv-identity-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--pv-surface);
    border: 1px solid var(--pv-border);
    border-radius: 14px;
    padding: 10px 16px 10px 10px;
}

.pv-identity-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--pv-bg);
    border: 1px solid var(--pv-border);
    flex-shrink: 0;
}

.pv-identity-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--pv-gold);
    background: var(--pv-gold-muted);
}

.pv-identity-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pv-identity-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--pv-text);
    line-height: 1.2;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv-identity-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--pv-gold);
    text-decoration: none;
}

.pv-identity-link:hover {
    text-decoration: underline;
}

/* ─────────────────────────────────────────
   Dividers
───────────────────────────────────────── */
.pv-divider {
    border: none;
    border-top: 1px solid var(--pv-border);
    margin: 24px 0;
}

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 600px) {
    .pv-dashboard-wrapper { padding: 24px 16px 48px; }
    .pv-dashboard-title { font-size: 24px; }
    .pv-stat-val { font-size: 28px; }
    .pv-card { padding: 20px; }
    .pv-pending-row { flex-direction: column; align-items: flex-start; }
    .pv-partner-row, .pv-member-row { flex-wrap: wrap; }
    .pv-dashboard-header { flex-direction: column; align-items: flex-start; }
}

/* ─────────────────────────────────────────
   Course Library Link (Section 9)
───────────────────────────────────────── */
.privaire-course-link {
    color: var(--pv-gold);
    font-weight: 600;
    text-decoration: none;
}
.privaire-course-link:hover { text-decoration: underline; }

.privaire-footer-course-link {
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
}
.privaire-footer-course-link a {
    color: var(--pv-gold);
    text-decoration: none;
    font-weight: 600;
}
.privaire-footer-course-link a:hover { text-decoration: underline; }

.privaire-footer-referral-link {
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
}
.privaire-footer-referral-link a {
    color: var(--pv-gold);
    text-decoration: none;
    font-weight: 600;
}
.privaire-footer-referral-link a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   Invite Link Copy Row (email fallback)
───────────────────────────────────────── */
.pv-invite-link-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}
.pv-invite-link-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    background: var(--pv-surface-2);
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius-sm);
    color: var(--pv-text-muted);
    font-size: 12px;
    font-family: monospace;
}
