/* Body und allgemeines */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: #eee;
    overflow-x: hidden;
    padding-top: 70px;
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 50%, #121212 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(15px);
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    height: 50px;
    transition: transform 0.3s ease;
}

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

/* Navigation Toggle (Hamburger) */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
    transition: all 0.3s ease;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #FE0000;
    margin: 4px 0;
    transition: all 0.3s ease;
    transform-origin: center;
}

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

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

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

/* Navigation */
.header-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.header-nav a {
    color: #eee;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.header-nav a:hover,
.header-nav a.active {
    color: #FE0000;
    background: rgba(254, 0, 0, 0.1);
}

/* Main Legal Content */
.legal-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 60px 60px 20px; /* Mehr Platz rechts für die Nummern */
    position: relative;
    z-index: 1;
}

.legal-container h1 {
    text-align: center;
    color: #FE0000;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-shadow: 0 0 20px rgba(254, 0, 0, 0.3);
    position: relative;
}

.legal-container h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FE0000, transparent);
}

/* Legal Sections */
.legal-section {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px 30px 30px 60px; /* Mehr Platz links für die Nummer */
    margin-bottom: 30px;
    border: 1px solid rgba(254, 0, 0, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    
    /* Animation */
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--section-index, 0) * 0.1s);
}

.legal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FE0000, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(254, 0, 0, 0.2);
    border-color: rgba(254, 0, 0, 0.3);
}

.legal-section:hover::before {
    opacity: 1;
}

