/* Variables */
:root {
    color-scheme: dark; /* Force dark mode behavior in browser (scrollbars, form controls) */
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-primary: #6a1b9a;
    --color-primary-dark: #4a126b;
    --color-accent: #9c4dcc;
    --color-gray: #1a1a1a;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    
    --gradient-hero: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(106,27,154,0.6) 100%);
    --gradient-footer: linear-gradient(0deg, #000000 0%, #2a0b3d 100%);
    
    --transition-speed: 0.3s;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove blue highlight on mobile tap */
}

html {
    scroll-behavior: smooth;
    background-color: var(--color-bg); /* Prevent white flash during transition */
    overflow-y: scroll; /* Force scrollbar to prevent layout shifts between pages */
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
    cursor: pointer;
    border: none;
}

.btn--primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(106, 27, 154, 0.4);
}

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

.btn--secondary:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    padding-right: 5.5rem; /* Increased reserve space for hamburger on mobile */
    position: relative; /* Added for absolute positioning of toggle */
}

.header__logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent logo from shrinking */
    z-index: 1002; /* Ensure logo is above other elements if needed */
    max-width: 75%; /* Prevent logo from overlapping with hamburger button */
}

.header__logo {
    height: 40px; /* Fixed height for mobile */
    width: auto;
    object-fit: contain;
    display: block;
}

/* Navigation */
.nav {
    /* Mobile Default: Hidden with animation capability */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Animation Properties */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, padding 0.4s ease;
}

.nav.nav--active {
    max-height: 400px; /* Adjust based on content */
    opacity: 1;
    padding: 2rem 0;
}

.nav__list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav__link {
    font-size: 1.1rem;
    font-weight: 600;
}

.nav__link:hover {
    color: var(--color-primary);
}

.nav__link--active {
    color: var(--color-primary);
}

/* Hamburger Menu */
.header__toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: block;
    padding: 0.5rem;
    z-index: 1001;
    /* Absolute positioning to fix location */
    position: absolute;
    right: 1.5rem; /* Matches container padding */
    top: 50%;
    transform: translateY(-50%);
}

.header__hamburger {
    display: block;
    width: 30px;
    height: 2px;
    background-color: #fff;
    position: relative;
    transition: background-color 0.3s ease;
}

.header__hamburger::before,
.header__hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #fff;
    transition: transform 0.3s ease, top 0.3s ease;
    left: 0;
}

.header__hamburger::before { 
    top: -8px; 
}

.header__hamburger::after { 
    top: 8px; 
}

/* Hamburger Animation State */
.header__toggle.is-active .header__hamburger {
    background-color: transparent;
}

.header__toggle.is-active .header__hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.header__toggle.is-active .header__hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient-hero), url('Dateien/bambulab.jpg') no-repeat center center/cover;
    /* Fallback image if needed, or just gradient */
    padding-top: 80px; /* Header height */
}

.hero__content {
    max-width: 800px;
    padding: 2rem;
}

.hero__title {
    font-size: clamp(2.1rem, 8vw, 2.5rem); /* Dynamic scaling: min 2.1rem (increased 15%), ideal 8vw, max 2.5rem */
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero__subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Sections General */
.section {
    padding: 5rem 0;
}

.section__title {
    text-align: center;
    font-size: clamp(1.75rem, 6vw, 2rem); /* Dynamic scaling: min 1.75rem (increased 15%), ideal 6vw, max 2rem */
    margin-bottom: 3rem;
    position: relative;
    display: block;
    padding: 0 0.5rem; /* Ensure a bit of internal padding if needed */
}

.section__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.section__subtitle {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #ccc;
}

/* Features / Strengths */
.features {
    background-color: var(--color-gray);
}

.features__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.feature-card {
    background-color: #000000;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    /* Transition handled by .fade-in */
    border: 1px solid rgba(255,255,255,0.05);
}

.feature-card:hover {
    background-color: #0d0d0d;
}

.feature-card__icon {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.feature-card__title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card__text {
    color: #ccc;
}

/* Materials */
.materials__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.materials__grid .material-card {
    background: #000000;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    /* Transition handled by .fade-in */
}

.materials__grid .material-card:hover {
    background: #0d0d0d;
}

.material-card--highlight {
    border-left-color: #fff;
}

.material-card__title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.material-card--highlight .material-card__title {
    color: #fff;
}

.material-card__desc {
    font-size: 0.95rem;
    color: #ddd;
}

/* Contact */
.contact {
    background: var(--gradient-footer);
    text-align: center;
}

.contact__text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background-color: #000;
    padding: 3rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.footer__logo {
    height: 40px;
    margin: 0 auto 1rem;
}

.footer__links {
    display: flex;
    gap: 1.5rem;
}

.footer__links a {
    color: #888;
    font-size: 0.9rem;
}

.footer__links a:hover {
    color: #fff;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    /* Staggered Effect: Opacity fades in (Phase 1), then movement starts (Phase 2) */
    /* Also includes background-color/border-color for hover effects on cards */
    transition: opacity 1.0s ease-out, transform 0.7s ease-out 1.0s, background-color 0.6s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Process Section */
.process {
    background-color: #000;
}

.process__steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    counter-reset: step-counter;
}

.step-card {
    position: relative;
    padding: 2rem;
    text-align: center;
    background: #131313;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Transition handled by .fade-in */
}

.step-card:hover {
    background-color: #070707;
}

.step-card__number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-primary);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: 0 0 10px rgba(106, 27, 154, 0.5);
}

