/* Lead Details Modal Styles */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    /* Blur background behind modal (premium) */
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);

    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;

    /* Keep header/footer inside viewport; only body scrolls */
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;

    /* Global modal header theme (purple + black accent) */
    background: var(--gradient-modal-header);
    color: white;

    border-radius: 12px 12px 0 0;
    flex: 0 0 auto;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    font-size: 18px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.lead-details-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 20px;
}

.detail-section {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h3 i {
    color: #667eea;
    font-size: 18px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.detail-value {
    color: #333;
    font-size: 14px;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.detail-value a {
    color: #667eea;
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

.notes-box {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    min-height: 70px;
    color: #333;
    line-height: 1.5;
    font-size: 13px;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}

.modal-footer .btn {
    padding: 10px 24px;
}

/* Badge styles for modal */
.detail-value .badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #4caf50;
    color: white;
}

.badge-primary {
    background: #2196f3;
    color: white;
}

.badge-warning {
    background: #ff9800;
    color: white;
}

.badge-purple {
    background: #9c27b0;
    color: white;
}

.badge-secondary {
    background: #757575;
    color: white;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: #667eea;
    font-size: 14px;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* Toast Notifications */
.toast {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 150px !important;
    overflow-y: auto !important;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast i {
    font-size: 20px;
}

.toast-success i {
    color: #4caf50;
}

.toast-error i {
    color: #f44336;
}

.toast span {
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    flex: 1 !important;
}

/* Button Styles */
.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        max-height: 90vh;
    }
    
    .lead-details-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-value {
        text-align: left;
        max-width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .toast {
        right: 15px;
        left: 15px;
        min-width: auto;
    }
}

/* Hover effect on table rows */
.data-table tbody tr:hover {
    background: #f5f5f5;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}
