/* Custom CSS for Ketheryn Mitchems Wolfdog Ranch */

/* Mobile Responsiveness - Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

*, *::before, *::after {
    box-sizing: border-box;
    max-width: 100%;
}

/* Prevent any element from exceeding viewport width */
.container, .max-w-8xl, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl, .max-w-xl {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Container fixes for mobile */
.container, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Specific max-width constraints */
@media (min-width: 640px) {
    .max-w-2xl { max-width: 42rem; }
    .max-w-3xl { max-width: 48rem; }
    .max-w-4xl { max-width: 56rem; }
    .max-w-5xl { max-width: 64rem; }
    .max-w-6xl { max-width: 72rem; }
    .max-w-7xl { max-width: 80rem; }
    .max-w-8xl { max-width: 88rem; }
}

/* Dropdown hover functionality */
.group:hover .group-hover\:opacity-100 {
    opacity: 1 !important;
}

.group:hover .group-hover\:visible {
    visibility: visible !important;
}

/* Ensure dropdown positioning */
.dropdown-menu {
    position: absolute;
    left: 0;
    margin-top: 0.5rem;
    width: 16rem;
    background-color: white;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 50;
}

.group:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* Active navigation link styles */
.nav-link-active {
    color: #2563eb !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #2563eb;
}

.nav-link-active-mobile {
    color: #2563eb !important;
    font-weight: 600 !important;
    background-color: #eff6ff;
    border-radius: 0.375rem;
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes */
.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.8s ease-out forwards;
}

/* Pure CSS Scroll Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes that work immediately */
.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideRight 0.8s ease-out forwards;
}

.animate-scale-up {
    animation: scaleUp 0.8s ease-out forwards;
}

/* Staggered animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; }
.animate-delay-700 { animation-delay: 0.7s; }
.animate-delay-800 { animation-delay: 0.8s; }

/* Section animations on load */
section {
    animation: slideUp 0.8s ease-out forwards;
}

/* Individual section delays for staggered effect */
section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.3s; }
section:nth-child(3) { animation-delay: 0.5s; }
section:nth-child(4) { animation-delay: 0.7s; }
section:nth-child(5) { animation-delay: 0.9s; }

/* Parallax effect for hero background */
.hero-bg {
    transition: transform 0.1s ease-out;
}

/* Navbar background on scroll */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Counter animation */
.counter {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Image overlay effects */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(37, 99, 235, 0.8), rgba(8, 145, 178, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-overlay:hover::before {
    opacity: 1;
}

.image-overlay img {
    transition: transform 0.3s ease;
}

.image-overlay:hover img {
    transform: scale(1.1);
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #0891b2);
    border: none;
    color: white;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 2px solid #2563eb;
    color: #2563eb;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive improvements */
/* Mobile-specific fixes */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll;
        background-position: center right !important;
    }
    
    /* Fix any elements that might cause horizontal overflow */
    .grid {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure images don't exceed container width */
    img {
        max-width: 100%;
        height: auto;
        width: auto;
    }
    
    /* Fix flex containers on mobile */
    .flex {
        flex-wrap: wrap;
    }
    
    /* Prevent text from breaking layout */
    h1, h2, h3, h4, h5, h6, p, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Fix grid gaps on mobile */
    .gap-8 { gap: 1rem; }
    .gap-12 { gap: 1.5rem; }
    .gap-16 { gap: 2rem; }
    
    /* Adjust spacing for mobile */
    .px-4 { padding-left: 1rem; padding-right: 1rem; }
    .px-6 { padding-left: 1rem; padding-right: 1rem; }
    .px-8 { padding-left: 1rem; padding-right: 1rem; }
    
    /* Fix navbar on mobile */
    .mobile-menu {
        width: 100%;
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    /* Fix any negative margins that might cause overflow */
    .-m-1, .-m-2, .-m-3, .-m-4 {
        margin: 0;
    }
    
    /* Ensure buttons don't exceed container width */
    .inline-flex, .flex {
        max-width: 100%;
    }
    
    /* Fix specific Tailwind classes that can cause overflow */
    .space-x-6 > * + * {
        margin-left: 1rem;
    }
    
    .space-x-4 > * + * {
        margin-left: 0.75rem;
    }
    
    .space-x-3 > * + * {
        margin-left: 0.5rem;
    }
    
    .space-x-2 > * + * {
        margin-left: 0.375rem;
    }
    
    /* Ensure sections don't exceed viewport */
    section {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Fix any potential width issues with grids */
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    /* Responsive text sizes */
    .text-4xl { font-size: 1.875rem; line-height: 2.25rem; }
    .text-5xl { font-size: 2.25rem; line-height: 2.5rem; }
    .text-6xl { font-size: 2.5rem; line-height: 3rem; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Focus states for accessibility */
button:focus,
a:focus,
input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Image performance optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Dark mode support (if needed later) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Enhanced Animation delays for staggered effects */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; }
.animate-delay-700 { animation-delay: 0.7s; }
.animate-delay-800 { animation-delay: 0.8s; }
.animate-delay-900 { animation-delay: 0.9s; }
.animate-delay-1000 { animation-delay: 1.0s; }
.animate-delay-1100 { animation-delay: 1.1s; }
.animate-delay-1200 { animation-delay: 1.2s; }

/* Enhanced Puppy Card Animations */
@keyframes puppyCardEntry {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes puppyImageZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

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

@keyframes gentlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

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

/* Enhanced Animation Classes */
.animate-puppy-card {
    animation: puppyCardEntry 1s ease-out forwards;
}

.animate-float {
    animation: gentleFloat 3s ease-in-out infinite;
}

.animate-pulse-gentle {
    animation: gentlePulse 2s ease-in-out infinite;
}

.animate-bounce-gentle {
    animation: bounceGentle 2s ease-in-out infinite;
}

/* Puppy Card Hover Effects */
.puppy-card {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
}

.puppy-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.puppy-card:hover .puppy-image {
    transform: scale(1.1);
}

.puppy-image {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Image Gallery Enhanced Animations */
.image-gallery-main {
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.image-thumbnail {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
}

.image-thumbnail:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Status Badge Animations */
.status-badge {
    transition: all 0.3s ease;
    animation: gentleFloat 4s ease-in-out infinite;
}

.status-available {
    animation: gentlePulse 2s ease-in-out infinite;
}

/* Price Animation */
.price-highlight {
    transition: all 0.3s ease;
    animation: gentleFloat 3s ease-in-out infinite;
}

.price-highlight:hover {
    transform: scale(1.05);
}

/* Special Offering Animations */
.special-offering {
    animation: gentlePulse 1.5s ease-in-out infinite;
}

.special-banner {
    background: linear-gradient(45deg, #ff6b35, #f7931e, #ff6b35);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Contact Button Enhanced Animation */
.contact-button {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.contact-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;
}

.contact-button:hover::before {
    left: 100%;
}

.contact-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4);
}

/* Loading Animation for Images */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced Mobile Animations */
@media (max-width: 768px) {
    .puppy-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
    
    .image-thumbnail:hover {
        transform: scale(1.05) translateY(-1px);
    }
    
    .animate-slide-up {
        animation-duration: 0.6s;
    }
    
    .animate-scale-up {
        animation-duration: 0.6s;
    }
}

/* 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;
    }
}

/* Custom grid layouts */
.masonry-grid {
    column-count: 3;
    column-gap: 1rem;
}

.masonry-grid-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}