/**
 * Contact Selection Modal Styles
 * 
 * Styles for the reusable contact selection modal component.
 * Matches the existing design system of the application.
 */

.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;  /* Max z-index to ensure it's above everything including browser extensions */
    animation: fadeIn 0.2s ease-out;
    pointer-events: auto;
}

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

.contact-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
    position: relative;
    z-index: 2147483647;  /* Max z-index to ensure it's above everything */
}

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

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

.contact-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.contact-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.contact-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.contact-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.contact-mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.contact-mode-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    background-color: #f9fafb;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-mode-btn:hover {
    border-color: #667eea;
    background-color: #f0f4ff;
    color: #667eea;
}

.contact-mode-btn.active {
    border-color: #667eea;
    background-color: #667eea;
    color: white;
}

.contact-mode-btn i {
    font-size: 1.1rem;
}

.contact-section {
    animation: fadeIn 0.3s ease-out;
    pointer-events: auto;
}

.contact-section input,
.contact-section textarea,
.contact-section select {
    pointer-events: auto !important;
    user-select: text !important;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 6px;
    color: #667eea;
}

.contact-modal-overlay .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

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

.contact-modal-overlay .form-control:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.contact-loading,
.contact-error {
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 0.95rem;
}

.contact-loading {
    background-color: #eff6ff;
    color: #1e40af;
}

.contact-loading i {
    margin-right: 8px;
}

.contact-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.form-validation-error {
    padding: 12px 16px;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.95rem;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-validation-error i {
    font-size: 1.1rem;
}

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

.btn-secondary,
.btn-primary {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e5e7eb;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary:disabled,
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom select styling */
.contact-modal-overlay select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    pointer-events: auto;
}

/* Scrollbar styling */
.contact-modal-body::-webkit-scrollbar {
    width: 8px;
}

.contact-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.contact-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.contact-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Textarea styling */
.contact-modal-overlay textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    pointer-events: auto;
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .contact-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .contact-modal-header,
    .contact-modal-body,
    .contact-modal-footer {
        padding: 16px;
    }
    
    .contact-modal-header h3 {
        font-size: 1.25rem;
    }
    
    .contact-mode-toggle {
        flex-direction: column;
        gap: 8px;
    }
    
    .contact-modal-footer {
        flex-direction: column-reverse;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

