/* ============================================================================
   IH-APP INDUSTRIAL DESIGN SYSTEM 2025
   Basiert auf Flutter Industrial Design System
   Version: 2.0.0 | Dark Mode Toggle Support
   ============================================================================ */

/* ===== ROOT VARIABLES - LIGHT MODE (DEFAULT) ===== */
:root {
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f7;
    --bg-tertiary: #e5e5ea;
    --bg-elevated: #ffffff;

    /* Text Colors */
    --text-primary: #1c1c1e;
    --text-secondary: #3a3a3c;
    --text-tertiary: #636366;
    --text-muted: #6d6d72;

    /* Brand Colors - Industrial Blue */
    --primary: #007AFF;
    --primary-hover: #0056b3;
    --primary-light: rgba(0, 122, 255, 0.1);
    --primary-dark: #0056b3;

    /* Accent - System Blue */
    --accent: #0A84FF;
    --accent-light: rgba(10, 132, 255, 0.12);

    /* Status Colors (ISO Standard) */
    --success: #34C759;
    --success-light: rgba(52, 199, 89, 0.12);
    --warning: #FF9500;
    --warning-light: rgba(255, 149, 0, 0.12);
    --error: #FF3B30;
    --error-light: rgba(255, 59, 48, 0.12);
    --info: #5856D6;
    --info-light: rgba(88, 86, 214, 0.12);

    /* OEE Colors (ISO 22400-2) */
    --oee-world-class: #34C759;
    --oee-good: #30D158;
    --oee-average: #FF9500;
    --oee-poor: #FF3B30;

    /* Border Colors */
    --border-light: #e5e5ea;
    --border-medium: #c7c7cc;
    --border-strong: #aeaeb2;

    /* Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Industrial Spacing (from Flutter) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Border Radius (from Flutter) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography Scale */
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-md: 17px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
    --font-size-2xl: 28px;
    --font-size-3xl: 34px;
    --font-size-4xl: 42px;
    --font-size-hero: 56px;

    /* Transition */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Navbar */
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --navbar-border: rgba(0, 0, 0, 0.08);
}

/* ===== DARK MODE VARIABLES ===== */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-elevated: #1c1c1e;

    /* Text Colors */
    --text-primary: #f2f2f7;
    --text-secondary: #d1d1d6;
    --text-tertiary: #aeaeb2;
    --text-muted: #8e8e93;

    /* Brand Colors - Adjusted for Dark */
    --primary: #0A84FF;
    --primary-hover: #409CFF;
    --primary-light: rgba(10, 132, 255, 0.18);
    --primary-dark: #409CFF;

    /* Accent */
    --accent: #0A84FF;
    --accent-light: rgba(10, 132, 255, 0.18);

    /* Status Colors (Dark Mode) */
    --success: #30D158;
    --success-light: rgba(48, 209, 88, 0.18);
    --warning: #FF9F0A;
    --warning-light: rgba(255, 159, 10, 0.18);
    --error: #FF453A;
    --error-light: rgba(255, 69, 58, 0.18);
    --info: #5E5CE6;
    --info-light: rgba(94, 92, 230, 0.18);

    /* OEE Colors (Dark Mode) */
    --oee-world-class: #30D158;
    --oee-good: #30D158;
    --oee-average: #FF9F0A;
    --oee-poor: #FF453A;

    /* Border Colors */
    --border-light: #38383a;
    --border-medium: #48484a;
    --border-strong: #636366;

    /* Shadow (Dark Mode) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

    /* Navbar */
    --navbar-bg: rgba(28, 28, 30, 0.85);
    --navbar-border: rgba(255, 255, 255, 0.08);
}

