:root {
    --bg: #f4f1e9;
    --panel-bg: #fff;
    --text: #5a3d2b;
    --accent: #7a4f2b;
    --accent-strong: #a0704d;
    --shadow: rgba(0,0,0,0.12);
    --transition-duration: 0.3s;
}

.dark {
    --bg: #2a1f1a;
    --panel-bg: #3d2b20;
    --text: #e0d4c8;
    --accent: #a0704d;
    --accent-strong: #c08a6a;
    --shadow: rgba(0,0,0,0.3);
}

/* Prevent transitions on page load - only animate when toggling */
.preload * {
    transition: none !important;
}

* {
    transition: background-color var(--transition-duration) ease, color var(--transition-duration) ease, border-color var(--transition-duration) ease;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

body.modal-open {
    overflow: hidden;
}

/* Hide scrollbars on main pages */
::-webkit-scrollbar {
    display: none;
}

html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 5px var(--shadow);
    z-index: 999;
    transition: background-color var(--transition-duration) ease;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    transition: justify-content 0.3s ease;
}

.header-logo .header-home { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.header-logo .header-home img { display: block; }
.header-logo h2 { display: inline-block; vertical-align: middle; margin: 0; }

.header-logo img {
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.header-logo h2 {
    color: var(--panel-bg);
    margin: 0;
    font-size: 24px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

/* Menüleiste */
.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100% - 80px);
    width: 150px;
    background-color: var(--accent);
    padding: 20px;
    box-shadow: 2px 0 5px var(--shadow);
    z-index: 500;
    transition: transform 0.3s ease;
}

.sidebar a {
    display: block;
    color: var(--panel-bg);
    text-decoration: none;
    margin: 10px 0;
    font-size: 18px;
}

.sidebar a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header {
        justify-content: center;
    }

    .menu-toggle {
        position: absolute;
        left: 20px;
    }

    .login-button {
        position: absolute;
        right: 20px;
    }

    .header-logo {
        justify-content: center;
        flex: none;
        gap: 0;
    }

    .header-logo h2 {
        opacity: 0;
        visibility: hidden;
        width: 0;
        margin: 0;
    }

    .sidebar {
        transform: translateX(-250px);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0px !important;
        max-width: 100vw !important;
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }
}

/* Hauptinhalt */
.content {
    margin-left: 200px;
    margin-top: 80px;
    padding: 20px;
    max-width: calc(100vw - 200px - 40px);
    transition: margin-left 0.3s ease, filter 0.3s ease;
    position: relative;
    min-height: 100vh;
    box-sizing: border-box;
}

.content.blurred {
    filter: blur(5px);
    user-select: none;
}

/* Login-Button */
.login-button {
    background-color: var(--accent);
    color: var(--panel-bg);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
}

.small-login-btn {
    font-size: 0.95em;
    padding: 7px 16px;
    margin-top: 8px;
    margin-bottom: 2px;
    border-radius: 4px;
}

.login-button:hover {
    background-color: var(--accent-strong);
}

/* Menü-Button - nur auf mobilen Geräten sichtbar */
.menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: absolute;
        top: 20px;
        left: 20px;
        background-color: var(--accent);
        color: var(--panel-bg);
        font-weight: 600;
        border: none;
        padding: 10px;
        cursor: pointer;
        border-radius: 5px;
        z-index: 1100;
    }

    .menu-toggle:hover {
        background-color: var(--accent-strong);
    }
}

/* ===== SEITEN-SPEZIFISCHE STYLES ===== */

/* Hauptseite */
.hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.hero h1 {
    font-size: 36px;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.bounce-emoji {
    font-size: 2em;
    display: inline-block;
    animation: bounce 2s infinite;
}

.bounce-emoji:last-child {
    animation-delay: 0.2s;
}

.mobile-emoji {
    display: none;
    margin-top: 15px;
    font-size: 6em;
}

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

/* Fun Facts Modal Styles */
.fun-facts-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

.fun-facts-overlay.show {
    display: block;
}

.fun-facts-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--panel-bg);
    color: var(--text);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fun-facts-modal.show {
    display: block;
}

