/* Leads Dashboard Styles */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 20px 0 10px 0;
    color: #666;
    font-size: 24px;
}

.empty-state p {
    color: #999;
    font-size: 16px;
}

/* Leads Stats */
.leads-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-content h4 {
    margin: 0 0 5px 0;
    font-size: 32px;
    color: #333;
    font-weight: 600;
}

.stat-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Table Wrapper */
.table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Leads Table */
.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.leads-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
}

.leads-table thead th i {
    margin-right: 5px;
}

.leads-table tbody tr {
    border-bottom: 1px solid #f1f1f1;
    transition: all 0.3s;
}

.leads-table tbody tr:hover {
    background: #f9f9ff;
}

.leads-table tbody td {
    padding: 15px;
    font-size: 14px;
    color: #333;
}

.leads-table tbody td strong {
    color: #667eea;
}

.leads-table tbody td a {
    color: #667eea;
    text-decoration: none;
}

.leads-table tbody td a:hover {
    text-decoration: underline;
}

/* Source Badge */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.source-badge i {
    font-size: 11px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    background: #f5f7ff;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.btn-icon.btn-danger {
    background: #ffe5e5;
    color: #ff4757;
}

.btn-icon.btn-danger:hover {
    background: #ff4757;
    color: white;
}

/* Conversation Modal */
.conversation-modal .modal-content {
    max-width: 700px;
}

.conversation-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f5f7ff;
}

.conversation-message {
    display: flex;
    margin-bottom: 20px;
    gap: 12px;
}

.conversation-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conversation-message.user .message-avatar {
    background: #667eea;
    color: white;
}

.conversation-message.bot .message-avatar {
    background: #f093fb;
    color: white;
}

.message-bubble {
    max-width: 70%;
}

.message-text {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.conversation-message.user .message-text {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.conversation-message.bot .message-text {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 16px;
}

.conversation-message.user .message-time {
    text-align: right;
}

/* Lead Details Modal */
.lead-details {
    padding: 10px 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f1f1f1;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-label i {
    color: #667eea;
}

.detail-value {
    color: #333;
    word-wrap: break-word;
}

.detail-value code {
    background: #f5f7ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Export Button */
.export-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.export-button i {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .leads-stats {
        grid-template-columns: 1fr;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .leads-table {
        min-width: 800px;
    }
    
    .detail-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .detail-label {
        font-weight: 600;
    }
    
    .conversation-container {
        max-height: 400px;
    }
    
    .message-bubble {
        max-width: 80%;
    }
}

/* Modal Specific Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal.active,
.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: #667eea;
}

.modal-close {
    background: #f1f1f1;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #f1f1f1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f1f1f1;
    color: #666;
}

.btn-secondary:hover {
    background: #e1e1e1;
}

