/**
 * Contact Widget Styles
 * Matches the look and feel of neighborhood and property search widgets
 */

/* Contact Modal */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.contact-modal.show {
    display: flex !important;
}

.contact-modal-content,
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    box-shadow: 0 4px 20px rgba(58, 74, 58, 0.15);
    padding: 0;
    border: 1px solid #d8e3d8;
}

.contact-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.05) 0%, rgba(45, 80, 22, 0.02) 100%);
}

.contact-header h2,
.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.contact-close,
.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.contact-close:hover,
.modal-close:hover {
    color: #000;
}

.contact-body {
    padding: 2rem;
    background: white;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem;
}

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

.form-group label {
    margin-bottom: 0.5rem;
    color: #3a4a3a;
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid #d8e3d8;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: #3a4a3a;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Property Info Display */
.property-info {
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.05) 0%, rgba(45, 80, 22, 0.02) 100%);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border-left: 3px solid var(--primary-color);
}

.property-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.property-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Submit Button */
.submit-contact-btn,
.submit-btn {
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.2);
}

.submit-contact-btn:hover,
.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 80, 22, 0.3);
}

.submit-contact-btn:disabled,
.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Message */
.form-message {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Success Message */
.contact-success {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.contact-success .success-icon {
    font-size: 64px;
    color: #10b981;
    margin-bottom: 1.25rem;
}

.contact-success h3 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.contact-success p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

/* Error Message */
.contact-error {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.contact-error .error-icon {
    font-size: 64px;
    color: #ef4444;
    margin-bottom: 1.25rem;
}

.contact-error h3 {
    margin: 0 0 0.75rem 0;
    color: #ef4444;
    font-size: 1.5rem;
}

.contact-error p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.retry-btn {
    margin-top: 1.25rem;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Loading State */
.contact-loading {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.25rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.contact-loading p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

/* Contact Button (Trigger) */
.contact-trigger-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.contact-trigger-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .contact-modal {
        padding: 8px;
        align-items: stretch;
    }

    .contact-modal-content,
    .modal-content {
        max-height: 100vh;
        height: auto;
        width: 100%;
        max-width: 100%;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
    }
    
    .contact-header,
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .contact-header h2,
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .contact-form {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 8px 10px;
    }
    
    .form-group textarea {
        min-height: 60px;
        rows: 3;
    }

    .submit-contact-btn,
    .submit-btn {
        font-size: 0.95rem;
        padding: 10px 20px;
        margin-top: 0.25rem;
    }
    
    .contact-success h3,
    .contact-error h3 {
        font-size: 1.25rem;
    }
    
    .contact-success,
    .contact-error,
    .contact-loading {
        padding: 2rem 1.5rem;
    }
}
