/* Custom styles for AgTek website */

/* Base styles and resets */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Prevent horizontal scrolling on mobile */
    overflow-x: hidden;
}

body {
    line-height: 1.6;
    /* Prevent horizontal scrolling on mobile */
    overflow-x: hidden;
    /* Improve text rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly interactions */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Custom component styles */
.btn-primary {
    @apply bg-agtek-blue text-white px-6 py-3 rounded-lg font-semibold transition-all duration-300 hover:bg-blue-700 hover:shadow-lg transform hover:scale-105 focus:outline-none focus:ring-4 focus:ring-blue-300 focus:ring-opacity-50 min-h-[48px] touch-manipulation;
}

.btn-secondary {
    @apply bg-agtek-orange text-white px-6 py-3 rounded-lg font-semibold transition-all duration-300 hover:bg-orange-500 hover:shadow-lg transform hover:scale-105 focus:outline-none focus:ring-4 focus:ring-orange-300 focus:ring-opacity-50 min-h-[48px] touch-manipulation;
}

/* Mobile-first button styles */
@media (max-width: 640px) {
    .btn-primary,
    .btn-secondary {
        @apply w-full text-center justify-center;
    }
}

.card {
    @apply bg-white rounded-xl shadow-lg p-6 transition-all duration-300 hover:shadow-xl transform hover:-translate-y-2 border border-gray-100;
}

.section-heading {
    @apply text-3xl md:text-4xl font-bold text-gray-900 mb-6;
}

.section-subheading {
    @apply text-xl text-gray-600 mb-8;
}

/* Form styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-agtek-blue focus:border-transparent transition-all duration-300;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

/* Utility classes */
.container-custom {
    @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8;
}

/* Responsive image handling */
.responsive-img {
    @apply w-full h-auto object-cover rounded-lg;
}

/* Image optimization for different screen sizes */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder - exclude footer images */
img[loading="lazy"]:not(.footer-logo) {
    background-color: #f3f4f6;
    background-image: linear-gradient(45deg, transparent 25%, rgba(255,255,255,.5) 25%, rgba(255,255,255,.5) 75%, transparent 75%, transparent),
                      linear-gradient(45deg, transparent 25%, rgba(255,255,255,.5) 25%, rgba(255,255,255,.5) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Loading states */
.loading {
    @apply animate-pulse bg-gray-200;
}

/* Accessibility improvements */
.sr-only {
    @apply absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0;
}

/* Skip navigation link */
.sr-only.focus\:not-sr-only:focus {
    position: absolute !important;
    width: auto !important;
    height: auto !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    border: 0 !important;
    clip: auto !important;
}

/* Focus visible for better keyboard navigation */
.focus-visible:focus {
    @apply outline-none ring-2 ring-agtek-blue ring-offset-2;
}
/* H
ero Section Styles */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Hero button animations */
#hero button {
    position: relative;
    overflow: hidden;
}

#hero button::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;
}

#hero button:hover::before {
    left: 100%;
}

/* Text shadow for better readability over background images */
#hero h1,
#hero p {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Responsive adjustments for hero section */
@media (max-width: 768px) {
    #hero {
        min-height: 80vh;
    }
    
    #hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    #hero p {
        font-size: 1.125rem;
    }
}

@media (max-width: 640px) {
    #hero h1 {
        font-size: 2rem;
    }
    
    #hero p {
        font-size: 1rem;
    }
    
    #hero button {
        width: 100%;
        max-width: 280px;
    }
}

