/* AI-Header: Contact Exchange Component Styles - Card selection and identity card display */
/* Date: 2025-08-18 */

/* ===========================================
   CONTACT EXCHANGE STEP 1 - SEARCH STYLES
   =========================================== */

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary, #722F37) 0%, #8B4A52 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    flex-shrink: 0;
}

.member-result-row {
    transition: all 0.2s ease;
    cursor: pointer;
}

.member-result-row:hover {
    background-color: var(--bs-tertiary-bg, rgba(255, 255, 255, 0.1)) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-active {
    background-color: var(--bs-primary-bg-subtle, rgba(114, 47, 55, 0.15)) !important;
    border-left: 3px solid var(--bs-primary, #722F37);
}

.table-active:hover {
    background-color: var(--bs-primary-bg-subtle, rgba(114, 47, 55, 0.2)) !important;
}

.member-result-row:hover .bi-arrow-right {
    color: var(--bs-primary, #722F37) !important;
    transform: translateX(2px);
    transition: all 0.2s ease;
}

.bi-arrow-right {
    transition: all 0.2s ease;
}

/* ===========================================
   CONTACT EXCHANGE STEP 2 - CARD SELECTION
   =========================================== */

.identity-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.identity-card-item {
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.identity-card-item:hover {
    background-color: #e9ecef;
    border-color: var(--bs-primary);
}

.identity-card-item.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--bs-primary);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-handle {
    margin: 0 0 4px 0;
    font-weight: 700;
    font-size: 18px;
    color: #212529;
    font-family: monospace;
}

.card-name {
    margin: 0 0 4px 0;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
}

.card-company {
    margin: 0 0 2px 0;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.card-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #6c757d;
}

.contact-methods {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.contact-icon {
    color: #6c757d;
    font-size: 14px;
}

.selection-indicator {
    flex-shrink: 0;
    color: var(--bs-primary);
    font-size: 20px;
}

/* ===========================================
   DARK THEME SUPPORT
   =========================================== */

[data-bs-theme="dark"] .identity-card-item {
    background-color: #343a40;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .identity-card-item:hover {
    background-color: #495057;
}

[data-bs-theme="dark"] .identity-card-item.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .card-name {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .card-handle {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .card-company {
    color: #adb5bd;
}

[data-bs-theme="dark"] .card-title {
    color: #adb5bd;
}

    [data-bs-theme="dark"] .contact-icon {
        color: #adb5bd;
    }

/* ===========================================
   CONTACT EXCHANGE STEP 3 - CONFIRMATION
   =========================================== */

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.page-subtitle {
    font-size: 1rem;
    color: #adb5bd;
    margin: 0;
}

.exchange-container {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.exchange-card-wrapper {
    flex: 1;
    display: flex;
}

.exchange-card {
    background-color: #2a2d31;
    border-radius: 16px;
    padding: 24px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.exchange-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 24px;
}

.exchange-card-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.exchange-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B4A52 0%, #722F37 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    flex-shrink: 0;
}

.my-card-avatar {
    background: linear-gradient(135deg, #722F37 0%, #8B4A52 100%);
}

.exchange-info {
    flex: 1;
    min-width: 0;
}

.exchange-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.exchange-role {
    font-size: 0.875rem;
    color: #adb5bd;
    margin-bottom: 4px;
}

.exchange-company {
    font-size: 0.875rem;
    color: #adb5bd;
    margin-bottom: 8px;
}

.exchange-handle {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-family: monospace;
}

.exchange-searchable-badge {
    display: inline-flex;
    align-items: center;
    background-color: #28a745;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
}

.exchange-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 8px;
}

.exchange-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #6c757d;
}

.message-section {
    background-color: #2a2d31;
    border-radius: 16px;
    padding: 24px;
}

.message-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

.message-textarea {
    background-color: #1e2125;
    border: 1px solid #495057;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 12px;
    resize: vertical;
    min-height: 100px;
}

.message-textarea:focus {
    background-color: #1e2125;
    border-color: #722F37;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(114, 47, 55, 0.25);
}

.message-textarea::placeholder {
    color: #6c757d;
}

.character-count {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 8px;
}

.send-request-btn {
    background-color: #722F37;
    border-color: #722F37;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 8px;
    min-width: 200px;
}

.send-request-btn:hover {
    background-color: #8B4A52;
    border-color: #8B4A52;
    color: #ffffff;
}

.send-request-btn:focus {
    background-color: #8B4A52;
    border-color: #8B4A52;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(114, 47, 55, 0.25);
}

.send-request-btn:disabled {
    background-color: #495057;
    border-color: #495057;
    color: #6c757d;
}

/* Light Theme Overrides */
[data-bs-theme="light"] .page-title {
    color: #212529;
}

[data-bs-theme="light"] .page-subtitle {
    color: #6c757d;
}

[data-bs-theme="light"] .exchange-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

[data-bs-theme="light"] .exchange-card-title {
    color: #212529;
}

[data-bs-theme="light"] .exchange-name {
    color: #212529;
}

[data-bs-theme="light"] .exchange-role {
    color: #6c757d;
}

[data-bs-theme="light"] .exchange-company {
    color: #6c757d;
}

[data-bs-theme="light"] .exchange-handle {
    color: #495057;
}

[data-bs-theme="light"] .exchange-icon {
    background-color: transparent;
    color: #495057;
}

[data-bs-theme="light"] .message-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

[data-bs-theme="light"] .message-title {
    color: #212529;
}

[data-bs-theme="light"] .message-textarea {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #212529;
}

[data-bs-theme="light"] .message-textarea:focus {
    background-color: #ffffff;
    border-color: #722F37;
    color: #212529;
    box-shadow: 0 0 0 0.2rem rgba(114, 47, 55, 0.25);
}

[data-bs-theme="light"] .message-textarea::placeholder {
    color: #6c757d;
}

[data-bs-theme="light"] .character-count {
    color: #6c757d;
}

.identity-card-display {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
}

[data-bs-theme="dark"] .identity-card-display {
    background-color: #343a40;
    color: #f8f9fa;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */
@media (max-width: 768px) {
    .identity-card-item {
        padding: 12px;
    }
    
    .card-content {
        gap: 12px;
    }
    
    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .card-handle {
        font-size: 16px;
    }
    
    .card-name {
        font-size: 13px;
    }
    
    .card-company,
    .card-title {
        font-size: 12px;
    }

    /* Step 3 Mobile Styles */
    .page-title {
        font-size: 1.5rem;
    }
    
    .exchange-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .exchange-icon-wrapper {
        order: 2;
        padding: 8px 0;
    }
    
    .exchange-card-wrapper:first-child {
        order: 1;
    }
    
    .exchange-card-wrapper:last-child {
        order: 3;
    }
    
    .exchange-card {
        padding: 16px;
        min-height: 150px;
    }
    
    .exchange-avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    
    .exchange-name {
        font-size: 1rem;
    }
    
    .exchange-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .message-section {
        padding: 16px;
    }
    
    .send-request-btn {
        padding: 10px 24px;
        min-width: 160px;
    }
}

/* ===========================================
   ACCESSIBILITY IMPROVEMENTS
   =========================================== */

.identity-card-item:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .identity-card-item {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .identity-card-item {
        border-width: 3px;
    }
    
    .identity-card-item.selected {
        border-width: 3px;
    }
}
