/* Custom CSS for Die Feinkostspezialisten */

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

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

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

::-webkit-scrollbar-thumb {
    background: #977669;
    border-radius: 5px;
}

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

/* Hide scrollbar for horizontal scroll navigation */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

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

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

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

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

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

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

/* Animation classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.6s ease-out forwards;
}

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

/* Staggered animation delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Intersection Observer animation trigger */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Button hover effects */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::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-shine:hover::before {
    left: 100%;
}

/* Image hover effects */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease-out;
}

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

/* Card hover lift effect */
.card-lift {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(67, 48, 43, 0.15);
}

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #c4956a 0%, #d4a574 50%, #b4855a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Underline animation for links */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #c4956a;
    transition: width 0.3s ease-out;
}

.link-underline:hover::after {
    width: 100%;
}

/* Form input focus styles */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.2);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f2e8e5;
    border-top-color: #c4956a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Parallax effect helper */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Mobile touch improvements */
@media (hover: none) {
    .card-lift:hover {
        transform: none;
    }

    .img-zoom:hover img {
        transform: none;
    }
}

/* Print styles */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: underline;
    }
}

/* Reduced motion preference */
@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;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass {
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid #000;
    }
}

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

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #43302b;
    color: white;
    padding: 12px 24px;
    z-index: 9999;
    transition: top 0.3s ease-out;
    border-radius: 0 0 8px 8px;
    font-weight: 500;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #c4956a 0%, #b4855a 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(196, 149, 106, 0.4);
    z-index: 1000;
}

.back-to-top.visible {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(196, 149, 106, 0.5);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top:focus-visible {
    outline: 3px solid #43302b;
    outline-offset: 3px;
}

/* Enhanced Focus States */
a:focus-visible,
button:focus-visible {
    outline: 3px solid #c4956a;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Navigation link hover effect */
nav a:not(.bg-primary-800):hover {
    color: #c4956a;
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease-out;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded,
img:not([loading="lazy"]) {
    opacity: 1;
}

/* Enhanced button interactions */
.group:hover .group-hover\:translate-x-1 {
    transition: transform 0.2s ease-out;
}

/* Category card overlay enhancement */
.aspect-\[4\/3\]:hover .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(67, 48, 43, 0.95), rgba(67, 48, 43, 0.5), transparent);
}

/* Form validation states */
input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #22c55e;
}

input:invalid:not(:placeholder-shown):not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #ef4444;
}

/* Selection color */
::selection {
    background: rgba(196, 149, 106, 0.3);
    color: #43302b;
}

/* Mobile back-to-top position */
@media (max-width: 640px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}
