/**
 * PCM Platform Brand Styles
 * Private Club Marketing Dashboard
 * 
 * Version: 2.0
 * Last Updated: December 2024
 */

/* ========== CSS VARIABLES ========== */
:root {
    /* Brand Colors */
    --pcm-gold: #AA915B;
    --pcm-gold-light: #d4a574;
    --pcm-gold-dark: #8b7349;
    --pcm-gold-50: #faf8f3;
    --pcm-gold-100: #f5f0e6;
    --pcm-gold-200: #e8dcc5;

    --pcm-navy: #1a2332;
    --pcm-navy-dark: #0f2744;
    --pcm-navy-medium: #1e3a5f;
    --pcm-navy-light: #2d4a6f;

    /* Semantic Colors */
    --pcm-success: #10b981;
    --pcm-success-light: #d1fae5;
    --pcm-warning: #f59e0b;
    --pcm-warning-light: #fef3c7;
    --pcm-error: #ef4444;
    --pcm-error-light: #fee2e2;
    --pcm-info: #3b82f6;
    --pcm-info-light: #dbeafe;

    /* Neutrals */
    --pcm-white: #ffffff;
    --pcm-gray-50: #f9fafb;
    --pcm-gray-100: #f3f4f6;
    --pcm-gray-200: #e5e7eb;
    --pcm-gray-300: #d1d5db;
    --pcm-gray-400: #9ca3af;
    --pcm-gray-500: #6b7280;
    --pcm-gray-600: #4b5563;
    --pcm-gray-700: #374151;
    --pcm-gray-800: #1f2937;
    --pcm-gray-900: #111827;

    /* Wealth-X Style Variables (used by global-activity, ai-insights, etc.) */
    --gold-primary: #A08B5B;
    --gold-light: #C4B07B;
    --gold-dark: #7A6A45;
    --gold-50: #FAF8F5;
    --gold-100: #F5F0E6;
    --gold-200: #E8DCC5;

    --text-dark: #333333;
    --text-medium: #555555;
    --text-light: #777777;
    --text-muted: #999999;

    --bg-cream: #FAFAF8;
    --bg-warm: #F8F6F2;
    --bg-white: #FFFFFF;

    --accent-blue: #2B5F8C;
    --accent-blue-light: #4A7BA7;
    --success-green: #3D9970;
    --success-light: rgba(61, 153, 112, 0.1);
    --danger-red: #C73E3E;
    --danger-light: rgba(199, 62, 62, 0.1);
    --warning-amber: #D4A017;
    --warning-light: rgba(212, 160, 23, 0.1);
    --info-blue: #2B5F8C;
    --info-light: rgba(43, 95, 140, 0.1);

    --border-light: #E8E5DE;
    --border-medium: #D5D0C5;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 4px 12px rgba(160, 139, 91, 0.2);
}

/* ========== BASE STYLES ========== */
body {
    margin: 0;
    padding: 0;
    font-family: 'articulat-cf', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== TYPOGRAPHY ========== */
.ff-heading, .ff-franklin {
    font-family: 'articulat-cf', 'Franklin Gothic Medium', 'Arial Narrow', sans-serif !important;
}

.ff-body, .ff-freight {
    font-family: 'big-caslon-fb', Georgia, serif !important;
}

/* ========== PCM HEADER ========== */
.pcm-header {
    background: linear-gradient(135deg, var(--pcm-gold) 0%, var(--pcm-gold-light) 100%);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.pcm-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pcm-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.pcm-logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pcm-logo-text {
    display: flex;
    flex-direction: column;
}

.pcm-logo-title {
    font-family: 'big-caslon-fb', serif;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 0.08em;
    line-height: 1.1;
}

.pcm-logo-subtitle {
    font-family: 'big-caslon-fb', Georgia, serif;
    font-size: 11px;
    opacity: 0.85;
    letter-spacing: 0.03em;
}

.pcm-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pcm-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'articulat-cf', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: all 0.2s;
}

.pcm-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pcm-nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.pcm-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-family: 'articulat-cf', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: all 0.2s;
}

.pcm-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========== ACCOUNT DROPDOWN ========== */
.pcm-account-wrapper {
    position: relative;
}

.pcm-account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-family: 'articulat-cf', sans-serif;
    font-size: 13px;
    transition: all 0.2s;
}

