/* Custom styles that extend beyond Tailwind */

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

/* Selection color */
::selection {
    background-color: #4a7c4a;
    color: white;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 3px solid #4a7c4a;
    outline-offset: 2px;
}

/* Custom animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Better print styles */
@media print {
    .navbar,
    .mobile-menu,
    .btn-primary {
        display: none !important;
    }
    
    body {
        color: #000 !important;
        background: #fff !important;
    }
    
    a {
        text-decoration: underline;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .service-card,
    .bg-white {
        border: 1px solid ButtonText;
    }
}

/* 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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Better touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Ensure text is readable on all backgrounds */
.hero-gradient h1,
.hero-gradient h2,
.hero-gradient h3,
.hero-gradient p {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Card hover states */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(74, 124, 74, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* Button ripple effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Form validation styles */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #4a7c4a;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Improve accessibility for skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1d311d;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Better image loading */
img {
    background-color: #e5e7eb;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
