/* =============================================
   Unlocked Contacts Styles - ScambioAuto
   ============================================= */

/* Panel con lista contatti */
.unlocked-contacts-panel {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Badge nuovi contatti */
.badge-primary {
    background: var(--primary-color, #3b82f6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Select filtro */
.form-select-sm {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background-color: white;
}

/* Lista contatti */
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card contatto */
.contact-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--surface-secondary, #f9fafb);
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-card:hover {
    background: var(--surface-hover, #f3f4f6);
    border-color: var(--primary-light, #dbeafe);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-card.status-new {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--primary-color, #3b82f6);
}

.contact-card.status-archived {
    opacity: 0.7;
    background: var(--surface-muted, #f3f4f6);
}

/* Avatar contatto */
.contact-avatar {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #e5e7eb);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-muted, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #6b7280);
    font-size: 1.5rem;
}

.new-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--primary-color, #3b82f6);
    border-radius: 50%;
    border: 2px solid white;
}

/* Info contatto */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dealer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--info-color, #06b6d4);
    background: rgba(6, 182, 212, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.contact-business {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.contact-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted, #9ca3af);
}

/* Mini listing */
.contact-listings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.listing-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.listing-mini.target {
    color: var(--text-primary, #111827);
    font-weight: 500;
}

/* Meta contatto */
.contact-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.origin-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.origin-badge.match {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
}

.origin-badge.proposal {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

.status-badge.primary {
    background: var(--primary-color, #3b82f6);
    color: white;
}

.status-badge.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color, #06b6d4);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color, #f59e0b);
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
}

.status-badge.secondary {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted, #6b7280);
}

.contact-meta .date {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

/* Azioni contatto */
.contact-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--primary-color, #3b82f6);
    color: white;
    border-color: var(--primary-color, #3b82f6);
}

/* =============================================
   Contact Detail Page Styles
   ============================================= */

.contact-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.detail-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary-color, #3b82f6);
}

.detail-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0;
}

/* Layout a 2 colonne */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Card controparte */
.counterpart-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.counterpart-card {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.counterpart-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
}

.counterpart-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color, #e5e7eb);
}

.counterpart-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-muted, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted, #6b7280);
}

.counterpart-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.verified-badge {
    color: var(--success-color, #10b981);
    font-size: 1.25rem;
}

.business-name {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    margin: 0 0 1rem;
}

.counterpart-card .location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 1.5rem;
}

/* Canali di contatto */
.contact-channels {
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.contact-channels h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin: 0 0 1rem;
}

.channel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-secondary, #f9fafb);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text-primary, #111827);
    transition: all 0.2s ease;
}

.channel:hover {
    background: var(--primary-light, #dbeafe);
    color: var(--primary-color, #3b82f6);
}

.channel.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.channel.whatsapp:hover {
    background: #25d366;
    color: white;
}

/* Privacy notice */
.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.privacy-notice iconify-icon {
    color: var(--success-color, #10b981);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.privacy-notice p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

/* Status card */
.status-card {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.status-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 1rem;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.875rem;
    background-color: white;
    margin-bottom: 1rem;
}

/* Timeline */
.status-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #f3f4f6);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.timeline-event {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

/* Listings section */
.listings-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.listings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0;
}

/* Comparison cards */
.listings-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
    .listings-comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .exchange-arrow {
        transform: rotate(90deg);
    }
}

.listing-card {
    text-align: center;
    padding: 1rem;
    background: var(--surface-secondary, #f9fafb);
    border-radius: 8px;
}

.listing-card .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.listing-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 0.25rem;
}

.listing-card p {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

.exchange-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-light, #dbeafe);
    border-radius: 50%;
    color: var(--primary-color, #3b82f6);
    font-size: 1.25rem;
}

/* Notes section */
.notes-section {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.notes-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 1rem;
}

.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1rem;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-secondary, #6b7280);
}

.btn-outline:hover {
    background: var(--surface-secondary, #f9fafb);
    border-color: var(--text-muted, #9ca3af);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted, #6b7280);
}

.btn-ghost:hover {
    background: var(--surface-secondary, #f9fafb);
    color: var(--text-secondary, #374151);
}

/* Actions section */
.actions-section {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Responsive */
@media (max-width: 1024px) {
    .contact-card {
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
    }
    
    .contact-listings {
        display: none;
    }
    
    .contact-meta {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .contact-meta .date {
        display: none;
    }
}

@media (max-width: 640px) {
    .contact-card {
        grid-template-columns: auto 1fr;
    }
    
    .contact-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}