.legal-section h2 {
    color: #FE0000;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(254, 0, 0, 0.2);
    padding-bottom: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legal-section h2:hover {
    color: #ff3333;
    text-shadow: 0 0 10px rgba(254, 0, 0, 0.5);
}

.legal-section h2::before {
    content: attr(data-section);
    position: absolute;
    left: -50px; /* Weiter nach links verschoben */
    top: 50%;
    transform: translateY(-50%);
    width: 35px;  /* Etwas größer */
    height: 35px; /* Etwas größer */
    background: rgba(254, 0, 0, 0.1);
    border: 2px solid #FE0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem; /* Etwas größere Schrift */
    font-weight: 700;
    transition: all 0.3s ease;
}

.legal-section:hover h2::before {
    background: #FE0000;
    color: white;
    transform: scale(1.1);
}

.legal-content {
    color: #ccc;
}

.legal-content p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-content strong {
    color: #eee;
    font-weight: 600;
}

.legal-content a {
    color: #FE0000;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    padding: 2px 4px;
    border-radius: 3px;
}

.legal-content a:hover {
    color: #ff3333;
    background: rgba(254, 0, 0, 0.1);
    border-bottom-color: #ff3333;
}

/* Datenschutz spezifische Styles */
.legal-content h3 {
    color: #ff6666;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #FE0000;
    position: relative;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content h3::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #FE0000, #ff6666);
}

/* Last Updated */
.last-updated {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    background: rgba(254, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(254, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.last-updated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.last-updated p {
    color: #FE0000;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Scroll Animation */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Section Numbers Animation */
.legal-section[data-section="1"] { animation-delay: 0.1s; }
.legal-section[data-section="2"] { animation-delay: 0.2s; }
.legal-section[data-section="3"] { animation-delay: 0.3s; }
.legal-section[data-section="4"] { animation-delay: 0.4s; }
.legal-section[data-section="5"] { animation-delay: 0.5s; }
.legal-section[data-section="6"] { animation-delay: 0.6s; }
.legal-section[data-section="7"] { animation-delay: 0.7s; }
.legal-section[data-section="8"] { animation-delay: 0.8s; }
.legal-section[data-section="9"] { animation-delay: 0.9s; }
.legal-section[data-section="10"] { animation-delay: 1.0s; }
.legal-section[data-section="11"] { animation-delay: 1.1s; }
.legal-section[data-section="12"] { animation-delay: 1.2s; }
.legal-section[data-section="13"] { animation-delay: 1.3s; }

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 70px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #FE0000, #ff3333);
    z-index: 999;
    transition: width 0.1s ease;
}

/* Print Button */
.print-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #FE0000;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(254, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 998;
}

.print-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(254, 0, 0, 0.4);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(30, 30, 30, 0.8);
    color: #FE0000;
    border: 2px solid #FE0000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 998;
}

.dark-mode-toggle:hover {
    background: #FE0000;
    color: white;
    transform: rotate(180deg);
}

/* Table of Contents */
.table-of-contents {
    position: fixed;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(254, 0, 0, 0.3);
    max-height: 400px;
    overflow-y: auto;
    z-index: 997;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.table-of-contents h3 {
    color: #FE0000;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 10px;
    border-radius: 5px;
}

.table-of-contents a:hover {
    color: #FE0000;
    background: rgba(254, 0, 0, 0.1);
}

/* TOC Toggle Button */
.toc-toggle {
    position: fixed;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    background: #FE0000;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 998;
    transition: all 0.3s ease;
}

.toc-toggle:hover {
    background: #ff3333;
    transform: translateY(-50%) scale(1.1);
}

/* Light Mode Styles */
.light-mode {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 50%, #f5f5f5 100%);
    color: #333;
}

.light-mode .legal-section {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-color: rgba(254, 0, 0, 0.2);
}

.light-mode .legal-content {
    color: #555;
}

.light-mode .legal-content strong {
    color: #222;
}

.light-mode .legal-container h1 {
    color: #FE0000;
}

.light-mode .legal-section h2 {
    color: #FE0000;
}

.light-mode .legal-content h3 {
    color: #ff3333;
}

.light-mode .table-of-contents {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(254, 0, 0, 0.3);
}

.light-mode .table-of-contents a {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        position: relative;
    }

    .nav-toggle {
        display: block;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(18, 18, 18, 0.95);
        backdrop-filter: blur(15px);
        padding: 20px 0;
        border-top: 1px solid rgba(254, 0, 0, 0.3);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .header-nav.active {
        display: block;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .header-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
    }

    .header-nav li {
        padding: 0 20px;
    }

    .header-nav a {
        display: block;
        padding: 12px 0;
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .header-nav a:hover {
        padding-left: 10px;
        background: rgba(254, 0, 0, 0.1);
    }

    .legal-main {
        padding: 30px 15px 40px; /* Auf Mobile weniger Padding */
    }

    .legal-container h1 {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .legal-section {
        padding: 25px 20px; /* Auf Mobile normale Padding */
        margin-bottom: 25px;
    }

    .legal-section h2 {
        font-size: 1.3rem;
        padding-left: 0;
    }

    .legal-section h2::before {
        display: none; /* Auf Mobile Nummern verstecken */
    }

    .legal-content p {
        font-size: 0.95rem;
    }

    .legal-content h3 {
        font-size: 1.1rem;
        margin-top: 20px;
        padding-left: 12px;
    }

    .table-of-contents,
    .toc-toggle {
        display: none;
    }

    .print-btn,
    .dark-mode-toggle {
        bottom: 20px;
        right: 20px;
        padding: 12px 15px;
    }

    .dark-mode-toggle {
        bottom: 80px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 15px;
    }

    .header-logo {
        height: 40px;
    }

    .legal-container h1 {
        font-size: 1.8rem;
    }

    .legal-section {
        padding: 20px 15px;
    }

    .legal-section h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .legal-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .legal-content h3 {
        font-size: 1rem;
        padding-left: 10px;
    }

    .print-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
        padding-top: 0;
    }

    header {
        display: none;
    }

    .legal-section {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .legal-section h2 {
        color: black;
        border-bottom: 2px solid #ccc;
    }

    .legal-section h2::before {
        display: none;
    }

    .legal-content {
        color: black;
    }

    .legal-content a {
        color: black;
        text-decoration: underline;
    }

    .legal-content h3 {
        color: #666;
    }

    .last-updated {
        background: #f5f5f5;
        border: 1px solid #ccc;
    }

    .last-updated p {
        color: black;
    }

    .print-btn,
    .dark-mode-toggle,
    .table-of-contents,
    .toc-toggle,
    .reading-progress {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .legal-section {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus Styles for Accessibility */
.legal-section:focus,
.legal-content a:focus,
.print-btn:focus,
.dark-mode-toggle:focus,
.toc-toggle:focus {
    outline: 2px solid #FE0000;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .legal-section {
        border: 2px solid #FE0000;
        background: #000;
    }
    
    .legal-content {
        color: #fff;
    }

    .legal-content a {
        color: #FE0000;
        background: transparent;
    }
}

/* Custom Scrollbar */
.legal-main::-webkit-scrollbar {
    width: 8px;
}

.legal-main::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.3);
    border-radius: 4px;
}

.legal-main::-webkit-scrollbar-thumb {
    background: rgba(254, 0, 0, 0.6);
    border-radius: 4px;
}

.legal-main::-webkit-scrollbar-thumb:hover {
    background: rgba(254, 0, 0, 0.8);
}