/* ========================================
   GLOBAL STYLES & RESET
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --light: #f5f5f5;
    --text: #333333;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    color: var(--highlight);
}

.logo span {
    color: var(--highlight);
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */
.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: var(--highlight);
    border-color: var(--highlight);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 8rem 0 5rem;
    text-align: center;
    margin-top: 70px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero .subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero .highlight-text {
    color: var(--highlight);
    font-weight: 600;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   FEATURES
   ======================================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.feature-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s, background 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-item i {
    font-size: 2rem;
    color: var(--highlight);
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* ========================================
   SECTION STYLES
   ======================================== */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-title p {
    color: #666;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   SERVICE CARDS
   ======================================== */
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    padding: 2.5rem 2rem;
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--highlight), var(--primary));
    transform: scaleX(0);
    transition: transform 0.4s;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.4s;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-icon i {
    font-size: 2.2rem;
    color: white;
}

.service-content h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.service-content .badge {
    display: inline-block;
    background: var(--highlight);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-content p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--highlight), #d13855);
    color: white;
    padding: 0.9rem 2.2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--highlight);
}

.footer-column p {
    color: #ccc;
    line-height: 1.8;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    color: #ccc;
    line-height: 1.5;
}

.contact-item i {
    color: var(--highlight);
    width: 16px;
    margin-top: 2px;
}

/* Footer Bottom Section */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.legal-links {
    display: flex;
    gap: 1.5rem;
}

.legal-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: var(--highlight);
}

.copyright {
    color: #aaa;
    font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE DESIGN FÜR FOOTER
   ======================================== */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .legal-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .contact-info {
        gap: 0.5rem;
    }
    
    .contact-item {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-column h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .legal-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .legal-links a {
        font-size: 0.85rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .language-switcher {
        gap: 0.3rem;
    }

    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .section {
        padding: 3rem 0;
    }
}

/* ========================================
   PWA SPECIFIC STYLES
   ======================================== */

/* Install Prompt Styles */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 400px;
    width: 90%;
    border: 2px solid var(--highlight);
}

.install-content {
    text-align: center;
}

.install-content p {
    margin-bottom: 15px;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
}

.btn-cancel {
    background: transparent;
    color: #666;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
    border-radius: 20px;
    transition: all 0.3s;
}

.btn-cancel:hover {
    color: var(--text);
    background: rgba(0,0,0,0.05);
}

/* Network Status Indicator */
#networkStatus {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--highlight);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 10000;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

/* PWA Install Animations */
@keyframes slideInUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
}