/* Animation for hero content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero .container > div > * {
    animation: fadeInUp 0.8s ease-out forwards;
}

#hero h1 {
    animation-delay: 0.2s;
}

#hero p {
    animation-delay: 0.4s;
}

#hero .flex {
    animation-delay: 0.6s;
}

#hero .mt-12 {
    animation-delay: 0.8s;
}
/* 
Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Reduce motion for better mobile performance */
    .transform {
        transform: none !important;
    }
    
    /* Optimize hover effects for touch devices */
    .hover\:shadow-xl:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
    
    /* Ensure proper spacing on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile typography adjustments */
    h1 {
        line-height: 1.2;
    }
    
    h2 {
        line-height: 1.3;
    }
    
    /* Touch-friendly interactive elements */
    button, 
    a[role="button"],
    .cursor-pointer {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improve form usability on mobile */
    input, 
    textarea, 
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Tablet-specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Optimize grid layouts for tablet */
    .grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* High-DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images for retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce hero section height in landscape */
    #hero {
        min-height: 60vh;
    }
    
    /* Adjust padding for landscape */
    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Focus improvements for keyboard navigation */
.focus-visible:focus {
    outline: 2px solid #0f4c81;
    outline-offset: 2px;
}

/* Smooth scrolling fallback */
@media (prefers-reduced-motion: no-preference) {
    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;
    }
}

