/* ============================================
   MODERN CONTACT FORM STYLING
   ============================================ */

/* Container styling */
#contactForm {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.1);
}

#contactForm h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Form input wrapper */
.form-group {
    position: relative;
    margin-bottom: 2rem;
}

/* Modern Input Styling */
.modern-input,
.modern-select,
.modern-textarea {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1f2937;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

/* Placeholder styling */
.modern-input::placeholder,
.modern-textarea::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Focus state */
.modern-input:focus,
.modern-select:focus,
.modern-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Hover state */
.modern-input:hover,
.modern-select:hover,
.modern-textarea:hover {
    border-color: #9ca3af;
}

/* Icon styling - using data attributes */
.modern-input::before,
.modern-select::before,
.modern-textarea::before {
    content: attr(data-icon);
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 10;
}

/* Custom icon positioning for form fields */
.position-relative .modern-input,
.position-relative .modern-select,
.position-relative .modern-textarea {
    padding-left: 3.5rem;
}

.position-relative > span.field-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #667eea;
    pointer-events: none;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Icon animation on focus */
.position-relative:has(.modern-input:focus) > span.field-icon,
.position-relative:has(.modern-select:focus) > span.field-icon,
.position-relative:has(.modern-textarea:focus) > span.field-icon {
    color: #764ba2;
    transform: translateY(-50%) scale(1.1);
}

/* Textarea specific styling */
.modern-textarea {
    resize: vertical;
    min-height: 140px;
    padding-top: 1rem;
}

.position-relative > span.field-icon-textarea {
    top: 1.5rem;
    transform: translateY(0);
}

/* Country Code Select - Special styling */
.modern-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23667eea' d='M5 8l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

.modern-select::-ms-expand {
    display: none;
}

/* Select options styling */
.modern-select option {
    padding: 0.75rem;
    background-color: #ffffff;
    color: #1f2937;
}

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

/* Mobile number row styling */
.mobile-row {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 1rem;
}

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

/* Error state styling */
.modern-input.error,
.modern-select.error,
.modern-textarea.error {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Error message styling */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.error-message::before {
    content: '⚠️';
    font-size: 1rem;
}

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

/* Success state styling */
.modern-input.success,
.modern-select.success,
.modern-textarea.success {
    border-color: #10b981;
}

/* Character counter styling */
.character-counter {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    text-align: right;
    transition: color 0.3s ease;
}

.character-counter.text-warning {
    color: #f59e0b;
    font-weight: 500;
}

.character-counter.text-danger {
    color: #ef4444;
    font-weight: 600;
}

/* Submit button modern styling */
.btn-modern-submit {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-modern-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-modern-submit:active {
    transform: translateY(-1px);
}

.btn-modern-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-modern-submit .btn-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.btn-modern-submit:hover .btn-icon {
    transform: translateX(5px);
}

/* Loading state */
.btn-modern-submit.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.75rem;
}

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

/* Alert styling */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.alert::before {
    font-size: 1.5rem;
}

.alert-success::before {
    content: '✅';
}

.alert-danger::before {
    content: '❌';
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #contactForm {
        padding: 2rem 1.5rem;
        border-radius: 15px;
    }
    
    .modern-input,
    .modern-select,
    .modern-textarea {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 0.875rem 0.875rem 0.875rem 3rem;
    }
    
    .position-relative > span.field-icon {
        left: 1rem;
        font-size: 1.125rem;
    }
    
    .btn-modern-submit {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Accessibility improvements */
.modern-input:focus-visible,
.modern-select:focus-visible,
.modern-textarea:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    #contactForm {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }
    
    .modern-input,
    .modern-select,
    .modern-textarea {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .modern-input::placeholder,
    .modern-textarea::placeholder {
        color: #9ca3af;
    }
}

/* Print styles */
@media print {
    #contactForm {
        box-shadow: none;
        background: white;
    }
    
    .btn-modern-submit {
        display: none;
    }
}