/**
 * Contact Page Styles
 *
 * @package Dennis_Theme
 * @since 1.0.0
 */

/* ========================================
   Contact Page Layout
   ======================================== */

.page-contact {
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   Floating Label Form Groups
   ======================================== */

.floating-label-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.floating-label-group .form-input,
.floating-label-group .form-textarea {
    width: 100%;
    padding: 1rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-primary-200, #e5e7eb);
    border-radius: 0.5rem;
    background-color: white;
    transition: all 0.3s ease;
}

.floating-label-group .form-input:focus,
.floating-label-group .form-textarea:focus {
    outline: none;
    border-color: var(--color-accent, #f59e0b);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.floating-label-group .floating-label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--color-primary-600, #4b5563);
    background-color: transparent;
    padding: 0 0.25rem;
    pointer-events: none;
    transition: all 0.3s ease;
    transform-origin: left center;
}

/* Floating label on focus or when input has value */
.floating-label-group .form-input:focus ~ .floating-label,
.floating-label-group .form-input:not(:placeholder-shown) ~ .floating-label,
.floating-label-group .form-textarea:focus ~ .floating-label,
.floating-label-group .form-textarea:not(:placeholder-shown) ~ .floating-label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-accent, #f59e0b);
    background-color: var(--color-secondary-50, #fef3e2);
    padding: 0 0.25rem;
}

/* ========================================
   Form Inputs & Validation
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-primary-200, #e5e7eb);
    border-radius: 0.5rem;
    background-color: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-accent, #f59e0b);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: var(--color-primary-300, #d1d5db);
}

/* Invalid state */
.form-input.is-invalid,
.form-textarea.is-invalid,
.form-select.is-invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input.is-invalid:focus,
.form-textarea.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Valid state */
.form-input.is-valid,
.form-textarea.is-valid,
.form-select.is-valid {
    border-color: #10b981;
}

/* Error messages */
.error-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ef4444;
}

.error-message.hidden {
    display: none;
}

/* ========================================
   Submit Button States
   ======================================== */

.btn-primary {
    position: relative;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(to right, var(--color-accent, #f59e0b), var(--color-accent-alt, #ea580c));
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.4);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.5);
}

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

/* Loading state */
.btn-primary.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.is-loading .submit-text {
    opacity: 0;
}

.btn-primary.is-loading .loading-spinner {
    display: flex;
}

.loading-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

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

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

/* ========================================
   Form Messages
   ======================================== */

#form-messages {
    margin-top: 1rem;
}

#form-messages.hidden {
    display: none;
}

.form-message {
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    animation: slideInUp 0.4s ease;
}

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

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Contact Info Section
   ======================================== */

.contact-info {
    position: relative;
}

.contact-info h2 {
    margin-bottom: 2rem;
}

.contact-info .flex {
    margin-bottom: 1.5rem;
}

.contact-info .flex-shrink-0 {
    flex-shrink: 0;
}

/* Icon styling */
.contact-info .w-12.h-12 {
    transition: all 0.3s ease;
}

.contact-info .flex:hover .w-12.h-12 {
    transform: scale(1.1);
    background-color: var(--color-accent, #f59e0b);
    color: white;
}

/* ========================================
   Form Wrapper
   ======================================== */

.contact-form-wrapper {
    position: relative;
}

.contact-form-wrapper .bg-secondary-50 {
    background-color: var(--color-secondary-50, #fef3e2);
    border-radius: 0.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.contact-form-wrapper .bg-secondary-50:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   CTA Bellen Section
   ======================================== */

.cta-bellen {
    position: relative;
}

.cta-bellen .inline-flex.w-20.h-20 {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cta-bellen a.inline-flex {
    transition: all 0.3s ease;
}

.cta-bellen a.inline-flex:hover {
    transform: translateY(-4px);
}

/* ========================================
   Google Maps
   ======================================== */

.contact-map {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: grayscale(0.3);
    transition: filter 0.3s ease;
}

.contact-map:hover iframe {
    filter: grayscale(0);
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 1024px) {
    .contact-form-wrapper .bg-secondary-50 {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .floating-label-group {
        margin-bottom: 1.25rem;
    }

    .contact-form-wrapper .bg-secondary-50 {
        padding: 1.5rem;
    }

    .btn-primary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible,
.btn-primary:focus-visible {
    outline: 3px solid var(--color-accent, #f59e0b);
    outline-offset: 2px;
}

/* 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) {
    .form-input,
    .form-textarea,
    .form-select {
        border-width: 3px;
    }

    .btn-primary {
        border: 3px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