/* Print styles */
@media print {
    .shadow-lg,
    .shadow-xl,
    .hover\:shadow-xl {
        box-shadow: none !important;
    }
    
    .bg-gradient-to-br {
        background: #0f4c81 !important;
        color: white !important;
    }
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Brand Styling and Visual Consistency */

/* Primary Brand Colors */
:root {
    --agtek-blue: #0f4c81;
    --agtek-orange: #f5a623;
    --agtek-blue-hover: #0d3f6b;
    --agtek-orange-hover: #e6941f;
    --agtek-blue-light: rgba(15, 76, 129, 0.1);
    --agtek-orange-light: rgba(245, 166, 35, 0.1);
}

/* Consistent Button Styling */
.btn-brand-primary {
    background: linear-gradient(135deg, var(--agtek-blue) 0%, #1e5a8a 100%);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(15, 76, 129, 0.3), 0 2px 4px -1px rgba(15, 76, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-brand-primary:hover {
    background: linear-gradient(135deg, var(--agtek-blue-hover) 0%, #1a4f7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 76, 129, 0.4), 0 4px 6px -2px rgba(15, 76, 129, 0.3);
}

.btn-brand-primary:focus {
    outline: none;
    ring: 4px;
    ring-color: rgba(59, 130, 246, 0.5);
    ring-offset: 2px;
}

.btn-brand-secondary {
    background: linear-gradient(135deg, var(--agtek-orange) 0%, #f59e0b 100%);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(245, 166, 35, 0.3), 0 2px 4px -1px rgba(245, 166, 35, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-brand-secondary:hover {
    background: linear-gradient(135deg, var(--agtek-orange-hover) 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 166, 35, 0.4), 0 4px 6px -2px rgba(245, 166, 35, 0.3);
}

.btn-brand-secondary:focus {
    outline: none;
    ring: 4px;
    ring-color: rgba(251, 191, 36, 0.5);
    ring-offset: 2px;
}

/* Button Shimmer Effect */
.btn-brand-primary::before,
.btn-brand-secondary::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;
}

.btn-brand-primary:hover::before,
.btn-brand-secondary:hover::before {
    left: 100%;
}

/* Enhanced Card Styling */
.card-brand {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--agtek-blue) 0%, var(--agtek-orange) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-brand:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(15, 76, 129, 0.2);
}

.card-brand:hover::before {
    opacity: 1;
}

/* Icon Styling Consistency */
.icon-brand-primary {
    background: linear-gradient(135deg, var(--agtek-orange) 0%, #f59e0b 100%);
    color: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 6px -1px rgba(245, 166, 35, 0.3);
}

.icon-brand-secondary {
    background: linear-gradient(135deg, var(--agtek-blue) 0%, #1e5a8a 100%);
    color: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 6px -1px rgba(15, 76, 129, 0.3);
}

/* Typography Hierarchy */
.heading-brand-primary {
    color: var(--agtek-blue);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.heading-brand-secondary {
    color: #374151;
    font-weight: 600;
    line-height: 1.3;
}

.text-brand-accent {
    color: var(--agtek-orange);
    font-weight: 600;
}

/* Link Styling */
.link-brand {
    color: var(--agtek-orange);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.link-brand:hover {
    color: var(--agtek-orange-hover);
    transform: translateX(4px);
}

.link-brand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--agtek-orange);
    transition: width 0.3s ease;
}

.link-brand:hover::after {
    width: 100%;
}

/* Form Styling Consistency */
.form-brand input,
.form-brand textarea,
.form-brand select {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-brand input:focus,
.form-brand textarea:focus,
.form-brand select:focus {
    outline: none;
    border-color: var(--agtek-blue);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

.form-brand input.error,
.form-brand textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-brand .error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
    font-weight: 500;
}

/* Enhanced Error Message Styling for Zoho Form */
.error-message {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    line-height: 1.4;
}

.error-message.show-error {
    opacity: 1;
    transform: translateY(0);
}

.error-message svg {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Form field error state styling */
input.field-error,
textarea.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    background-color: rgba(239, 68, 68, 0.02) !important;
}

/* Error message container styling */
.error-message {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
}

.error-message .flex {
    align-items: flex-start;
}

.error-message svg {
    margin-top: 1px;
    color: #ef4444;
    flex-shrink: 0;
}

.error-message span {
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Responsive error message styling */
@media (max-width: 640px) {
    .error-message {
        padding: 6px 10px;
        margin-top: 6px;
    }
    
    .error-message svg {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .error-message span {
        font-size: 13px;
    }
}

/* Focus state improvements for error fields */
input.field-error:focus,
textarea.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Error state for labels */
.field-error-label {
    color: #ef4444 !important;
}

/* Success state styling (for when errors are cleared) */
.error-message.clearing {
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease-out;
}

/* Spacing Consistency */
.spacing-brand-xs { margin: 8px; }
.spacing-brand-sm { margin: 16px; }
.spacing-brand-md { margin: 24px; }
.spacing-brand-lg { margin: 32px; }
.spacing-brand-xl { margin: 48px; }

.padding-brand-xs { padding: 8px; }
.padding-brand-sm { padding: 16px; }
.padding-brand-md { padding: 24px; }
.padding-brand-lg { padding: 32px; }
.padding-brand-xl { padding: 48px; }

/* Card hover optimizations */
.card-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile-first grid improvements */
@media (max-width: 640px) {
    .grid {
        gap: 1rem;
    }
    
    .gap-8 {
        gap: 1rem;
    }
    
    .gap-6 {
        gap: 0.75rem;
    }
}

/* Optimize image galleries for mobile */
@media (max-width: 640px) {
    .absolute.bottom-3 button,
    .absolute.bottom-4 button {
        width: 12px;
        height: 12px;
        margin: 0 4px;
    }
}

/* Brand consistency overrides */
.bg-agtek-blue {
    background-color: var(--agtek-blue) !important;
}

.bg-agtek-orange {
    background-color: var(--agtek-orange) !important;
}

.text-agtek-blue {
    color: var(--agtek-blue) !important;
}

.text-agtek-orange {
    color: var(--agtek-orange) !important;
}

.border-agtek-blue {
    border-color: var(--agtek-blue) !important;
}

.border-agtek-orange {
    border-color: var(--agtek-orange) !important;
}

/* Ensure consistent hover states */
.hover\:bg-agtek-blue:hover {
    background-color: var(--agtek-blue-hover) !important;
}

.hover\:bg-agtek-orange:hover {
    background-color: var(--agtek-orange-hover) !important;
}

.hover\:text-agtek-blue:hover {
    color: var(--agtek-blue-hover) !important;
}

.hover\:text-agtek-orange:hover {
    color: var(--agtek-orange-hover) !important;
}

/* Focus ring consistency */
.focus\:ring-agtek-blue:focus {
    --tw-ring-color: rgba(15, 76, 129, 0.5) !important;
}

.focus\:ring-agtek-orange:focus {
    --tw-ring-color: rgba(245, 166, 35, 0.5) !important;
}

/* Ensure proper spacing hierarchy */
section {
    scroll-margin-top: 2rem;
}

/* Brand gradient backgrounds */
.bg-gradient-brand-primary {
    background: linear-gradient(135deg, var(--agtek-blue) 0%, #1e5a8a 100%);
}

.bg-gradient-brand-secondary {
    background: linear-gradient(135deg, var(--agtek-orange) 0%, #f59e0b 100%);
}

/* Enhanced shadow consistency */
.shadow-brand {
    box-shadow: 0 4px 6px -1px rgba(15, 76, 129, 0.1), 0 2px 4px -1px rgba(15, 76, 129, 0.06);
}

.shadow-brand-lg {
    box-shadow: 0 10px 15px -3px rgba(15, 76, 129, 0.1), 0 4px 6px -2px rgba(15, 76, 129, 0.05);
}

.shadow-brand-xl {
    box-shadow: 0 20px 25px -5px rgba(15, 76, 129, 0.1), 0 10px 10px -5px rgba(15, 76, 129, 0.04);
}

/* Image Optimization and Loading States */

/* Enhanced lazy loading styles - exclude footer images */
img[loading="lazy"]:not(.footer-logo) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Image loading states */
.image-loading {
    opacity: 0.7;
    filter: blur(2px);
}

.image-loaded {
    opacity: 1;
    filter: none;
}

.image-error {
    opacity: 0.8;
    filter: grayscale(100%);
}

/* Loading placeholder styles */
.image-loading-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.image-loading-placeholder .animate-spin {
    border-color: var(--agtek-blue);
    border-top-color: transparent;
    border-right-color: transparent;
}

/* Image fallback styles */
.image-fallback {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
    padding: 1rem;
}

/* Progressive image loading */
.progressive-image {
    position: relative;
    overflow: hidden;
}

.progressive-image img {
    transition: filter 0.3s ease-in-out;
}

.progressive-image.loading img {
    filter: blur(5px);
}

.progressive-image.loaded img {
    filter: none;
}

/* Image optimization for different screen sizes */
@media (max-width: 640px) {
    img {
        image-rendering: auto;
        /* Optimize for mobile bandwidth */
        max-width: 100%;
        height: auto;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    img {
        image-rendering: auto;
        /* Balanced quality for tablets */
    }
}

@media (min-width: 1025px) {
    img {
        image-rendering: crisp-edges;
        /* High quality for desktop */
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Gallery image optimizations */
.gallery-image {
    will-change: opacity, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.gallery-container {
    contain: layout style paint;
}

/* Image preloading indicators */
.preloading {
    position: relative;
}

.preloading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--agtek-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Intersection Observer fallback styles */
.no-intersection-observer img[loading="lazy"] {
    /* Fallback for browsers without IntersectionObserver */
    background: #f3f4f6;
    min-height: 200px;
}

/* Image aspect ratio preservation */
.aspect-ratio-container {
    position: relative;
    width: 100%;
    height: 0;
}

.aspect-ratio-16-9 {
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-ratio-4-3 {
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

.aspect-ratio-1-1 {
    padding-bottom: 100%; /* 1:1 aspect ratio */
}

.aspect-ratio-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Performance optimizations for image galleries */
.image-gallery {
    contain: layout style paint;
    transform: translateZ(0);
}

.image-gallery img {
    will-change: opacity;
    backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    img {
        transition: none !important;
        animation: none !important;
    }
    
    .image-loading-placeholder {
        animation: none !important;
    }
    
    @keyframes loading-shimmer {
        0%, 100% {
            background-position: 0 0;
        }
    }
}

/* Connection-aware image loading */
@media (max-width: 768px) {
    /* Optimize for mobile connections */
    img[loading="lazy"] {
        background-size: 400% 100%;
        animation-duration: 2s;
    }
}

/* Error state styling */
.image-error-state {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
}

.image-error-state svg {
    color: #f87171;
    margin-bottom: 0.5rem;
}

/* Success state for loaded images */
.image-success-state {
    position: relative;
}

.image-success-state::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-success-state.loaded::after {
    opacity: 1;
}

/* Optimize image containers */
.image-container {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
}

.image-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}/* Enh
anced Form Feedback Messaging Styles */

/* Success and Error Message Containers */
#success-message,
#error-message {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
}

#success-message:not(.hidden),
#error-message:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Success Message Styling */
#success-message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

#success-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

#success-message h4 {
    color: #065f46;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

#success-message p {
    color: #047857;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

#success-message svg {
    color: #10b981;
    margin-right: 0.75rem;
    flex-shrink: 0;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Error Message Styling */
#error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

#error-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

#error-message h4 {
    color: #991b1b;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

#error-message p {
    color: #b91c1c;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

#error-message svg {
    color: #ef4444;
    margin-right: 0.75rem;
    flex-shrink: 0;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Loading State Styling */
#submit-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#submit-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

#submit-loading {
    display: none; /* Default hidden state */
}

#submit-loading:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}

#submit-loading.hidden {
    display: none !important;
}

#submit-loading svg {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Loading Button Animation */
#submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Form Field Focus Enhancement During Loading */
#contact-form.submitting input,
#contact-form.submitting textarea {
    pointer-events: none;
    opacity: 0.7;
    background-color: #f9fafb;
}

/* Accessibility Improvements */
#sr-announcement {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    #success-message,
    #error-message {
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 8px;
    }
    
    #success-message h4,
    #error-message h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    #success-message p,
    #error-message p {
        font-size: 0.875rem;
    }
    
    #success-message svg,
    #error-message svg {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: 0.5rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #success-message {
        background: #f0fdf4;
        border: 2px solid #16a34a;
    }
    
    #error-message {
        background: #fef2f2;
        border: 2px solid #dc2626;
    }
    
    #success-message h4,
    #success-message p {
        color: #14532d;
    }
    
    #error-message h4,
    #error-message p {
        color: #7f1d1d;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #success-message,
    #error-message {
        transition: opacity 0.2s ease;
        transform: none;
    }
    
    #success-message svg,
    #error-message svg {
        animation: none;
    }
    
    #submit-loading svg {
        animation: none;
    }
    
    @keyframes successPulse,
    @keyframes errorShake,
    @keyframes spin,
    @keyframes loadingShimmer {
        0%, 100% {
            transform: none;
            opacity: 1;
        }
    }
}

/* Focus Management During Form Submission */
#contact-form.submitting {
    position: relative;
}

#contact-form.submitting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 1;
}

/* Enhanced Button States */
#submit-btn:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

#submit-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

/* Message Animation Timing */
.message-enter {
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.message-exit {
    animation: messageSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

/* Network Status Indicators */
.network-status {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
}

.network-status.online {
    background: #10b981;
    color: white;
}

.network-status.offline {
    background: #ef4444;
    color: white;
}

.network-status.slow {
    background: #f59e0b;
    color: white;
}

/* Form Validation Enhancement */
.form-field-container {
    position: relative;
}

.validation-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-field-container.valid .validation-icon.success {
    opacity: 1;
    color: #10b981;
}

.form-field-container.invalid .validation-icon.error {
    opacity: 1;
    color: #ef4444;
}

/* Progress Indicator for Multi-step Forms */
.form-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.form-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--agtek-blue) 0%, var(--agtek-orange) 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Tooltip Styling for Form Help */
.form-tooltip {
    position: relative;
    display: inline-block;
}

.form-tooltip .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    transition: all 0.3s ease;
}

.form-tooltip:hover .tooltip-content,
.form-tooltip:focus .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.form-tooltip .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}