﻿/* ================================================================ */
/* CONTACTS.CSS - CRM/Contact Management Styles                     */
/* ================================================================ */

/* ===== CONTACT LIST MODAL ===== */
.contact-list-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 70vh;
}

.contact-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.contact-list-info h4 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

[data-theme="dark"] .contact-list-info h4 {
    color: #f9fafb;
}

.contact-list-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted, #6b7280);
}

.contact-list-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #00b3c9, #0369a1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

    .contact-list-action-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

    .contact-list-action-btn .material-icons {
        font-size: 18px;
    }

/* ===== CONTACT LIST ITEMS ===== */
.contact-list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.contact-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="dark"] .contact-list-item {
    background: #1e293b;
    border-color: #334155;
}

.contact-list-item:hover {
    background: var(--bg-secondary, #f3f4f6);
    border-color: var(--primary, #00b3c9);
    transform: translateX(4px);
}

[data-theme="dark"] .contact-list-item:hover {
    background: #0f172a;
    border-color: #00b3c9;
}

.contact-item-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b3c9, #0369a1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.contact-item-info {
    flex: 1;
    min-width: 0;
}

.contact-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin-bottom: 2px;
}

[data-theme="dark"] .contact-item-name {
    color: #f9fafb;
}

.contact-item-title {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 2px;
}

.contact-item-company {
    font-size: 13px;
    color: var(--text-light, #9ca3af);
}

.contact-item-badges {
    display: flex;
    gap: 6px;
}

.contact-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-secondary, #e5e7eb);
    border-radius: 6px;
    transition: all 0.2s;
}

[data-theme="dark"] .contact-badge {
    background: #334155;
}