.fun-facts-content {
    text-align: center;
    position: relative;
}

.fun-facts-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.fun-facts-close:hover {
    transform: scale(1.1);
}

.fun-facts-modal h2 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
}

.fun-facts-modal p {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .bounce-emoji:first-child {
        font-size: 0.8em;
    }
    
    .bounce-emoji:nth-child(2) {
        font-size: 0.8em;
    }
    
    .mobile-emoji {
        display: none !important;
    }
    
    .hero {
        flex-direction: column;
        align-items: center;
    }
    
    .hero h1 {
        gap: 5px;
        margin-bottom: 10px;
    }
}

.intro-text {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 20px;
}

.features {
    margin-bottom: 40px;
}

.features h2 {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow);
    text-decoration: none;
}

.feature-card h3 {
    color: var(--text);
    margin-top: 0;
}

.feature-card p {
    color: var(--text);
    text-decoration: none;
}

.disclaimer {
    margin: 40px 0;
    padding: 20px;
    background-color: var(--panel-bg);
    border-left: 4px solid #d9534f;
    border-radius: 4px;
}

.disclaimer h2 {
    color: #d9534f;
    margin-top: 0;
}

.disclaimer-box {
    background-color: var(--panel-bg);
    border: 2px solid #d9534f;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.disclaimer-box p {
    margin: 10px 0;
    line-height: 1.6;
}

/* Dark Mode - dunkleres Rot */
.dark .disclaimer {
    border-left-color: #c9302c;
}

.dark .disclaimer h2 {
    color: #c9302c;
}

.dark .disclaimer-box {
    border-color: #c9302c;
}

.cta {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--bg);
    border-radius: 8px;
    margin: 40px 0;
}

.cta h2 {
    color: var(--text);
    margin-bottom: 10px;
}

.cta-link {
    display: inline-block;
    background-color: var(--accent);
    color: var(--panel-bg);
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    margin-top: 15px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-weight: bold;
}

.cta-link:hover {
    background-color: var(--accent-strong);
    transform: scale(1.05);
}

/* Über uns Seite */
.about-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.about-header h1 {
    font-size: 36px;
    color: var(--text);
    margin-bottom: 10px;
}

.lead {
    font-size: 18px;
    color: var(--accent);
    font-style: italic;
}

.about-project, .about-team, .about-technical, .about-disclaimer, .about-footer {
    margin-bottom: 40px;
}

.about-project h2, .about-team h2, .about-technical h2, .about-disclaimer h2, .about-footer h2 {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.about-project p, .about-technical p {
    line-height: 1.8;
    color: var(--text);
}

.about-project ul {
    margin: 20px 0;
    padding-left: 25px;
}

.about-project li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.team-member {
    background-color: var(--bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    text-align: center;
}

.team-member h3 {
    color: var(--text);
    margin-top: 0;
    font-size: 20px;
}

.team-member p {
    color: var(--accent);
    margin-bottom: 0;
}

.about-technical h3 {
    color: var(--text);
    margin-top: 25px;
    margin-bottom: 15px;
}

.about-technical ol {
    margin: 20px 0;
    padding-left: 25px;
}

.about-technical li {
    margin-bottom: 15px;
    line-height: 1.6;
}

.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid var(--accent);
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: bold;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Apply animations to common sections */
.hero, .bilderkennung-header {
    animation: fadeIn 0.6s ease;
}

.features, .feature-grid, .about-project, .about-team, .about-technical {
    animation: fadeInUp 0.7s ease;
}

section {
    animation: fadeInUp 0.6s ease;
}

.feature-card, .team-member, .stat-card {
    animation: fadeInUp 0.5s ease;
}

.back-link:hover {
    background-color: var(--accent);
    color: var(--panel-bg);
}