/**
 * Contact Tab Styles
 * Isolated styling for contact management functionality
 */

/* Contact Tab Container */
#tab-contacts {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Contact Sections */
.contact-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-section {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    background: #fafbfc;
}

.contact-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Contact Copy Option */
.contact-copy-option {
    margin-bottom: 20px;
    padding: 10px;
    background: #e8f4fd;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.contact-copy-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
}

.contact-copy-option input[type="checkbox"] {
    margin: 0;
}

/* Contact Fields */
.contact-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.field-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.field-group.full-width {
    flex: 100%;
}

.field-group label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
}

.field-group input,
.field-group select {
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.field-group input:disabled,
.field-group select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Field Validation */
.field-group input.field-valid,
.field-group select.field-valid {
    border-color: #27ae60;
    background-color: #f8fff9;
}

.field-group input.field-invalid,
.field-group select.field-invalid {
    border-color: #e74c3c;
    background-color: #fff8f8;
}

.field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Required field indicator */
.field-group label:after {
    content: "";
}

.field-group input[required] + label:after,
.field-group select[required] + label:after {
    content: " *";
    color: #e74c3c;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #e1e5e9;
}

.form-actions .button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.form-actions .button-primary {
    background: #3498db;
    color: #fff;
}

.form-actions .button-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.form-actions .button-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Form Status */
.form-status {
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.form-status.status-loading {
    color: #f39c12;
    background: #fef9e7;
    border: 1px solid #f39c12;
}

.form-status.status-success {
    color: #27ae60;
    background: #eafaf1;
    border: 1px solid #27ae60;
}

.form-status.status-error {
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #e74c3c;
}

/* Loading State */
#contacts-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

#contacts-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .field-row {
        flex-direction: column;
    }
    
    .field-group {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .contact-sections {
        gap: 20px;
    }
    
    .contact-section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    #tab-contacts {
        padding: 15px;
    }
    
    .contact-section h3 {
        font-size: 16px;
    }
    
    .field-group input,
    .field-group select {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .contact-section {
        border-color: #000;
    }
    
    .field-group input,
    .field-group select {
        border-color: #000;
    }
    
    .field-group input:focus,
    .field-group select:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    }
}

/* Print styles */
@media print {
    #tab-contacts {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .form-actions {
        display: none;
    }
    
    .contact-copy-option {
        display: none;
    }
}