.contact-badge .material-icons {
    font-size: 16px;
    color: var(--text-muted, #6b7280);
}

.contact-badge:hover {
    background: var(--primary, #00b3c9);
}

    .contact-badge:hover .material-icons {
        color: white;
    }

/* ===== CONTACT DETAILS MODAL ===== */
.contact-details-modal {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.contact-details-header {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border, #e5e7eb);
}

[data-theme="dark"] .contact-details-header {
    border-color: #334155;
}

.contact-details-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b3c9, #0369a1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}

.contact-details-info h3 {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

[data-theme="dark"] .contact-details-info h3 {
    color: #f9fafb;
}

.contact-details-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text-muted, #6b7280);
}

.contact-details-company {
    margin: 0;
    font-size: 15px;
    color: var(--text-light, #9ca3af);
}

/* ===== CONTACT DETAILS SECTION ===== */
.contact-details-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .contact-details-section h4 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 8px 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary, #1f2937);
    }

[data-theme="dark"] .contact-details-section h4 {
    color: #f9fafb;
}

.contact-details-section h4 .material-icons {
    font-size: 20px;
    color: var(--primary, #00b3c9);
}

.contact-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-light, #f9fafb);
    border-radius: 8px;
    transition: all 0.2s;
}

[data-theme="dark"] .contact-detail-row {
    background: #1e293b;
}

.contact-detail-row:hover {
    background: var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .contact-detail-row:hover {
    background: #0f172a;
}

.contact-detail-row .material-icons {
    font-size: 20px;
    color: var(--text-muted, #6b7280);
}

.contact-detail-row a {
    flex: 1;
    color: var(--primary, #00b3c9);
    text-decoration: none;
    font-size: 14px;
}

    .contact-detail-row a:hover {
        text-decoration: underline;
    }

.contact-detail-row span {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary, #1f2937);
}

[data-theme="dark"] .contact-detail-row span {
    color: #e5e7eb;
}

.contact-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .contact-copy-btn:hover {
        background: var(--bg-secondary, #e5e7eb);
    }

[data-theme="dark"] .contact-copy-btn:hover {
    background: #334155;
}

.contact-copy-btn .material-icons {
    font-size: 18px;
    color: var(--text-muted, #6b7280);
}

.contact-copy-btn.copied .material-icons {
    color: #10b981;
}

/* ===== CONTACT TIMELINE ===== */
.contact-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 12px;
    position: relative;
}

    .timeline-item:not(:last-child)::before {
        content: '';
        position: absolute;
        left: 15px;
        top: 36px;
        width: 2px;
        height: calc(100% + 4px);
        background: var(--border, #e5e7eb);
    }

[data-theme="dark"] .timeline-item:not(:last-child)::before {
    background: #334155;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light, #f3f4f6);
    border: 2px solid var(--border, #e5e7eb);
    z-index: 1;
}

[data-theme="dark"] .timeline-icon {
    background: #1e293b;
    border-color: #334155;
}

.timeline-icon .material-icons {
    font-size: 16px;
    color: var(--text-muted, #6b7280);
}

.timeline-icon.emailsent {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-color: #60a5fa;
}

    .timeline-icon.emailsent .material-icons {
        color: #2563eb;
    }

.timeline-icon.emailreceived {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #4ade80;
}

    .timeline-icon.emailreceived .material-icons {
        color: #16a34a;
    }

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    margin-bottom: 4px;
}

[data-theme="dark"] .timeline-title {
    color: #f9fafb;
}

.timeline-time {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

.timeline-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

[data-theme="dark"] .timeline-badge {
    background: #14532d;
    color: #4ade80;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .contact-list-header {
        flex-direction: column;
        gap: 12px;
    }

    .contact-list-action-btn {
        width: 100%;
        justify-content: center;
    }

    .contact-details-header {
        flex-direction: column;
        text-align: center;
    }

    .contact-details-avatar {
        margin: 0 auto;
    }
}
/* ================================================================ */
/* CONTACTS ENHANCEMENTS - Loading, Filters, Expand, Email         */
/* ================================================================ */

/* ===== LOADING MODAL ===== */
.loading-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border, #e5e7eb);
    border-top-color: var(--primary, #00b3c9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

[data-theme="dark"] .loading-spinner {
    border-color: #334155;
    border-top-color: #00b3c9;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-modal-content p {
    color: var(--text-muted, #6b7280);
    font-size: 15px;
    margin: 0;
}

/* ===== MODAL EXPANDED STATE ===== */
.modal-expanded {
    max-width: 95vw !important;
    width: 95vw !important;
    max-height: 95vh !important;
    height: 95vh !important;
}

    .modal-expanded .contact-list-items {
        max-height: calc(95vh - 250px) !important;
    }

/* ===== CONTACT FILTER BAR ===== */
.contact-filter-bar {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-light, #f9fafb);
    border-radius: 8px;
    margin-bottom: 16px;
}

[data-theme="dark"] .contact-filter-bar {
    background: #1e293b;
}

.contact-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}

[data-theme="dark"] .contact-search {
    background: #0f172a;
    border-color: #334155;
}

.contact-search .material-icons {
    font-size: 20px;
    color: var(--text-muted, #6b7280);
}

.contact-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-primary, #1f2937);
    outline: none;
}

[data-theme="dark"] .contact-search input {
    color: #e5e7eb;
}

.contact-search input::placeholder {
    color: var(--text-muted, #9ca3af);
}

.contact-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}

[data-theme="dark"] .contact-sort {
    background: #0f172a;
    border-color: #334155;
}

.contact-sort .material-icons {
    font-size: 20px;
    color: var(--text-muted, #6b7280);
}

.contact-sort select {
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-primary, #1f2937);
    outline: none;
    cursor: pointer;
}

[data-theme="dark"] .contact-sort select {
    color: #e5e7eb;
}

/* ===== CONTACT LIST ACTIONS ===== */
.contact-list-actions {
    display: flex;
    gap: 8px;
}

.contact-list-action-btn.secondary {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-primary, #1f2937);
}

[data-theme="dark"] .contact-list-action-btn.secondary {
    background: #1e293b;
    color: #e5e7eb;
}

.contact-list-action-btn.secondary:hover {
    background: var(--bg-light, #e5e7eb);
}

[data-theme="dark"] .contact-list-action-btn.secondary:hover {
    background: #0f172a;
}

/* ===== CONTACT DETAILS NAVIGATION ===== */
.contact-details-nav {
    margin-bottom: 16px;
}

.contact-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary, #f3f4f6);
    border: none;
    border-radius: 6px;
    color: var(--text-primary, #1f2937);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="dark"] .contact-back-btn {
    background: #1e293b;
    color: #e5e7eb;
}

.contact-back-btn:hover {
    background: var(--bg-light, #e5e7eb);
    transform: translateX(-2px);
}

[data-theme="dark"] .contact-back-btn:hover {
    background: #0f172a;
}

.contact-back-btn .material-icons {
    font-size: 18px;
}

/* ===== EMAIL COMPOSE MODAL ===== */
.email-compose-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.email-compose-header {
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border, #e5e7eb);
}

[data-theme="dark"] .email-compose-header {
    border-color: #334155;
}

.email-recipient {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .email-recipient .material-icons {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #00b3c9, #0369a1);
        color: white;
        border-radius: 50%;
        font-size: 20px;
    }

.email-recipient-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin-bottom: 2px;
}

[data-theme="dark"] .email-recipient-name {
    color: #f9fafb;
}

.email-recipient-email {
    font-size: 14px;
    color: var(--text-muted, #6b7280);
}

.email-compose-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.email-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .email-form-group label {
        font-size: 14px;
        font-weight: 500;
        color: var(--text-primary, #1f2937);
    }

[data-theme="dark"] .email-form-group label {
    color: #e5e7eb;
}

.email-form-group input,
.email-form-group textarea {
    padding: 12px;
    background: var(--bg-light, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #1f2937);
    font-family: inherit;
    transition: all 0.2s;
}

[data-theme="dark"] .email-form-group input,
[data-theme="dark"] .email-form-group textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

.email-form-group input:focus,
.email-form-group textarea:focus {
    outline: none;
    border-color: var(--primary, #00b3c9);
    background: white;
}

[data-theme="dark"] .email-form-group input:focus,
[data-theme="dark"] .email-form-group textarea:focus {
    background: #0f172a;
}

.email-form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.email-compose-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e5e7eb);
}

[data-theme="dark"] .email-compose-footer {
    border-color: #334155;
}

.email-compose-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

    .email-compose-btn.secondary {
        background: var(--bg-secondary, #f3f4f6);
        color: var(--text-primary, #1f2937);
    }

[data-theme="dark"] .email-compose-btn.secondary {
    background: #1e293b;
    color: #e5e7eb;
}

.email-compose-btn.secondary:hover {
    background: var(--bg-light, #e5e7eb);
}

[data-theme="dark"] .email-compose-btn.secondary:hover {
    background: #0f172a;
}

.email-compose-btn.primary {
    background: linear-gradient(135deg, #00b3c9, #0369a1);
    color: white;
}

    .email-compose-btn.primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

.email-compose-btn .material-icons {
    font-size: 18px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .contact-filter-bar {
        flex-direction: column;
    }

    .contact-sort {
        width: 100%;
    }

        .contact-sort select {
            width: 100%;
        }

    .modal-expanded {
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }

    .email-compose-footer {
        flex-direction: column;
    }

    .email-compose-btn {
        width: 100%;
        justify-content: center;
    }
}