/* Global Styles */
html {
    scroll-behavior: smooth !important;
}

body {
    font-family: 'Inter', sans-serif;
}

/* ==========================================
   ACCESSIBILITY & FOCUS STYLES
   ========================================== */

/* Skip to Main Content Link (for screen readers & keyboard navigation) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ffde59;
    color: #17353b;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: bold;
    z-index: 9999;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #17353b;
    outline-offset: 2px;
}

/* Focus Styles for Keyboard Navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #ffde59;
    outline-offset: 2px;
}

/* Remove focus outline only for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid #ffde59;
    outline-offset: 2px;
}

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

/* ==========================================
   END ACCESSIBILITY
   ========================================== */

/* Garantierter Offset für fixed Header */
section[id] {
    scroll-margin-top: 120px !important;
    padding-top: 20px;
}

/* Navigation Links - Extra sichtbar */
nav a[href^="#"] {
    position: relative;
    z-index: 999;
    pointer-events: auto !important;
}

/* Debug Hilfe */
section[id]::before {
    content: '';
    display: block;
    height: 100px;
    margin-top: -100px;
    visibility: hidden;
}

/* MOBILE MENU - Optimiert für iPhone & lange Listen */
#mobile-menu {
    position: fixed !important;
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999 !important;
    background: rgba(0, 0, 0, 0.98) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
}

#mobile-menu.hidden {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#mobile-menu:not(.hidden) {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#mobile-menu-button {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 12px !important;
}

/* Accordion-Sections im Mobile Menu */
.mobile-accordion-header {
    cursor: pointer !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-accordion-content.active {
    max-height: 1000px;
}

/* Touch-freundlich für mobile Geräte */
@media (max-width: 768px) {
    #mobile-menu a {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        padding: 12px 16px !important;
    }
    
    /* Mobile title image positioning - 60px additional spacing for windmill visibility */
    #home .order-1.lg\:order-2 {
        margin-top: 60px !important;
    }
    
    /* Padding am Ende des Menüs für bessere Scrollbarkeit */
    #mobile-menu > div {
        padding-bottom: 80px !important;
    }
}

/* DROPDOWN MENU STYLES */
.group:hover .group-hover\:opacity-100 {
    opacity: 1 !important;
}

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

/* Smooth dropdown animation */
nav .relative > div {
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

nav .relative:hover > div {
    transform: translateY(0);
}

/* Dropdown scrollbar styling */
nav .relative > div::-webkit-scrollbar {
    width: 6px;
}

nav .relative > div::-webkit-scrollbar-track {
    background: #17353b;
}

nav .relative > div::-webkit-scrollbar-thumb {
    background: #ffde59;
    border-radius: 3px;
}

nav .relative > div::-webkit-scrollbar-thumb:hover {
    background: #f5d849;
}

/* Quentn Form Styling - Hirschberg Branding Integration */
.quentn-form-container {
    width: 100%;
}

/* Quentn Form Base Styles */
qntn-form {
    display: block;
    width: 100%;
}

/* Override Quentn default styles with Hirschberg branding */
qntn-form input[type="text"],
qntn-form input[type="email"],
qntn-form input[type="tel"],
qntn-form input[type="url"],
qntn-form input[type="number"],
qntn-form textarea,
qntn-form select {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-family: 'Inter', sans-serif !important;
    transition: all 0.3s ease !important;
    background-color: white !important;
    color: #2c2c2c !important;
}

qntn-form input:focus,
qntn-form textarea:focus,
qntn-form select:focus {
    outline: none !important;
    border-color: #17353b !important;
    box-shadow: 0 0 0 3px rgba(23, 53, 59, 0.1) !important;
}

/* Quentn Labels */
qntn-form label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
    font-family: 'Inter', sans-serif !important;
}

/* Quentn Submit Button - Hirschberg Style */
qntn-form button[type="submit"],
qntn-form input[type="submit"] {
    width: 100% !important;
    background-color: #17353b !important;
    color: white !important;
    padding: 16px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    font-family: 'Inter', sans-serif !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
}

qntn-form button[type="submit"]:hover,
qntn-form input[type="submit"]:hover {
    background-color: #2c2c2c !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(23, 53, 59, 0.3) !important;
}

/* Quentn Error Messages */
qntn-form .error,
qntn-form .error-message {
    color: #dc2626 !important;
    font-size: 14px !important;
    margin-top: 4px !important;
    font-family: 'Inter', sans-serif !important;
}

/* Quentn Success Messages */
qntn-form .success,
qntn-form .success-message {
    color: #16a34a !important;
    font-size: 14px !important;
    padding: 12px !important;
    background-color: #f0fdf4 !important;
    border: 1px solid #16a34a !important;
    border-radius: 8px !important;
    margin-top: 16px !important;
    font-family: 'Inter', sans-serif !important;
}

/* Quentn Checkboxes & Radio Buttons */
qntn-form input[type="checkbox"],
qntn-form input[type="radio"] {
    width: auto !important;
    margin-right: 8px !important;
    accent-color: #17353b !important;
}

/* Quentn Field Groups */
qntn-form .form-group,
qntn-form .field-group {
    margin-bottom: 20px !important;
}