/* Loading Animation for PWA */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.pwa-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid var(--highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

/* Standalone Mode Adjustments */
@media (display-mode: standalone) {
    header {
        padding-top: env(safe-area-inset-top);
    }
    
    .hero {
        margin-top: calc(70px + env(safe-area-inset-top));
    }
}

/* Safe Area Support for Notch Phones */
@supports(padding: max(0px)) {
    .hero {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .install-prompt {
        bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Enhanced Touch Interactions */
@media (hover: none) and (pointer: coarse) {
    .btn, .lang-btn, .service-card {
        min-height: 44px;
    }
    
    .btn {
        padding: 1rem 2.5rem;
    }
}

/* Print Styles for PWA */
@media print {
    .install-prompt,
    #networkStatus,
    .language-switcher {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .service-card {
        border: 2px solid var(--text);
    }
    
    .feature-item {
        border: 2px solid rgba(255,255,255,0.5);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .service-card,
    .feature-item,
    .btn {
        transition: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .install-prompt {
        background: var(--primary);
        color: white;
    }
    
    .install-content p {
        color: white;
    }
    
    .btn-cancel {
        color: #ccc;
    }
    
    .btn-cancel:hover {
        color: white;
        background: rgba(255,255,255,0.1);
    }
}

/* ========================================
   ENHANCED SERVICE CARD ANIMATIONS FOR PWA
   ======================================== */
.service-card {
    /* Existing styles remain */
    will-change: transform, opacity;
}

.feature-item {
    /* Existing styles remain */
    will-change: transform;
}

/* Optimize for mobile performance */
.hero h1,
.hero .subtitle {
    will-change: transform, opacity;
}

/* ========================================
   PWA SPECIFIC RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .install-prompt {
        bottom: 10px;
        padding: 15px;
        max-width: 350px;
    }
    
    .install-content p {
        font-size: 0.9rem;
    }
    
    #networkStatus {
        top: 70px;
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .install-prompt {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }
    
    .install-content .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Landscape Mode Optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .install-prompt {
        bottom: 5px;
        padding: 10px;
    }
    
    .hero {
        padding: 4rem 0 2rem;
    }
    
    .section {
        padding: 2rem 0;
    }
}

/* ========================================
   INSTALL APP BUTTON STYLES
   ======================================== */
.install-app-btn {
    display: none; /* Initial versteckt */
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--highlight), #d13855) !important;
    border: 2px solid var(--highlight) !important;
    color: white !important;
    padding: 0.7rem 1.2rem !important;
    border-radius: 25px !important;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4) !important;
    position: relative;
    z-index: 1000;
}

/* Sichtbar wenn verfügbar */
.install-app-btn.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.install-app-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.6) !important;
}

/* Pulsierende Animation für Aufmerksamkeit */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(233, 69, 96, 0.8);
    }
    100% {
        box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    }
}

/* Emergency visible state for debugging */
.install-app-btn.debug-visible {
    display: flex !important;
    background: red !important;
    color: white !important;
    border: 3px solid yellow !important;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.install-app-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4) !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(233, 69, 96, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
    }
}

/* ========================================
   MOBILE LANGUAGE SWITCHER
   ======================================== */

/* Desktop Version ausblenden auf Mobile */
@media (max-width: 768px) {
    .desktop-language-switcher {
        display: none !important;
    }
    
    .mobile-language-switcher {
        display: block;
        position: relative;
    }
}

/* Mobile Version ausblenden auf Desktop */
@media (min-width: 769px) {
    .mobile-language-switcher {
        display: none !important;
    }
    
    .desktop-language-switcher {
        display: flex;
        gap: 0.5rem;
    }
}

/* Mobile Language Toggle Button */
.mobile-lang-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: space-between;
}

.mobile-lang-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-lang-toggle .fa-chevron-down {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.mobile-lang-toggle.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* Mobile Language Dropdown */
.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
}

/* Verbesserte Dropdown Animation */
.mobile-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
    z-index: 1001;
    display: none;
    animation: slideDown 0.2s ease;
    transform-origin: top right;
}

.mobile-lang-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* Mobile Language Options */
.mobile-lang-option {
    width: 100%;
    background: none;
    border: none;
    padding: 0.8rem 1rem;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.mobile-lang-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-lang-option.active {
    background: linear-gradient(135deg, var(--highlight), #d13855);
    color: white;
}

.mobile-lang-option .fa-check {
    font-size: 0.8rem;
    opacity: 0;
}

.mobile-lang-option.active .fa-check {
    opacity: 1;
}

/* Mobile Install Button */
.mobile-install-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--highlight), #d13855);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    text-align: left;
}

.mobile-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}



/* Verbesserte Responsive Styles für sehr kleine Displays */
@media (max-width: 480px) {
    .mobile-lang-toggle {
        padding: 0.5rem 0.8rem;
        min-width: 80px;
        font-size: 0.9rem;
    }
    
    .mobile-lang-dropdown {
        min-width: 180px;
        right: -10px;
    }
    
    .mobile-lang-option,
    .mobile-install-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .current-lang {
        font-size: 0.9rem;
    }
}

/* Landscape Mode Optimierungen */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-lang-dropdown {
        max-height: 200px;
        overflow-y: auto;
    }
}

/* Touch-friendly Größen */
@media (hover: none) and (pointer: coarse) {
    .mobile-lang-toggle,
    .mobile-lang-option,
    .mobile-install-btn {
        min-height: 44px;
    }
}