/* ============================================ */
/* PHASE 2 STYLES - LEAD DETAIL MODAL & FOLLOW-UPS */
/* ============================================ */

/* ============================================ */
/* LEAD DETAIL MODAL */
/* ============================================ */

.lead-detail-container {
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    padding: 0;
}

.lead-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.lead-detail-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.lead-summary-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lead-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.lead-summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.lead-meta-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.lead-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.lead-meta-item .material-icons-round {
    font-size: 18px;
    color: var(--primary);
}

.lead-score-display,
.lead-age-display {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.lead-score-display strong,
.lead-age-display strong {
    color: var(--text-main);
}

/* Quick Actions */
.lead-quick-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.lead-quick-actions .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

/* Tabs */
.lead-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.lead-tab {
    padding: 0.8rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -2px;
}

.lead-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.lead-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.lead-tab .material-icons-round {
    font-size: 20px;
}

/* Tab Content */
.lead-tab-content {
    padding: 2rem;
    min-height: 400px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* Details Tab */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.detail-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-main);
    font-weight: 500;
    text-align: right;
}

/* Activity Timeline */
.activity-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-left: 2px solid rgba(99, 102, 241, 0.3);
    padding-left: 2rem;
    position: relative;
    margin-left: 1rem;
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 1.8rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

.timeline-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Notes Section */
.notes-section {
    max-width: 800px;
    margin: 0 auto;
}

.notes-add {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.notes-add textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    padding: 1rem;
    margin-bottom: 1rem;
    resize: vertical;
    min-height: 100px;
}

.notes-add textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.note-author {
    font-weight: 600;
    color: var(--primary);
}

.note-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.note-content {
    color: var(--text-main);
    line-height: 1.6;
}

/* ============================================ */
/* FOLLOW-UP SCHEDULER MODAL */
/* ============================================ */

#followup-modal .modal {
    padding: 2rem;
}

#followup-form {
    margin-top: 1.5rem;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 768px) {
    .lead-detail-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .lead-summary-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .lead-quick-actions {
        flex-direction: column;
    }

    .lead-quick-actions .btn {
        width: 100%;
    }

    .lead-tabs {
        overflow-x: auto;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================ */
/* FOLLOW-UP BOARD (for later in Phase 2) */
/* ============================================ */

.followup-board {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.followup-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.followup-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.followup-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.followup-count {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.followup-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.followup-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.followup-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateX(4px);
}

.followup-item.overdue {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.followup-item.today {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.followup-item.upcoming {
    border-left: 4px solid var(--success);
}

.followup-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.followup-indicator.red {
    background: var(--danger);
    animation: pulse 2s infinite;
}

.followup-indicator.yellow {
    background: var(--warning);
}

.followup-indicator.green {
    background: var(--success);
}

.followup-info {
    flex: 1;
}

.followup-lead-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.followup-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.followup-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.followup-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================ */
/* UTILITIES */
/* ============================================ */

.color-danger {
    color: var(--danger);
}

.color-warning {
    color: var(--warning);
}

.bg-danger-light {
    background: rgba(239, 68, 68, 0.1);
}

.bg-warning-light {
    background: rgba(245, 158, 11, 0.1);
}

.bg-success-light {
    background: rgba(16, 185, 129, 0.1);
}