.pcm-account-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.pcm-account-avatar {
    width: 32px;
    height: 32px;
    background: var(--pcm-navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pcm-account-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.pcm-account-arrow {
    opacity: 0.8;
    transition: transform 0.2s;
}

.pcm-account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000;
    overflow: hidden;
}

.pcm-account-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pcm-dropdown-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--pcm-gray-50);
}

.pcm-dropdown-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--pcm-gold) 0%, var(--pcm-gold-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    font-family: 'articulat-cf', sans-serif;
    letter-spacing: 0.5px;
}

.pcm-dropdown-info {
    flex: 1;
    min-width: 0;
}

.pcm-dropdown-name {
    font-family: 'articulat-cf', sans-serif;
    font-weight: 600;
    color: var(--pcm-navy);
    font-size: 15px;
}

.pcm-dropdown-email {
    font-size: 12px;
    color: var(--pcm-gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcm-dropdown-divider {
    height: 1px;
    background: var(--pcm-gray-200);
}

.pcm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--pcm-gray-700);
    text-decoration: none;
    font-family: 'articulat-cf', sans-serif;
    font-size: 14px;
    transition: background 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.pcm-dropdown-item:hover {
    background: var(--pcm-gray-50);
}

.pcm-dropdown-logout {
    color: var(--pcm-error);
}

.pcm-dropdown-logout:hover {
    background: var(--pcm-error-light);
}

/* ========== PAGE LAYOUT ========== */
.pcm-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
}

/* Page Title Bar */
.page-title-bar {
    background: linear-gradient(135deg, var(--pcm-navy) 0%, var(--pcm-navy-dark) 100%);
    padding: 24px 30px;
    color: white;
}

.page-title-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    margin: 0;
    font-family: 'articulat-cf', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: white;
}

.page-subtitle {
    margin: 6px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
    color: var(--pcm-gold-light);
}

/* ========== COMMON COMPONENTS ========== */

/* Stat Cards */
.pcm-stat-card {
    background: var(--pcm-white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pcm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.pcm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'articulat-cf', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.pcm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pcm-btn-gold {
    background: linear-gradient(135deg, var(--pcm-gold) 0%, var(--pcm-gold-light) 100%);
    color: white;
}

.pcm-btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pcm-gold-dark) 0%, var(--pcm-gold) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(170, 145, 91, 0.4);
}

.pcm-btn-navy {
    background: linear-gradient(135deg, var(--pcm-navy-medium) 0%, var(--pcm-navy-dark) 100%);
    color: white;
}

.pcm-btn-success {
    background: var(--pcm-success);
    color: white;
}

.pcm-btn-success:hover:not(:disabled) {
    background: #059669;
}

/* Generic Button Classes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'articulat-cf', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    color: var(--text-medium);
}

.btn-secondary:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.btn-primary, .btn-gold {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: white;
    border: none;
}

.btn-primary:hover, .btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-dark) 0%, #5A4A35 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

/* Badges */
.pcm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-family: 'articulat-cf', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pcm-badge-gold {
    background: var(--pcm-gold-100);
    color: var(--pcm-gold-dark);
}

.pcm-badge-success {
    background: var(--pcm-success-light);
    color: #065f46;
}

.pcm-badge-warning {
    background: var(--pcm-warning-light);
    color: #92400e;
}

.pcm-badge-error {
    background: var(--pcm-error-light);
    color: #991b1b;
}

/* Forms */
.pcm-input,
.pcm-select {
    width: 100%;
    padding: 12px 16px;
    font-family: 'big-caslon-fb', Georgia, serif;
    font-size: 15px;
    border: 2px solid var(--pcm-gray-200);
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
}

.pcm-input:focus,
.pcm-select:focus {
    outline: none;
    border-color: var(--pcm-gold);
    box-shadow: 0 0 0 3px rgba(170, 145, 91, 0.2);
}

.pcm-label {
    display: block;
    font-family: 'articulat-cf', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--pcm-gray-700);
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

/* Cards */
.pcm-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pcm-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--pcm-gray-100);
}

.pcm-card-body {
    padding: 20px;
}

/* Gold Accent Card */
.pcm-card.gold-accent {
    position: relative;
}

.pcm-card.gold-accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold-primary) 0%, var(--gold-light) 100%);
    border-radius: 16px 0 0 16px;
}

/* ========== TABS ========== */
.pcm-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px 8px 0 0;
    padding: 0 16px;
    overflow-x: auto;
}

.pcm-tab {
    padding: 16px 20px;
    background: none;
    border: none;
    font-family: 'articulat-cf', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.pcm-tab:hover {
    color: var(--gold-primary);
}

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

.pcm-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-primary);
}

