/* Contact Page Enhancements */
.contact-hero-section {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.contact-hero-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"><circle cx="20" cy="20" r="1" fill="rgba(0,102,255,0.1)"/><circle cx="80" cy="40" r="0.5" fill="rgba(0,102,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(0,102,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
    will-change: transform;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.contact-form-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.contact-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.contact-form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.form-floating > .form-control,
.form-floating > .form-select {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out;
    background: rgba(248, 249, 250, 0.5);
    min-height: 58px;
    padding: 1rem 0.75rem;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 255, 0.1);
    background: white;
    outline: none;
}

.form-floating > .form-control.is-invalid,
.form-floating > .form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1);
}

.form-floating > .form-control.is-valid,
.form-floating > .form-select.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.1);
}

.form-floating > label {
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
    transition: color 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select:focus ~ label,
.form-floating > .form-select:not([value=""]) ~ label {
    color: var(--accent-color);
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Form validation and error states */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.1);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #198754;
}

/* Loading spinner animation */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Form focus improvements */
.form-floating {
    position: relative;
    margin-bottom: 0;
}

.form-floating > .form-control::placeholder,
.form-floating > .form-select::placeholder {
    color: transparent;
}

.form-floating > .form-control:not(:placeholder-shown),
.form-floating > .form-select:focus {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Newsletter checkbox styling */
.newsletter-container {
    padding: 1rem;
    background: rgba(0, 102, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(0, 102, 255, 0.1);
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.newsletter-container:hover {
    background: rgba(0, 102, 255, 0.05);
    border-color: rgba(0, 102, 255, 0.2);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    background-color: white;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 255, 0.2);
    border-color: var(--accent-color);
}

.form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.contact-info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(0, 102, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.contact-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.02) 0%, rgba(102, 126, 234, 0.02) 100%);
    z-index: 1;
}

.contact-info-card > * {
    position: relative;
    z-index: 2;
}

.contact-info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 102, 255, 0.15);
    border-color: var(--accent-color);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    transition: transform 0.3s ease;
}

.contact-icon i {
    color: white;
    font-size: 1.5rem;
}

.contact-info-card:hover .contact-icon {
    transform: scale(1.1) rotate(5deg);
}

.faq-accordion .accordion-item {
    border: 1px solid rgba(0, 102, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.faq-accordion .accordion-item:hover {
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

.faq-accordion .accordion-button {
    background: white;
    border: none;
    font-weight: 600;
    color: var(--primary-color);
    padding: 1.5rem;
    font-size: 1.1rem;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background: rgba(0, 102, 255, 0.05);
    color: var(--accent-color);
    box-shadow: none;
}

.faq-accordion .accordion-body {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid rgba(0, 102, 255, 0.08);
}

.social-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: 1;
}

.social-btn i {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 102, 255, 0.3);
    border-color: transparent;
}

.social-btn:hover::before {
    left: 0;
}

.social-btn:hover i {
    color: white;
}

.submit-btn-enhanced {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    position: relative;
    overflow: hidden;
    color: white;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.2);
    will-change: transform;
}

.submit-btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.4);
    color: white;
}

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

.submit-btn-enhanced:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn-enhanced:hover::before {
    left: 100%;
}

/* Smooth scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.8s ease-out both;
}

.animate-on-scroll:nth-child(1) { animation-delay: 0s; }
.animate-on-scroll:nth-child(2) { animation-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { animation-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { animation-delay: 0.3s; }

/* Alert animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .contact-hero-section {
        padding: 120px 0 80px 0 !important;
    }
    
    .contact-form-card {
        padding: 2rem !important;
        margin-bottom: 2rem;
    }
    
    .contact-info-card {
        margin-bottom: 1.5rem;
    }
    
    .social-btn {
        width: 50px;
        height: 50px;
    }
    
    .form-floating > .form-control,
    .form-floating > .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 56px;
    }
    
    .form-floating > label {
        font-size: 14px;
    }
    
    .newsletter-container {
        padding: 0.75rem;
    }
    
    .submit-btn-enhanced {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

/* Performance optimizations */
* {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}