/**
 * Contact Form Enhancement Styles
 * @architecture BEM methodology
 * @performance CSS-only animations, GPU-accelerated transforms
 */

/* ═══════════════════════════════════════════════════
   🎨 Form Field States
   ═══════════════════════════════════════════════════ */

.contact-form input.input-error,
.contact-form textarea.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    animation: shake 0.3s ease-in-out;
}

.field-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    animation: slideDown 0.2s ease-out;
}

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

/* ═══════════════════════════════════════════════════
   🔔 Notification Styles
   ═══════════════════════════════════════════════════ */

.contact-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    font-size: 0.9375rem;
    font-weight: 500;
    max-width: 400px;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: opacity 0.3s ease-out;
}

.contact-notification--success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-notification--error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-icon {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.notification-message {
    flex: 1;
    line-height: 1.5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .contact-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* ═══════════════════════════════════════════════════
   ⏳ Loading State
   ═══════════════════════════════════════════════════ */

.submit-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.submit-button .spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* ═══════════════════════════════════════════════════
   🎬 Animations
   ═══════════════════════════════════════════════════ */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

/* ═══════════════════════════════════════════════════
   ✨ Focus States (Accessibility)
   ═══════════════════════════════════════════════════ */

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transition: all 0.2s ease-in-out;
}

.contact-form input:focus.input-error,
.contact-form textarea:focus.input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ═══════════════════════════════════════════════════
   🎯 Submit Button Enhancement
   ═══════════════════════════════════════════════════ */

.submit-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-button:hover:not(.loading):not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.submit-button:active:not(.loading):not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   ♿ Accessibility Enhancements
   ═══════════════════════════════════════════════════ */

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .contact-notification {
        border-width: 2px;
    }

    .field-error-message {
        font-weight: 600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .contact-notification,
    .field-error-message,
    .submit-button,
    .spinner {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .field-error-message {
        color: #fca5a5;
    }

    .contact-notification {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }
}

/* ═══════════════════════════════════════════════════
   📎 File Upload Styles
   ═══════════════════════════════════════════════════ */

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.file-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    animation: slideDown 0.2s ease-out;
}

.file-icon {
    font-size: 1.25rem;
    color: #667eea;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-size {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-top: 0.125rem;
}

.file-remove {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #9ca3af;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    line-height: 1;
    padding: 0;
}

.file-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.file-remove:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.file-item.file-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.file-item.file-error .file-name {
    color: #ef4444;
}

.file-upload-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    animation: slideDown 0.2s ease-out;
}

.file-upload-error::before {
    content: '⚠';
    font-size: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .file-upload-trigger {
        width: 100%;
        justify-content: center;
    }

    .file-item {
        padding: 0.625rem 0.75rem;
    }

    .file-name {
        font-size: 0.8125rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .file-item {
        animation: none !important;
    }
}