/* ===== BASE STYLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Inter', sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-slow), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-width: 320px;
    overflow-x: hidden;
}

/* Forced Desktop View Support - prevent layout breaking */
@media screen and (max-device-width: 768px) {
    body {
        min-width: 320px;
    }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.text-primary-color { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-error { color: var(--error) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--navbar-border);
    transition: all var(--transition-base);
}

.navbar-scrolled {
    background: var(--navbar-bg);
    box-shadow: var(--shadow-md);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 1280px;
    margin: 0 auto;
}

.navbar-logo img {
    height: 108px;
    width: auto;
    transition: transform var(--transition-fast);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.navbar-logo:hover img {
    transform: scale(1.05);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.navbar-links a {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

.navbar-links a:hover {
    color: var(--primary);
}

.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
    border-radius: 1px;
}

.navbar-links a:hover::after {
    width: 100%;
}

/* ===== LANGUAGE SWITCH ===== */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.lang-switch:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.toggle-divider {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Hide mobile toggle group on desktop */
.toggle-group.mobile-only {
    display: none;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.theme-toggle-track {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), background var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(22px);
    background: var(--primary);
}

.theme-toggle-icon {
    width: 14px;
    height: 14px;
    color: var(--warning);
}

[data-theme="dark"] .theme-toggle-icon {
    color: #ffffff;
}

/* Sun icon (light mode) */
.theme-toggle .sun-icon {
    display: block;
}
.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}
[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-ghost {
    background: #ffffff;
    color: var(--primary);
    border: 2px solid #ffffff;
    font-weight: 600;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.45);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-md);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 160px 0 80px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse, var(--primary-light) 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, var(--font-size-hero));
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero-title .text-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: transform var(--transition-slow);
}

.hero-image:hover img {
    transform: scale(1.02);
}

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--success-light);
    color: var(--success);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== SECTIONS ===== */
.section {
    padding: var(--spacing-3xl) 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    margin-bottom: var(--spacing-2xl);
}

.section-header h2 {
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.card-elevated {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.card-hoverable:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-body {
    padding: var(--spacing-lg);
}

/* ===== FEATURE CARDS ===== */
.features-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.feature-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.feature-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== FEATURE CARDS WITH ILLUSTRATIONS ===== */
.feature-card-illustrated {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.feature-card-illustrated .feature-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-secondary);
}

.feature-card-illustrated .feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.feature-card-illustrated:hover .feature-image img {
    transform: scale(1.05);
}

.feature-card-illustrated .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.feature-card-illustrated .feature-title {
    margin-bottom: var(--spacing-sm);
}

.feature-card-illustrated .feature-description {
    flex: 1;
}

/* ===== KPI CARDS (Industrial Style) ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.kpi-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all var(--transition-base);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-value {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.kpi-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-top: var(--spacing-sm);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.kpi-trend.up {
    color: var(--success);
    background: var(--success-light);
}

.kpi-trend.down {
    color: var(--error);
    background: var(--error-light);
}

/* ===== USP CARDS ===== */
.usps-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.usp-card {
    background: var(--bg-elevated);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.usp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.usp-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.usp-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.usp-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.usp-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

/* ===== STORY SECTION ===== */
.story-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

.story-image-wrapper {
    position: relative;
    justify-self: center;
}

.story-image {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    aspect-ratio: 3/4;
}

.story-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
}

.story-text {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.story-highlight {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    padding: var(--spacing-lg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-top: var(--spacing-lg);
}

.story-highlight blockquote {
    font-size: var(--font-size-md);
    font-style: italic;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-sm) 0;
}

/* ===== CTA SECTION ===== */
.cta-section {
    padding: var(--spacing-3xl) 0;
    background: linear-gradient(135deg, #1a365d 0%, #0f172a 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .cta-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(0, 122, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-size: var(--font-size-3xl);
    color: #ffffff;
    margin-bottom: var(--spacing-md);
}

.cta-subtitle {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-xl);
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding-top: var(--spacing-2xl);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-xl);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg) var(--spacing-xl);
}

