/* =================================
   Genuit Altbausanierung
   Custom Styles
   ================================= */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
.bg-pattern {
    background-image: 
        linear-gradient(30deg, rgba(22, 163, 74, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(22, 163, 74, 0.03) 87.5%, rgba(22, 163, 74, 0.03)),
        linear-gradient(150deg, rgba(22, 163, 74, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(22, 163, 74, 0.03) 87.5%, rgba(22, 163, 74, 0.03)),
        linear-gradient(30deg, rgba(22, 163, 74, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(22, 163, 74, 0.03) 87.5%, rgba(22, 163, 74, 0.03)),
        linear-gradient(150deg, rgba(22, 163, 74, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(22, 163, 74, 0.03) 87.5%, rgba(22, 163, 74, 0.03));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

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

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

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

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

/* Navigation Styles */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
    padding-bottom: 2px;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.show {
    max-height: 500px;
}

/* Hero Section */
#home {
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 150%;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Card Hover Effects */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #15803d;
}

/* Map Container Styles */
#germany-map {
    position: relative;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

#germany-map::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, transparent 48%, rgba(255,255,255,0.3) 50%, transparent 52%),
        linear-gradient(0deg, transparent 48%, rgba(255,255,255,0.3) 50%, transparent 52%);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* Pulse Animation for Map Markers */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.pulse-marker::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid #16a34a;
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Form Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

/* Button Styles */
button,
a.button {
    position: relative;
    overflow: hidden;
}

button::before,
a.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before,
a.button:hover::before {
    width: 300px;
    height: 300px;
}

/* Scroll to Top Button */
#scroll-top {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#scroll-top.show {
    opacity: 1;
    pointer-events: auto;
}

#scroll-top:hover {
    transform: translateY(-3px);
}

/* Section Reveal Animation */
.section-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Image Placeholder Styles */
.image-placeholder {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

.font-serif {
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.02em;
}

/* Grid Gap Utilities */
.gap-custom {
    gap: 1.5rem;
}

/* Shadow Enhancements */
.shadow-soft {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.shadow-soft-lg {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* Responsive Utilities */
@media (max-width: 768px) {
    .font-serif {
        letter-spacing: -0.01em;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    nav,
    footer,
    #scroll-top,
    #mobile-menu-btn {
        display: none !important;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-eco-green-600 {
        background-color: #059669 !important;
    }
    
    .text-eco-green-600 {
        color: #047857 !important;
    }
}

/* Custom Utilities */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.backdrop-blur-sm {
    backdrop-filter: blur(8px);
}

/* Feature Icons Animation */
.feature-icon {
    transition: transform 0.3s ease;
}

.feature-icon:hover {
    transform: rotate(10deg) scale(1.1);
}

/* Timeline Styles */
.timeline-item {
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50px;
    left: 20px;
    width: 2px;
    height: calc(100% - 40px);
    background: linear-gradient(to bottom, #16a34a, #d1d5db);
}

/* Card Gradient Overlay */
.card-overlay {
    position: relative;
    overflow: hidden;
}

.card-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(22, 163, 74, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Smooth Reveal on Scroll */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal-on-scroll {
    animation: reveal 0.8s ease-out forwards;
}

/* Deutschland Karte Marker */
.map-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #16a34a;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.4);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.map-marker:hover {
    transform: scale(1.3);
}

.map-marker::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid #16a34a;
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tooltip.show {
    opacity: 1;
}

/* Contact Form Animation */
#contact-form input,
#contact-form textarea,
#contact-form select {
    transition: all 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus,
#contact-form select:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}

/* Success/Error Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    animation: slide-down 0.3s ease;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #16a34a;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile Optimizations */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
        line-height: 1.1;
    }
    
    .section-title {
        font-size: 1.875rem;
    }
    
    .grid-mobile-1 {
        grid-template-columns: 1fr;
    }
}

/* Tablet Optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .container-tablet {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Desktop Enhancements */
@media (min-width: 1280px) {
    .container-xl {
        max-width: 1440px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment if dark mode is needed */
    /*
    body {
        background-color: #1f2937;
        color: #f9fafb;
    }
    */
}