/* Quentn Required Indicator */
qntn-form .required,
qntn-form label .required {
    color: #dc2626 !important;
}

/* Quentn Placeholder Styling */
qntn-form input::placeholder,
qntn-form textarea::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    qntn-form input,
    qntn-form textarea,
    qntn-form select {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* Service Cards - Hover Effects & Animations */
.service-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Schneller: 0.3s → 0.2s */
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
}

/* Scroll Animation - Cards erscheinen beim Scrollen */
.service-card.animate-in {
    animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Stagger-Animation: Jede Card verzögert */
.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.15s; }
.service-card:nth-child(4) { animation-delay: 0.2s; }
.service-card:nth-child(5) { animation-delay: 0.25s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }
.service-card:nth-child(7) { animation-delay: 0.35s; }
.service-card:nth-child(8) { animation-delay: 0.4s; }
.service-card:nth-child(9) { animation-delay: 0.45s; }
.service-card:nth-child(10) { animation-delay: 0.5s; }
.service-card:nth-child(11) { animation-delay: 0.55s; }

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 222, 89, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease; /* Schneller: 0.3s → 0.2s */
    pointer-events: none;
}

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

/* Icon Animation on Hover - Schneller & dynamischer */
.service-card .fa-eye,
.service-card .fa-chart-pie,
.service-card .fa-users,
.service-card .fa-brain,
.service-card .fa-globe,
.service-card .fa-bolt,
.service-card .fa-robot,
.service-card .fa-headset,
.service-card .fa-funnel-dollar,
.service-card .fa-puzzle-piece,
.service-card .fa-shield-alt {
    transition: transform 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bounce-Effekt */
}

.service-card:hover .fa-eye,
.service-card:hover .fa-chart-pie,
.service-card:hover .fa-users,
.service-card:hover .fa-brain,
.service-card:hover .fa-globe,
.service-card:hover .fa-bolt,
.service-card:hover .fa-robot,
.service-card:hover .fa-headset,
.service-card:hover .fa-funnel-dollar,
.service-card:hover .fa-puzzle-piece,
.service-card:hover .fa-shield-alt {
    transform: scale(1.15) rotate(8deg); /* Stärker: 1.1 → 1.15, 5° → 8° */
}

/* Smooth scroll for anchor links to new section */
html {
    scroll-padding-top: 120px;
}

/* Mobile optimization for service cards */
@media (max-width: 768px) {
    .service-card {
        padding: 20px !important; /* Kompakter auf Mobile */
        margin-bottom: 16px;
        min-height: 180px !important;
    }
    
    .service-card h3 {
        font-size: 1.125rem !important;
        line-height: 1.3 !important;
    }
    
    .service-card p {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
    }
    
    /* Mobile: Schnellere Animationen */
    .service-card {
        transition: all 0.15s ease;
    }
    
    /* Mobile: Touch-Feedback sofort */
    .service-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Mobile: Reduzierte Stagger-Delays für schnelleren Eindruck */
    .service-card:nth-child(1) { animation-delay: 0.03s; }
    .service-card:nth-child(2) { animation-delay: 0.06s; }
    .service-card:nth-child(3) { animation-delay: 0.09s; }
    .service-card:nth-child(4) { animation-delay: 0.12s; }
    .service-card:nth-child(5) { animation-delay: 0.15s; }
    .service-card:nth-child(6) { animation-delay: 0.18s; }
    .service-card:nth-child(7) { animation-delay: 0.21s; }
    .service-card:nth-child(8) { animation-delay: 0.24s; }
    .service-card:nth-child(9) { animation-delay: 0.27s; }
    .service-card:nth-child(10) { animation-delay: 0.3s; }
    .service-card:nth-child(11) { animation-delay: 0.33s; }
}

/* Touch-Optimierung für alle Geräte */
@media (hover: none) and (pointer: coarse) {
    /* Nur auf Touch-Geräten: Größere Touch-Targets */
    .service-card {
        min-height: 200px !important;
        -webkit-tap-highlight-color: rgba(255, 222, 89, 0.1);
    }
    
    /* Touch-Geräte: Kein Hover, dafür :active State */
    .service-card:active {
        border-color: rgba(255, 222, 89, 0.5) !important;
        transform: scale(0.98) !important;
        box-shadow: 0 10px 30px rgba(255, 222, 89, 0.2) !important;
    }
    
    .service-card:active h3 {
        color: #ffde59 !important;
    }
    
    .service-card:active .fa-eye,
    .service-card:active .fa-chart-pie,
    .service-card:active .fa-users,
    .service-card:active .fa-brain,
    .service-card:active .fa-globe,
    .service-card:active .fa-bolt,
    .service-card:active .fa-robot,
    .service-card:active .fa-headset,
    .service-card:active .fa-funnel-dollar,
    .service-card:active .fa-puzzle-piece,
    .service-card:active .fa-shield-alt {
        transform: scale(1.1) !important;
    }
}

/* Performance: Reduziere Animationen bei Geräten mit prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-card * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hero Section - Türsteher Animation */
@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 222, 89, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 222, 89, 0.4);
    }
}

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