/* Contact Form Styles */

/* Enhanced Contact Section */
.contact-section {
    position: relative;
    background: linear-gradient(135deg, #111827, #1e40af);
    color: white;
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.contact-container {
    position: relative;
    z-index: 2;
}

/* Form Container */
.contact-form-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

/* Messages */
.contact-messages {
    margin-bottom: 1.5rem;
}

.contact-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    animation: slideInFromTop 0.3s ease-out;
}

.contact-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.contact-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.message-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Form Inputs */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    transform: translateY(-1px);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

/* Error States */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    animation: shake 0.3s ease-in-out;
}

.form-error {
    display: block;
    color: #fca5a5;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-error:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* Select Styling */
.form-select {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>');
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 3rem;
    appearance: none;
    cursor: pointer;
}

.form-select option {
    background: #1f2937;
    color: white;
    padding: 0.5rem;
}

/* Textarea specific */
.form-textarea {
    resize: vertical;
    min-height: 6rem;
}

/* Character count */
.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.character-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.character-count.character-warning {
    color: #fbbf24;
}

/* Privacy Checkbox */
.form-privacy {
    margin-top: 2rem;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
}

.privacy-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.25rem;
    position: relative;
    transition: all 0.3s ease;
    margin-top: 0.125rem;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 0.25rem;
    top: 0.125rem;
    width: 0.375rem;
    height: 0.625rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.privacy-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #2563eb;
    border-color: #2563eb;
}

.privacy-checkbox input[type="checkbox"]:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.privacy-text {
    color: rgba(255, 255, 255, 0.9);
}

.privacy-text a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.privacy-text a:hover {
    border-bottom-color: #60a5fa;
}

/* Honeypot (hidden) */
.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Submit Button */
.btn-full {
    width: 100%;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

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

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

.btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-icon {
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* Contact Details */
.contact-details {
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    border-left: 4px solid #2563eb;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.contact-icon {
    color: #60a5fa;
    flex-shrink: 0;
}

.contact-item span {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading state */
.form-loading .form-input,
.form-loading .form-textarea,
.form-loading .form-select {
    pointer-events: none;
    opacity: 0.7;
}

/* Success state */
.form-success {
    animation: pulse 0.5s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .contact-form-container {
        padding: 1.5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .btn-primary {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .contact-item {
        padding: 0.75rem;
    }
    
    .contact-item span {
        font-size: 1rem;
    }
    
    .privacy-checkbox {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 3rem 0;
    }
    
    .contact-form-container {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .contact-title {
        font-size: 1.75rem;
    }
    
    .contact-description {
        font-size: 1rem;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    .contact-section {
        background: linear-gradient(135deg, #0f172a, #1e3a8a);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .form-input,
    .form-textarea,
    .form-select {
        border-width: 2px;
    }
    
    .contact-message {
        border-width: 2px;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .form-textarea,
    .form-select,
    .btn-primary,
    .contact-item,
    .checkmark,
    .form-error {
        transition: none;
    }
    
    .contact-message {
        animation: none;
    }
    
    .spinner {
        animation: none;
    }
}

/* Form Messages and Validation Styles */
.form-messages {
    margin: 0;
    display: none;
}

.form-messages.success,
.form-messages.error {
    display: block;
}

.form-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.form-messages.success .form-message {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.form-messages.error .form-message {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Field validation */
.form-input.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5) !important;
}

.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Loading button state */
.btn-loading {
    display: none;
}

#contact-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}