/**
 * CFP Portal Styles
 * Professional styling for financial planners
 */

/* Import client portal base styles */
@import url('../client-portal/portal-styles.css');

/* CFP-Specific Color Overrides */
:root {
    --cfp-primary: #1e3a8a;
    --cfp-secondary: #0f766e;
    --cfp-accent: #22c55e;
    --cfp-warning: #f59e0b;
    --cfp-danger: #ef4444;
}

/* CFP Portal Header */
.cfp-header {
    background: linear-gradient(135deg, var(--cfp-primary) 0%, var(--cfp-secondary) 100%);
    padding: 25px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    color: white;
}

.cfp-header h1 {
    color: white;
    margin-bottom: 5px;
}

.cfp-header p {
    color: rgba(255, 255, 255, 0.9);
}

/* Client Cards */
.client-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.client-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-tertiary);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.client-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 5px;
}

.client-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.client-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.client-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.client-info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Client Grid */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid var(--border-color);
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--accent-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: linear-gradient(135deg, var(--cfp-primary) 0%, var(--cfp-secondary) 100%);
    padding: 25px;
    border-radius: 12px;
    color: white;
    text-align: center;
}

.stat-box-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-box-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Search and Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.filter-dropdown {
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Select Dropdown Options - High Contrast for Dark Mode */
select option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px;
}

select option:checked,
select option:hover {
    background: #3b82f6;
    color: white;
}

/* Improve all form selects */
select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 1rem;
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Portal Access Status */
.portal-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.portal-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.portal-status.inactive {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.portal-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* ===================================
   Life Stage Badges & Color Coding
   =================================== */

/* Base life stage badge styles (neutral when color coding is OFF) */
.life-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    transition: all 0.3s ease;
}

/* Life stage badge icon */
.life-stage-badge svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* Color-enabled life stage badges */
.life-stage-badge.color-enabled.stage-early_career {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.life-stage-badge.color-enabled.stage-mid_career {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.life-stage-badge.color-enabled.stage-peak_earning {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.life-stage-badge.color-enabled.stage-pre_retirement {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.life-stage-badge.color-enabled.stage-retirement {
    background: rgba(100, 181, 246, 0.2);
    color: #64b5f6;
}

.life-stage-badge.color-enabled.stage-not_set {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Client card border color coding (when enabled) */
.client-card.color-coded {
    transition: border-left 0.3s ease;
}

.client-card.color-coded.stage-early_career {
    border-left: 4px solid #8b5cf6;
}

.client-card.color-coded.stage-mid_career {
    border-left: 4px solid #00d4ff;
}

.client-card.color-coded.stage-peak_earning {
    border-left: 4px solid #22c55e;
}

.client-card.color-coded.stage-pre_retirement {
    border-left: 4px solid #f59e0b;
}

.client-card.color-coded.stage-retirement {
    border-left: 4px solid #64b5f6;
}

.client-card.color-coded.stage-not_set {
    border-left: 4px solid #9ca3af;
}

/* Color coding toggle button */
.color-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-toggle-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.color-toggle-btn.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.color-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Quick Actions Menu */
.quick-actions {
    position: relative;
}

.quick-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}

.quick-actions-menu.show {
    display: block;
}

.quick-actions-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-primary);
}

.quick-actions-item:hover {
    background: var(--bg-tertiary);
}

/* Section Intelligence Badges */
.intelligence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-neutral {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.intelligence-tooltip {
    position: relative;
    cursor: help;
}

.intelligence-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: var(--shadow-lg);
}

.section-intelligence-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .client-grid {
        grid-template-columns: 1fr;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .search-filter-bar {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .modal {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
}