.step-card__icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 1.5rem 0 1rem;
}

.step-card__title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.step-card__text {
    color: #ccc;
    font-size: 0.95rem;
}

/* Stats Section */
.stats {
    background: var(--gradient-hero);
    padding: 4rem 0;
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item__number {
    font-size: 1.6rem; /* Reduced by ~25% from 2.1rem */
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    background: -webkit-linear-gradient(#fff, #ccc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item__label {
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem; /* Restored to original size */
}

/* FAQ Section */
.faq {
    background-color: var(--color-gray);
}

.faq__list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq__item {
    background-color: #000000;
    padding: 2rem;
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
    /* Transition handled by .fade-in */
}

.faq__item:hover {
    background-color: #0d0d0d;
}

.faq__question {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.faq__answer {
    color: #ccc;
}

/* Benefits Detail Section */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: #131313;
    padding: 1.5rem;
    border-radius: 10px;
    /* Transition handled by .fade-in */
}

.benefit-item:hover {
    background-color: #070707;
}

.benefit-item__image {
    font-size: 2rem;
    color: var(--color-primary);
    min-width: 50px;
    text-align: center;
}

.benefit-item__content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.benefit-item__content p {
    color: #ccc;
    font-size: 0.95rem;
}

/* Material Table */
.table-responsive {
    overflow-x: auto;
}

.material-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensure it doesn't get too squished on mobile */
    background-color: #252525;
    border-radius: 8px;
    overflow: hidden;
}

.material-table th,
.material-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.material-table th {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.material-table tr:last-child td {
    border-bottom: none;
}

.material-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Applications Section */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.app-card {
    background: #000000;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    /* Transition handled by .fade-in */
}

.app-card:hover {
    background: #0d0d0d;
}

.app-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.app-card p {
    font-size: 0.95rem;
    color: #ddd;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
    background: #000000;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fff;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.2);
}

.file-upload-wrapper {
    background-color: #1a1a1a;
    padding: 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    text-align: center;
    transition: border-color 0.3s ease;
    display: flex;
    flex-direction: column; /* Default to column for mobile */
    align-items: center;
    gap: 1rem;
}

.file-upload-wrapper:hover {
    border-color: var(--color-primary);
}

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

.file-upload-button {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.file-upload-button:hover {
    background-color: var(--color-accent);
    transform: translateY(-1px);
}

.file-name-display {
    color: #ccc;
    font-size: 0.9rem;
    word-break: break-all; /* Ensure long filenames wrap */
}

.file-hint {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.5rem;
    text-align: center;
    width: 100%;
}

.upload-progress {
    display: none; /* Hidden by default */
    margin-top: 1rem;
    align-items: center;
    gap: 1rem;
}

.upload-progress.visible {
    display: flex;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--color-primary);
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: #ccc;
    min-width: 3rem;
    text-align: right;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.3rem;
    accent-color: var(--color-primary);
}

.checkbox-group label {
    font-weight: 400;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
}

.checkbox-group a {
    color: var(--color-primary);
    text-decoration: underline;
}

.checkbox-group a:hover {
    color: var(--color-accent);
}

/* Form Validation Styles */
.form-group input.error,
.form-group textarea.error {
    border-color: #ff4444;
    box-shadow: 0 0 0 1px rgba(255, 68, 68, 0.2);
}

.error-message {
    display: block;
    color: #ff4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2em; /* Reserve space or keep layout stable */
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Alert Modal */
.custom-alert {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    padding: 1.5rem;
}

.custom-alert.visible {
    display: flex;
}

.custom-alert__content {
    background-color: #1a1a1a;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--color-primary);
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.custom-alert__content p {
    margin-bottom: 1.5rem;
    color: #fff;
    font-size: 1rem;
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Desktop Media Queries */
@media (min-width: 768px) {
    .header__toggle {
        display: none;
    }

    .nav {
        display: block;
        position: static;
        width: auto;
        background: none;
        padding: 0;
        border: none;
        
        /* Reset Mobile Animation Props */
        max-height: unset;
        opacity: 1;
        overflow: visible;
    }

    .nav__list {
        flex-direction: row;
        gap: 2rem;
    }

    .hero__title {
        font-size: 4rem;
    }

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

    .footer__content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .footer__logo {
        margin: 0 0 1rem 0;
    }

    /* Reset Header Padding & Logo Size for Desktop */
    .header__container {
        padding-right: 1.5rem;
    }

    .header__logo {
        height: 50px;
    }

    /* Restore larger font sizes for Stats on Desktop */
    .stat-item__number {
        font-size: 2.1rem;
    }

    .stat-item__label {
        font-size: 0.9rem;
    }

    /* File Upload Layout for Desktop */
    .file-upload-wrapper {
        flex-direction: row; /* Side by side on desktop */
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .file-hint {
        text-align: left; /* Restore left align for hint on desktop if preferred, or keep center */
        margin-top: 0;
        width: 100%;
        text-align: center;
    }
}