.pcm-tab-content {
    display: none;
}

.pcm-tab-content.active {
    display: block;
}

/* ========== DATA TABLES ========== */
.pcm-table {
    width: 100%;
    border-collapse: collapse;
}

.pcm-table th {
    font-family: 'articulat-cf', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-cream);
    border-bottom: 2px solid var(--gold-primary);
}

.pcm-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.pcm-table tbody tr {
    transition: background 0.15s ease;
}

.pcm-table tbody tr:hover {
    background: var(--gold-50);
}

/* ========== STAT VALUES ========== */
.pcm-stat-value {
    font-family: 'big-caslon-fb', serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1;
}

.pcm-stat-label {
    font-family: 'articulat-cf', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-top: 6px;
}

.pcm-stat-trend {
    font-size: 12px;
    margin-top: 8px;
    color: var(--text-muted);
}

.pcm-stat-trend.up {
    color: var(--success-green);
}

.pcm-stat-trend.down {
    color: var(--danger-red);
}

/* ========== STATUS DOTS ========== */
.pcm-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.pcm-status-dot.active,
.pcm-status-dot.online,
.pcm-status-dot.busy {
    background: var(--success-green);
}

.pcm-status-dot.idle {
    background: var(--gold-primary);
}

.pcm-status-dot.error,
.pcm-status-dot.offline {
    background: var(--danger-red);
}

.pcm-status-dot.pulse {
    animation: pcmPulse 2s infinite;
}

@keyframes pcmPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== SCORE PILLS ========== */
.pcm-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pcm-score-high {
    background: #E8F5E9;
    color: #2E7D32;
}

.pcm-score-mid {
    background: #FFF3E0;
    color: #E65100;
}

.pcm-score-low {
    background: #FFEBEE;
    color: #C62828;
}

/* Status Badges (proposal/pipeline states) */
.pcm-badge-pending {
    background: #FFF3E0;
    color: #E65100;
}

.pcm-badge-approved {
    background: #E8F5E9;
    color: #2E7D32;
}

.pcm-badge-deployed {
    background: #E3F2FD;
    color: #1565C0;
}

.pcm-badge-rejected {
    background: #FFEBEE;
    color: #C62828;
}

/* ========== SECTION HEADERS ========== */
.pcm-section-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pcm-numbered-indicator {
    width: 28px;
    height: 28px;
    background-color: var(--text-dark);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'big-caslon-fb', serif;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.pcm-section-header {
    font-family: 'articulat-cf', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-light);
}

.pcm-section-divider {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--gold-light), transparent);
}

/* ========== LOADING & EMPTY STATES ========== */
.pcm-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: pcmSpin 1s linear infinite;
}

@keyframes pcmSpin {
    to { transform: rotate(360deg); }
}

.pcm-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 14px;
}

/* ========== PAGE TITLE BAR VARIANTS ========== */
.page-title-bar.light {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
}

.page-title-bar.light .page-title {
    font-family: 'big-caslon-fb', serif;
    color: var(--text-dark);
    font-weight: 500;
}

.page-title-bar.light .page-subtitle {
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 12px;
    opacity: 1;
}

/* ========== PROCESSING TIME ========== */
.pcm-time-ms {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
}

.pcm-time-fast { color: var(--success-green); }
.pcm-time-medium { color: var(--gold-primary); }
.pcm-time-slow { color: var(--danger-red); }

/* ========== ANIMATIONS ========== */
.pcm-fade-in {
    animation: pcmFadeIn 0.4s ease-out forwards;
}

@keyframes pcmFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .pcm-nav-link span:last-child {
        display: none;
    }
    
    .pcm-nav-link {
        padding: 8px 10px;
    }
    
    .pcm-logo-subtitle {
        display: none;
    }
}

@media (max-width: 768px) {
    .pcm-nav {
        display: none;
    }

    .pcm-header {
        padding: 10px 16px;
    }

    .pcm-logo-title {
        font-size: 14px;
    }

    .pcm-logo-icon {
        display: none;
    }
}

/* ========== SCROLLBAR ========== */
.pcm-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.pcm-scrollbar::-webkit-scrollbar-track {
    background: var(--pcm-gray-100);
    border-radius: 3px;
}

.pcm-scrollbar::-webkit-scrollbar-thumb {
    background: var(--pcm-gold-light);
    border-radius: 3px;
}

.pcm-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--pcm-gold);
}
