/* Custom CSS Styles for Dienstleistungen Haus & Garten AS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --garden-green: #2d5016;
    --garden-light: #4a7c2d;
    --garden-lighter: #6b9f4d;
    --garden-accent: #8fbc6f;
    --garden-sand: #e8d8c3;
    --garden-earth: #8b7355;
    --garden-dark: #1a3009;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Hero Section */
.hero-section h1 {
    letter-spacing: -0.02em;
}

/* Loading Screen Styles - Premium Design */
#loader {
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.loader-backdrop {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
}

/* Outer ring */
.loader-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(143, 188, 111, 0.1);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Inner spinning ring */
.loader-ring-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    border: 3px solid transparent;
    border-top-color: var(--garden-accent);
    border-right-color: var(--garden-accent);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 8px rgba(143, 188, 111, 0.5));
}

/* Center dot */
.loader-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: linear-gradient(135deg, var(--garden-accent), var(--garden-light));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(143, 188, 111, 0.8);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(143, 188, 111, 0.8);
    }

    50% {
        transform: scale(1.3);
        box-shadow: 0 0 30px rgba(143, 188, 111, 1);
    }
}

/* Elegant divider */
.loader-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--garden-accent), transparent);
}

/* Fade in animations for text */
.loader-title {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.loader-text {
    animation: fadeInUp 1s ease-out 0.6s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation Styles */
#navbar {
    background: #ffffff;
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(143, 188, 111, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Scroll Indicator Animation */
.scroll-indicator {
    animation: float 3s ease-in-out infinite;
    color: inherit;
}

.scroll-indicator svg {
    color: currentColor;
}

@keyframes float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Service Card Hover Effects */
.service-card {
    transition: all 0.3s ease;
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--garden-green), var(--garden-accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Project Card Styles */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.3), rgba(143, 188, 111, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::after {
    opacity: 1;
}

/* Form Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--garden-green);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

/* Smooth Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
}

/* Responsive Video */
video {
    display: block;
    max-width: 100%;
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
}

/* Stats Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* About Section */
.about-content {
    opacity: 1;
    transform: translateX(0);
}

.about-image {
    opacity: 1;
    transform: translateX(0);
}

/* Contact Form */
.contact-form {
    opacity: 1;
    transform: translateY(0);
}

.contact-info {
    opacity: 1;
    transform: translateY(0);
}

/* Utility Classes */
.gradient-text {
    background: linear-gradient(135deg, var(--garden-green), var(--garden-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations for stats */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item {
    animation: countUp 0.6s ease forwards;
}

.stat-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-item:nth-child(3) {
    animation-delay: 0.3s;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    #mobile-menu.hidden {
        display: none;
    }

    #mobile-menu.active {
        display: block;
    }
}

/* Mobile stats section fix */
@media (max-width: 480px) {
    .stat-item {
        min-width: 0;
        overflow: hidden;
    }

    .stat-item .counter {
        font-size: 1.25rem !important;
    }

    .stat-item>div:last-child {
        font-size: 9px !important;
        line-height: 1.2;
        word-wrap: break-word;
        hyphens: auto;
    }

    .hero-content {
        padding-right: 0.5rem;
    }
}

/* Performance Optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--garden-green);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Print Styles */
@media print {

    nav,
    #loader,
    .scroll-indicator {
        display: none;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Can be extended for dark mode support */
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {

    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Disable animations on mobile devices */
@media (max-width: 767px) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* Focus Visible Styles */
:focus-visible {
    outline: 2px solid var(--garden-accent);
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background-color: var(--garden-accent);
    color: white;
}

::-moz-selection {
    background-color: var(--garden-accent);
    color: white;
}

/* ========================================
   Timeline Animation Styles
   ======================================== */

/* Initial states for timeline elements */
.process-badge,
.process-title,
.process-subtitle {
    opacity: 0;
    transform: translateY(30px);
}

.process-step {
    opacity: 0;
}

/* Step circle animation */
.step-circle {
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.process-step.active .step-circle {
    transform: scale(1);
    opacity: 1;
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pulse effect animation */
.step-pulse {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.3);
        opacity: 0;
    }

    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Title and description animations */
.step-title {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

.process-step.active .step-title {
    transform: translateY(0);
    opacity: 1;
}

.step-description {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease 0.3s;
}

.process-step.active .step-description {
    transform: translateY(0);
    opacity: 1;
}

/* Arrow animations */
.step-arrow {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease 0.4s;
}

.process-step.active .step-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .process-step {
        opacity: 1 !important;
    }

    .process-step .step-circle {
        transform: scale(1) !important;
        opacity: 1 !important;
    }

    .process-step .step-title,
    .process-step .step-description {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
}

/* Hover effects for step circles */
.step-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 40px rgba(45, 80, 22, 0.3);
}

.process-step.active .step-circle:hover {
    animation: none;
}


/* ========================================
   Performance Optimizations
   ======================================== */

/* Image loading placeholder */
img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

img[src] {
    animation: none;
    background: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    img {
        animation: none;
    }
}

/* ========================================
   Project Gallery Modal
   ======================================== */

#gallery-modal {
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for thumbnails */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Gallery image transition */
#gallery-main-image {
    transition: transform 0.3s ease;
}

/* Gallery button hover effects */
#gallery-prev:hover,
#gallery-next:hover,
#gallery-close:hover {
    transform: scale(1.05);
}

#gallery-prev:active,
#gallery-next:active,
#gallery-close:active {
    transform: scale(0.95);
}

/* ========================================
   Mobile Optimizations
   ======================================== */

/* Better touch targets for mobile */
@media (max-width: 640px) {

    /* Navigation */
    #mobile-menu a {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* Hero Section */
    .hero-content {
        margin-left: 0 !important;
        padding: 0 1rem;
    }

    .hero-section h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    /* Hero Stats - Clean grid layout */
    .stat-item {
        padding: 0.5rem 0;
    }

    .stat-item .counter {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem;
    }

    /* Service Cards - Full width on mobile */
    .service-card {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    /* Project Cards - Adjust height */
    .project-card img {
        height: 240px !important;
    }

    /* Gallery Modal - Mobile friendly */
    #gallery-main-image {
        max-height: 50vh !important;
    }

    /* FAQ Section - Better spacing */
    #faq summary {
        padding: 1rem !important;
    }

    /* Contact Form - Stack properly */
    #kontakt .grid {
        gap: 2rem;
    }

    /* Footer - Stack columns */
    footer .grid {
        gap: 2rem;
    }

    /* Buttons - Full width */
    .hero-content .flex-col a,
    .hero-content .sm\\:flex-row a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Reduce padding on sections */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* Process section specific */
    #process-section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    #process-section .process-step {
        margin-bottom: 0.5rem;
    }

    /* Testimonial cards */
    .testimonial-card {
        padding: 1.5rem !important;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-content {
        margin-left: 1rem !important;
    }

    /* Projects grid - 2 columns */
    #projekte .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Adjust project card height */
    .project-card img {
        height: 280px !important;
    }
}

/* Touch device optimizations */
@media (hover: none) {

    /* Show hover states by default on touch */
    .project-card .absolute.inset-0 {
        opacity: 1 !important;
    }

    .project-card .translate-y-4 {
        transform: translateY(0) !important;
    }

    /* Service cards - show content */
    .service-card:hover {
        transform: none;
    }

    /* Better tap feedback */
    .project-card:active,
    .service-card:active,
    button:active {
        opacity: 0.9;
        transform: scale(0.98);
    }
}

/* Improve text readability on small screens */
@media (max-width: 640px) {

    p,
    li,
    span {
        font-size: 0.9375rem;
        line-height: 1.6;
    }

    h2 {
        font-size: 1.875rem !important;
        line-height: 1.2 !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }
}

/* Prevent horizontal scroll */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }

    #gallery-modal {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #gallery-main-image {
        max-height: 70vh !important;
    }

    #gallery-thumbnails {
        display: none;
    }

    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Premium Hover Effects */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, transparent 0%, rgba(45, 80, 22, 0.1) 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* Premium Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.premium-shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* Premium Glow Effect */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(143, 188, 111, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(143, 188, 111, 0.5);
    }
}

.premium-glow {
    animation: glow 3s ease-in-out infinite;
}

/* Floating Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 4s ease-in-out infinite;
}

/* Premium Text Gradient Animation */
@keyframes gradientText {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.animated-gradient-text {
    background-size: 200% auto;
    animation: gradientText 3s ease-in-out infinite;
}

/* Premium Button Shine */
.btn-premium {
    position: relative;
    overflow: hidden;
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 100%);
    transform: rotate(30deg);
    transition: transform 0.6s ease;
}

.btn-premium:hover::after {
    transform: rotate(30deg) translateX(100%);
}

/* Smooth scroll indicator animation */
@keyframes scrollBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

/* Premium Card Lift Effect */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Premium Focus Styles */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(45, 80, 22, 0.15);
}

/* Premium Selection */
::selection {
    background: rgba(45, 80, 22, 0.2);
    color: #1a3009;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--garden-light), var(--garden-green));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--garden-dark);
}

/* Hide scrollbar for thumbnail strip */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}