.footer-logo {
    height: 72px;
    width: auto;
    margin-bottom: var(--spacing-md);
    display: block;
    filter: brightness(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

[data-theme="dark"] .footer-logo {
    filter: brightness(0) invert(1);
}

.footer-brand {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-links h4,
.footer-title,
.footer .footer-title,
.footer-links .footer-title,
.footer-contact .footer-title {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links a {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: var(--spacing-sm);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact h4,
.footer-contact .footer-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-contact p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.footer-contact a {
    color: var(--primary);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-bottom {
    background: var(--bg-tertiary);
    padding: var(--spacing-md) 0;
}

.footer-bottom p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
}

/* ===== GRID UTILITIES ===== */
.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ===== FLEX UTILITIES ===== */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== ENTERPRISE VALUE PROPOSITION ===== */
.value-prop {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-2xl);
}

.value-prop-item {
    text-align: center;
    padding: var(--spacing-lg);
}

.value-prop-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.value-prop-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.value-prop-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.value-prop-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ===== BENEFITS HIGHLIGHT (for Management) ===== */
.benefits-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: var(--spacing-3xl) 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
}

.benefit-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.benefit-card:hover {
    transform: translateX(4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.benefit-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.benefit-content h3,
.benefit-content h4 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.benefit-content p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* ===== CONTACT FORM ===== */
.contact-form {
    background: var(--bg-elevated);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.form-message {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

.form-message.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.form-message.error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error);
}

/* ===== MOBILE MENU ===== */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    z-index: 1001;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all var(--transition-base);
    border-radius: 1px;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.mobile-overlay.active {
    display: block;
}

/* ===== LOADING STATE ===== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-image {
        order: -1;
        margin-bottom: var(--spacing-xl);
    }

    .hero-image img {
        max-width: 350px;
        width: 100%;
        margin: 0 auto;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .navbar-toggle {
        display: block;
    }

    /* Hide desktop theme toggle on mobile */
    .navbar-container > .flex {
        display: none;
    }

    /* Show only CTA button on mobile navbar */
    .navbar-container > .flex .navbar-cta {
        display: none;
    }

    .navbar-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100%;
        height: 100dvh;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 80px var(--spacing-lg) var(--spacing-lg);
        transition: transform var(--transition-base), visibility var(--transition-base);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        gap: 0;
        visibility: hidden;
        overflow-y: auto;
        transform: translateX(100%);
    }

    .navbar-links.active {
        transform: translateX(0);
        visibility: visible;
    }

    .navbar-links a {
        padding: var(--spacing-md) 0;
        border-bottom: 1px solid var(--border-light);
        width: 100%;
    }

    .navbar-links a::after {
        display: none;
    }

    .navbar-cta {
        display: none;
    }

    .navbar-links .mobile-cta {
        display: flex;
        margin-top: var(--spacing-lg);
        width: 100%;
        justify-content: center;
    }

    /* Zweiter Button bekommt kleineren Abstand */
    .navbar-links .mobile-cta + .mobile-cta {
        margin-top: var(--spacing-sm);
    }

    /* Theme toggle at top left in hamburger menu */
    .theme-toggle-wrapper.mobile-only {
        position: absolute;
        top: 20px;
        left: var(--spacing-lg);
        margin: 0;
        padding: 0;
        border: none;
    }

    /* Language + Theme toggle group at top left in hamburger menu */
    .toggle-group.mobile-only {
        display: flex;
        position: absolute;
        top: 20px;
        left: var(--spacing-lg);
        margin: 0;
        padding: 0;
        border: none;
    }

    /* Remove background from lang-switch in mobile menu */
    .toggle-group.mobile-only .lang-switch {
        background: transparent;
        border: none;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 20px;
        --spacing-xl: 24px;
        --spacing-2xl: 32px;
        --spacing-3xl: 48px;
    }

    /* Mobile Kontrast-Verbesserungen */
    .btn-outline {
        color: #0056b3;
    }

    .footer-description,
    .footer-contact p {
        color: var(--text-tertiary);
    }

    .footer-bottom p {
        color: var(--text-tertiary);
    }

    .footer-contact a {
        color: #0056b3;
    }

    .navbar-logo img {
        height: 56px;
    }

    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-image img {
        max-width: 280px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .story-section {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .story-image {
        max-width: 280px;
        margin: 0 auto;
        aspect-ratio: 1/1;
    }

    .story-highlight {
        text-align: left;
    }

    .value-prop {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        margin-bottom: var(--spacing-lg);
        text-align: center;
        align-items: center;
    }

    .footer-logo {
        display: block;
        height: 56px;
        margin: 0 auto var(--spacing-md);
    }

    .footer-links,
    .footer-contact {
        text-align: center;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
    }

    .cta-actions .btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .section {
        padding: var(--spacing-2xl) 0;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: var(--font-size-base);
    }

    .card-body {
        padding: var(--spacing-md);
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 969px) {
    .mobile-cta {
        display: none !important;
    }

    .theme-toggle-wrapper.mobile-only {
        display: none !important;
    }

    /* Desktop: Footer logo left-aligned and larger */
    .footer-brand {
        text-align: left;
        align-items: flex-start;
    }

    .footer-logo {
        height: 56px;
        margin-left: 0;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar, .footer, .cta-section, .theme-toggle {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .hero {
        padding-top: 40px;
    }
}

/* ===== SMOOTH TRANSITIONS FOR THEME CHANGE ===== */
body,
.navbar,
.card,
.card-elevated,
.btn,
input,
textarea,
.footer,
.section,
.section-alt,
.stat-card,
.fact-item,
.sources-note {
    transition: background-color var(--transition-slow),
                border-color var(--transition-base),
                color var(--transition-base),
                box-shadow var(--transition-base);
}

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

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

/* Focus Styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== CROSS-BROWSER COMPATIBILITY ===== */

/* Safari/iOS tap highlight */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly button sizes (minimum 44x44px) */
.btn {
    min-height: 44px;
}

/* Prevent iOS text size inflation */
html {
    -webkit-text-size-adjust: 100%;
}

/* Safe area support for notched devices (iPhone X+) */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(var(--spacing-lg), env(safe-area-inset-left));
        padding-right: max(var(--spacing-lg), env(safe-area-inset-right));
    }

    .footer-bottom {
        padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
    }
}

/* Flexbox fallback for older browsers */
@supports not (display: grid) {
    .grid, .grid-2, .grid-3, .grid-4 {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > * {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 300px;
        flex: 1 1 300px;
    }
}

/* Vendor prefixes for gradient backgrounds */
.hero-title .text-primary {
    background: -webkit-linear-gradient(315deg, var(--primary) 0%, var(--accent) 100%);
    background: -o-linear-gradient(315deg, var(--primary) 0%, var(--accent) 100%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-light: #1c1c1e;
        --border-medium: #1c1c1e;
    }

    .card, .btn-outline {
        border-width: 2px;
    }
}

/* Image optimization for all devices */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent horizontal scroll on mobile */
.container,
section,
.hero,
.footer {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Touch scrolling for iOS */
.navbar-links {
    -webkit-overflow-scrolling: touch;
}

/* Smooth scrolling with fallback */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Fix for Safari backdrop-filter */
@supports (-webkit-backdrop-filter: blur(20px)) {
    .navbar {
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}


/* ===== INDUSTRY FACTS SECTION (Branchenzahlen) ===== */
.industry-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.stat-card {
    background: var(--bg-elevated);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-source {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.4;
}

.industry-facts-detail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.fact-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.fact-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.fact-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fact-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.fact-content h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.fact-content p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.sources-note {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.sources-note p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
}

.sources-note a {
    color: var(--primary);
    text-decoration: none;
}

.sources-note a:hover {
    text-decoration: underline;
}

/* Responsive Industry Facts */
@media (max-width: 1024px) {
    .industry-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .industry-facts-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .industry-stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: var(--font-size-3xl);
    }
}
