/* === Basis-Styles === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 2.5rem;
}

.intro {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* === Navigation === */
.toc {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toc h3 {
    margin-top: 0;
    color: #2c3e50;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    text-decoration: none;
    color: #3498db;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: block;
    transition: background-color 0.3s;
}

.toc a:hover {
    background-color: #f8f9fa;
}

/* === Demo-Sektionen === */
.demo-section {
    background: white;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.demo-section h2 {
    background: #3498db;
    color: white;
    margin: 0;
    padding: 1.5rem;
    font-size: 1.5rem;
}

.explanation {
    padding: 2rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.explanation h3 {
    color: #2c3e50;
    margin-top: 0;
}

.explanation h4 {
    color: #34495e;
    margin-top: 1.5rem;
}

.explanation code {
    background: #e1e8ed;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.demo-container {
    padding: 2rem;
}

/* === Lazy Loading Styles === */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.lazy-image {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    object-fit: cover;
}

.lazy-image:not([src]) {
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    position: relative;
}

.lazy-image:not([src])::after {
    content: 'Laden...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    color: #666;
}

.lazy-image.loaded {
    animation: fadeIn 0.5s ease-in;
}

/* === Fade-In Animation Styles === */
.fade-item {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-item:nth-child(2) { transition-delay: 0.1s; }
.fade-item:nth-child(3) { transition-delay: 0.2s; }
.fade-item:nth-child(4) { transition-delay: 0.3s; }

.fade-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Progress Styles === */
/* 
.progress-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    padding: 1.5rem;
    border-bottom: 2px solid #3498db;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
 */
.progress-container {
    position: fixed;      /* Schwebt fest am Bildschirmrand */
    top: 0;               /* Direkt oben */
    left: 0;              /* Direkt links */
    width: 100%;          /* Volle Breite */
    z-index: 9999;        /* Ganz nach vorne, vor alles andere */
    background: white;    /* Hintergrund, damit kein Text durchscheint */
    padding: 1rem 2rem;   /* Etwas Abstand */
    box-sizing: border-box; /* Wichtig: Padding wird nicht zur Breite addiert */
    border-bottom: 2px solid #3498db;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.progress-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.progress-text {
    font-weight: bold;
    color: #3498db;
    font-size: 1.2rem;
    min-width: 50px;
}

.progress-detail {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #bdc3c7;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 50%, #f39c12 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.2s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 4px 4px 0;
}

.reading-content {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    line-height: 1.8;
    max-width: none;
}

.reading-content h4 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.reading-content h5 {
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.reading-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.reading-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.reading-content ul li {
    margin-bottom: 0.5rem;
}

.tech-note {
    background: #e8f6ff;
    border-left: 4px solid #3498db;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

.simple-demo {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 2px solid #e9ecef;
}

.simple-demo h4 {
    margin-top: 0;
    color: #2c3e50;
}

.demo-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.step-number {
    background: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.25rem;
}

.step-content small {
    color: #6c757d;
}

.how-it-works {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.how-it-works h4 {
    margin-top: 0;
    color: #856404;
}

.how-it-works p {
    margin-bottom: 0;
    color: #856404;
}

@media (max-width: 768px) {
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .demo-steps {
        gap: 0.75rem;
    }
}

.progress-sentinel {
    height: 1px;
    margin-top: 2rem;
    background: rgba(52, 152, 219, 0.2);
}

/* === Infinite Scroll Styles === */
.infinite-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
}

.infinite-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.infinite-item:hover {
    background-color: #f8f9fa;
}

.infinite-item:last-child {
    border-bottom: none;
}

.loading {
    text-align: center;
    padding: 1rem;
    font-style: italic;
    color: #666;
}

.hidden {
    display: none;
}

.infinite-sentinel {
    height: 1px;
    margin: 1rem 0;
}

/* === Virtual List Styles === */
.virtual-viewport {
    height: 400px;
    overflow: auto;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: white;
}

.spacer {
    height: 0;
}

.virtual-list {
    /* Container für die virtuellen Elemente */
}

.row {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.row:hover {
    background-color: #f8f9fa;
}

.row:nth-child(even) {
    background-color: #fafbfc;
}

.virtual-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.virtual-info > div {
    font-weight: bold;
    color: #2c3e50;
}

/* === Footer / API Referenz === */
.api-reference {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.api-reference h3 {
    margin-top: 0;
    color: #ecf0f1;
}

.api-reference h4 {
    color: #bdc3c7;
    margin-top: 1.5rem;
}

.code-example {
    margin: 1.5rem 0;
}

.code-example pre {
    background: #34495e;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    border-left: 4px solid #3498db;
}

.code-example code {
    color: #ecf0f1;
    font-family: 'Fira Code', 'Courier New', monospace;
    line-height: 1.4;
}

.options-table {
    margin: 1.5rem 0;
}

.options-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.options-table th,
.options-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #495057;
}

.options-table th {
    background: #495057;
    color: #ecf0f1;
    font-weight: bold;
}

.options-table code {
    background: #495057;
    color: #f39c12;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Fira Code', 'Courier New', monospace;
}

/* === Animationen === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .demo-container {
        padding: 1rem;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .virtual-info {
        grid-template-columns: 1fr;
    }
}

