/* Client Detail Page Styles */
/* File: Pages/public/css/components/client-detail.css */
/* Styling for the client detail page component */

/* =============================================================================
   CLIENT DETAIL PAGE LAYOUT
============================================================================= */

.client-detail-page {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--primary-color-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 300;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* =============================================================================
   CLIENT HEADER
============================================================================= */

.client-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.client-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.client-info {
    flex: 1;
}

.client-name {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.client-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tier-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-basic { background: var(--bg-muted); color: var(--text-secondary); }
.tier-standard { background: #e0f2fe; color: #0277bd; }
.tier-premium { background: #f3e5f5; color: #7b1fa2; }
.tier-enterprise { background: #fff3e0; color: #ef6c00; }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active { background: #e8f5e8; color: #2e7d32; }
.status-suspended { background: #fff3e0; color: #ef6c00; }
.status-pending { background: #e3f2fd; color: #1976d2; }
.status-cancelled { background: #ffebee; color: #c62828; }

.budget-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.client-contact {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.contact-name {
    font-weight: 500;
}

.contact-email a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

.client-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* =============================================================================
   STATS CARDS
============================================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* =============================================================================
   TAB NAVIGATION
============================================================================= */

.tab-navigation {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* =============================================================================
   TAB CONTENT
============================================================================= */

.tab-content {
    margin-top: 1.5rem;
}

.tab-pane {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 400px;
}

.tab-pane.active {
    display: block;
}

/* =============================================================================
   COMMUNICATIONS TAB
============================================================================= */

.communications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.communications-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.communications-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.communication-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.communication-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-hover);
}

.comm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comm-type {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comm-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comm-date {
    font-family: var(--font-mono);
}

.comm-content {
    color: var(--text-primary);
    line-height: 1.6;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

/* Badge styles for intent detection */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: #e3f2fd; color: #1976d2; }
.badge-success { background: #e8f5e8; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #ef6c00; }
.badge-secondary { background: var(--bg-muted); color: var(--text-secondary); }

/* =============================================================================
   EMPTY STATES
============================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================================================
   LOADING AND ERROR STATES
============================================================================= */

.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.loading-spinner {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--error-color);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h3 {
    color: var(--error-color);
    margin-bottom: 0.5rem;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* =============================================================================
   RESPONSIVE DESIGN
============================================================================= */

@media (max-width: 768px) {
    .client-detail-page {
        padding: 1rem;
    }
    
    .client-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .client-actions {
        flex-direction: row;
        align-self: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-button {
        text-align: left;
        justify-content: flex-start;
    }
    
    .communications-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .comm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .client-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* =============================================================================
   PLACEHOLDER STATES
============================================================================= */

.placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
    color: transparent;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.stats-placeholder,
.client-header.placeholder {
    height: 100px;
    margin-bottom: 1rem;
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
============================================================================= */

.tab-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.client-actions .btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stat-card {
        border-width: 2px;
    }
    
    .communication-item {
        border-width: 2px;
    }
    
    .tab-button.active {
        border: 2px solid var(--primary-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .communication-item,
    .tab-button {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .placeholder {
        animation: none;
        background: #f0f0f0;
    }
}