/* ===== Zusätzliche Styles für neue Seitenstruktur ===== */

/* ===== Animated IT Icons - Individual Floating Icons ===== */
.floating-icons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 3rem;
    opacity: 0.1;
}

body.dark-mode .floating-icon {
    opacity: 0.07;
}

/* Individual Icons with different random animations */
.icon-1 { 
    animation: freefloat1 28s ease-in-out infinite;
    animation-delay: 0s;
}
.icon-2 { 
    animation: freefloat2 32s ease-in-out infinite;
    animation-delay: 2s;
}
.icon-3 { 
    animation: freefloat3 25s ease-in-out infinite;
    animation-delay: 4s;
}
.icon-4 { 
    animation: freefloat4 30s ease-in-out infinite;
    animation-delay: 1s;
}
.icon-5 { 
    animation: freefloat5 27s ease-in-out infinite;
    animation-delay: 3s;
}
.icon-6 { 
    animation: freefloat6 29s ease-in-out infinite;
    animation-delay: 5s;
}
.icon-7 { 
    animation: freefloat7 31s ease-in-out infinite;
    animation-delay: 2.5s;
}
.icon-8 { 
    animation: freefloat8 26s ease-in-out infinite;
    animation-delay: 1.5s;
}
.icon-9 { 
    animation: freefloat9 33s ease-in-out infinite;
    animation-delay: 4.5s;
}
.icon-10 { 
    animation: freefloat10 28s ease-in-out infinite;
    animation-delay: 0.5s;
}
.icon-11 { 
    animation: freefloat11 30s ease-in-out infinite;
    animation-delay: 3.5s;
}
.icon-12 { 
    animation: freefloat12 29s ease-in-out infinite;
    animation-delay: 2.5s;
}

/* Verschiedene Flugbahnen - freie Bewegung in alle Richtungen */
@keyframes freefloat1 {
    0% { transform: translate(-100px, 10%) rotateZ(0deg); opacity: 0.1; }
    25% { transform: translate(25vw, -50px) rotateZ(15deg); opacity: 0.15; }
    50% { transform: translate(60vw, 40%) rotateZ(-10deg); opacity: 0.12; }
    75% { transform: translate(85vw, -20px) rotateZ(20deg); opacity: 0.14; }
    100% { transform: translate(110vw, 30%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat2 {
    0% { transform: translate(110vw, 80%) rotateZ(0deg); opacity: 0.1; }
    25% { transform: translate(70vw, 60%) rotateZ(-15deg); opacity: 0.13; }
    50% { transform: translate(40vw, -30px) rotateZ(10deg); opacity: 0.14; }
    75% { transform: translate(10vw, 50%) rotateZ(-20deg); opacity: 0.12; }
    100% { transform: translate(-100px, 70%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat3 {
    0% { transform: translate(-50px, 50%) rotateZ(0deg); opacity: 0.1; }
    20% { transform: translate(20vw, 20%) rotateZ(25deg); opacity: 0.15; }
    40% { transform: translate(50vw, 60%) rotateZ(-15deg); opacity: 0.13; }
    60% { transform: translate(75vw, 10%) rotateZ(20deg); opacity: 0.14; }
    80% { transform: translate(95vw, 70%) rotateZ(-25deg); opacity: 0.12; }
    100% { transform: translate(110vw, 40%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat4 {
    0% { transform: translate(100vw, 20%) rotateZ(0deg); opacity: 0.1; }
    30% { transform: translate(70vw, 70%) rotateZ(-20deg); opacity: 0.14; }
    60% { transform: translate(30vw, 30%) rotateZ(15deg); opacity: 0.13; }
    100% { transform: translate(-80px, 60%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat5 {
    0% { transform: translate(-60px, 70%) rotateZ(0deg); opacity: 0.1; }
    25% { transform: translate(25vw, 30%) rotateZ(18deg); opacity: 0.14; }
    50% { transform: translate(55vw, 80%) rotateZ(-12deg); opacity: 0.13; }
    75% { transform: translate(80vw, 20%) rotateZ(22deg); opacity: 0.15; }
    100% { transform: translate(110vw, 55%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat6 {
    0% { transform: translate(110vw, 45%) rotateZ(0deg); opacity: 0.1; }
    20% { transform: translate(85vw, 80%) rotateZ(-25deg); opacity: 0.12; }
    40% { transform: translate(50vw, 15%) rotateZ(18deg); opacity: 0.14; }
    60% { transform: translate(20vw, 65%) rotateZ(-20deg); opacity: 0.13; }
    80% { transform: translate(-40px, 35%) rotateZ(15deg); opacity: 0.14; }
    100% { transform: translate(-100px, 50%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat7 {
    0% { transform: translate(-80px, 35%) rotateZ(0deg); opacity: 0.1; }
    30% { transform: translate(30vw, 75%) rotateZ(20deg); opacity: 0.15; }
    60% { transform: translate(65vw, 25%) rotateZ(-18deg); opacity: 0.13; }
    100% { transform: translate(110vw, 65%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat8 {
    0% { transform: translate(100vw, 85%) rotateZ(0deg); opacity: 0.1; }
    25% { transform: translate(75vw, 40%) rotateZ(-22deg); opacity: 0.14; }
    50% { transform: translate(40vw, 75%) rotateZ(16deg); opacity: 0.12; }
    75% { transform: translate(10vw, 25%) rotateZ(-18deg); opacity: 0.14; }
    100% { transform: translate(-100px, 55%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat9 {
    0% { transform: translate(-70px, 15%) rotateZ(0deg); opacity: 0.1; }
    22% { transform: translate(20vw, 60%) rotateZ(24deg); opacity: 0.13; }
    44% { transform: translate(55vw, 35%) rotateZ(-20deg); opacity: 0.14; }
    66% { transform: translate(80vw, 70%) rotateZ(18deg); opacity: 0.12; }
    88% { transform: translate(105vw, 20%) rotateZ(-22deg); opacity: 0.14; }
    100% { transform: translate(110vw, 50%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat10 {
    0% { transform: translate(110vw, 60%) rotateZ(0deg); opacity: 0.1; }
    35% { transform: translate(65vw, 10%) rotateZ(-20deg); opacity: 0.15; }
    70% { transform: translate(25vw, 80%) rotateZ(22deg); opacity: 0.13; }
    100% { transform: translate(-100px, 40%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat11 {
    0% { transform: translate(-90px, 75%) rotateZ(0deg); opacity: 0.1; }
    28% { transform: translate(25vw, 25%) rotateZ(20deg); opacity: 0.14; }
    56% { transform: translate(60vw, 70%) rotateZ(-18deg); opacity: 0.13; }
    84% { transform: translate(90vw, 30%) rotateZ(24deg); opacity: 0.14; }
    100% { transform: translate(110vw, 60%) rotateZ(0deg); opacity: 0.1; }
}

@keyframes freefloat12 {
    0% { transform: translate(100vw, 30%) rotateZ(0deg); opacity: 0.1; }
    32% { transform: translate(70vw, 75%) rotateZ(-24deg); opacity: 0.14; }
    64% { transform: translate(35vw, 20%) rotateZ(20deg); opacity: 0.12; }
    100% { transform: translate(-100px, 70%) rotateZ(0deg); opacity: 0.1; }
}

/* ===== Animated Hintergrund (nur Dashboard) ===== 
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, 
        #312e81 0%, 
        #4f46e5 25%, 
        #6366f1 50%, 
        #818cf8 75%, 
        #a78bfa 100%);
    background-size: 400% 400%;
    animation: gradientShift 25s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { 
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 75%;
    }
    50% { 
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 25%;
    }
    100% { 
        background-position: 0% 50%;
    }
}

/* Gradient Orbs - Große schwebende Farbkugeln */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: float 30s ease-in-out infinite;
    transition: all 1s ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    top: -200px;
    left: -200px;
    animation-duration: 35s;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #c084fc 0%, #f472b6 100%);
    bottom: -250px;
    right: -250px;
    animation-duration: 40s;
    animation-delay: -10s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: linear-gradient(135deg, #06d6a0 0%, #34d399 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 32s;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(60px, 40px) scale(1.08) rotate(15deg);
    }
    40% {
        transform: translate(-40px, 100px) scale(0.95) rotate(-10deg);
    }
    60% {
        transform: translate(50px, -60px) scale(1.05) rotate(20deg);
    }
    80% {
        transform: translate(-50px, 30px) scale(1.02) rotate(-15deg);
    }
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
}

/* Floating Icons - Schwebende IT-Icons */
.floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.float-icon {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0;
    animation: floatIcon 20s ease-in-out infinite;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes floatIcon {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    5% {
        opacity: 0.1;
    }
    15% {
        opacity: 0.2;
        transform: translateY(80vh) translateX(20px) rotate(45deg) scale(1);
    }
    35% {
        opacity: 0.18;
        transform: translateY(50vh) translateX(-15px) rotate(180deg) scale(1.1);
    }
    50% {
        opacity: 0.15;
        transform: translateY(30vh) translateX(25px) rotate(225deg) scale(1);
    }
    70% {
        opacity: 0.12;
        transform: translateY(10vh) translateX(-20px) rotate(300deg) scale(0.95);
    }
    85% {
        opacity: 0.08;
    }
    100% {
        transform: translateY(-10vh) translateX(0) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

/* Container anpassen */
.container {
    background: transparent;
    transition: background 0.5s ease;
}

.main-content {
    background: transparent;
    transition: all 0.3s ease-in-out;
}

.sidebar {
    transition: all 0.3s ease-in-out;
}

/* Hover-Effekte */
.stat-card,
.quick-card,
.lf-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover,
.quick-card:hover,
.lf-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(79, 70, 229, 0.12);
}

/* Dark Mode Anpassungen */
body.dark-mode .animated-background {
    background: linear-gradient(135deg, 
        #0f172a 0%, 
        #1e1b4b 25%,
        #312e81 50%, 
        #1e293b 75%,
        #0f172a 100%);
    background-size: 400% 400%;
}

body.dark-mode .main-content {
    background: transparent;
}

body.dark-mode .gradient-orb {
    opacity: 0.2;
}

/* Topic Header mit Box Design */
#topicHeader {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
}

#topicHeader::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

#topicHeader h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    color: white;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.dark-mode #topicHeader {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
}

/* Performance Optimierung */
.animated-background,
.gradient-orb,
.float-icon {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ===== Schwebendes Einstellungs-Menü ===== */
.floating-settings-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35), 0 0 0 1px rgba(79, 70, 229, 0.1);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-settings-btn:hover {
    transform: scale(1.08) rotate(90deg);
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.45), 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.floating-settings-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* ===== Scroll-to-Top Button ===== */
.scroll-to-top-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.scroll-to-top-btn:active {
    transform: translateY(-2px) scale(0.95);
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Settings Menu Panel */
.settings-menu {
    position: fixed;
    bottom: -400px;
    right: 2rem;
    width: 340px;
    max-height: calc(100vh - 7rem);
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.08);
    z-index: 1002;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.settings-menu.active {
    bottom: 6rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.settings-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.settings-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 12rem);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.setting-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.theme-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.theme-text {
    white-space: nowrap;
}

/* Impressum Button */
.impressum-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.impressum-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Impressum Content */
.impressum-content {
    max-width: 800px;
}

.impressum-content h4 {
    color: var(--primary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.impressum-content p {
    line-height: 1.6;
    margin: 0.5rem 0;
}

/* ===== Lernfeld-Details - Verbesserte Styles ===== */

/* Topic Content Sections */
.topic-content-section {
    padding: 1rem;
    margin: 0;
    max-width: 100%;
    overflow: visible;
}

.topic-content-section h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.topic-content-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topic-content-section p {
    margin: 1.2rem 0;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1rem;
}

.topic-content-section ul,
.topic-content-section ol {
    line-height: 1.7;
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.topic-content-section li {
    margin: 0.4rem 0;
    color: var(--text-secondary);
}

.topic-content-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Schöne Tabellen */
.topic-content-section table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: table;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.topic-content-section table th {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 1rem 1.1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    border: none;
}

.topic-content-section table td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: top;
    background: var(--bg-primary);
    font-size: 0.96rem;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.topic-content-section table tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-content-section table tbody tr:nth-child(even) td {
    background: var(--bg-secondary);
}

.topic-content-section table tbody tr:hover td {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), transparent);
    transform: translateX(2px);
}

.topic-content-section table tbody tr:hover {
    box-shadow: inset 3px 0 12px rgba(37, 99, 235, 0.12);
}

.topic-content-section table tbody tr:nth-child(even):hover td {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), var(--bg-secondary));
}

.topic-content-section table tbody tr:last-child td {
    border-bottom: none;
}

.topic-content-section table strong {
    color: var(--primary-color);
    font-weight: 700;
}

.topic-content-section table code {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

body.dark-mode .topic-content-section table {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.2);
}

body.dark-mode .topic-content-section table th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

body.dark-mode .topic-content-section table code {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Warning & Info Boxen */
.topic-content-section .warning-box,
.topic-content-section .info-box,
.topic-content-section .exam-tip-box {
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    border-left: 4px solid;
    position: relative;
}

.topic-content-section .warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border-left-color: #f59e0b;
    color: #92400e;
}

.topic-content-section .info-box {
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    border-left-color: var(--primary-color);
    color: #312e81;
}

.topic-content-section .exam-tip-box {
    background: linear-gradient(135deg, #d1fae5 0%, #dcfce7 100%);
    border-left-color: var(--secondary-color);
    color: #064e3b;
}

.topic-content-section .warning-box strong,
.topic-content-section .info-box strong,
.topic-content-section .exam-tip-box strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Dark Mode Anpassungen */
body.dark-mode .topic-content-section .warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%);
    color: #fbbf24;
    border-left-color: #f59e0b;
}

body.dark-mode .topic-content-section .info-box {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(129, 140, 248, 0.08) 100%);
    color: #a5b4fc;
    border-left-color: var(--primary-light);
}

body.dark-mode .topic-content-section .exam-tip-box {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.1) 0%, rgba(52, 211, 153, 0.06) 100%);
    color: #6ee7b7;
    border-left-color: var(--secondary-color);
}

body.dark-mode .topic-content-section table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.1);
}

/* Code-Blöcke */
.topic-content-section code {
    background: rgba(79, 70, 229, 0.06);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.88em;
    color: var(--primary-color);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.topic-content-section pre {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    line-height: 1.6;
}

.topic-content-section pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--text-primary);
}

/* Verbesserte Topic Cards */
.topic-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    border-radius: 0 4px 4px 0;
}

.topic-card:hover {
    transform: translateY(-3px) translateX(2px);
    box-shadow: var(--shadow-card-hover);
}

.topic-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.08rem;
    font-weight: 700;
    padding-left: 0.5rem;
}

.topic-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.topic-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    max-height: 500px;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.topic-content::-webkit-scrollbar {
    width: 6px;
}

.topic-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.topic-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    opacity: 0.6;
}

.topic-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #4338ca);
}

@media (max-width: 768px) {
    .topic-content {
        max-height: 350px;
    }
    
    .topic-content-section {
        padding: 0.75rem;
    }
    
    .topic-content-section table {
        font-size: 0.82rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .topic-content-section table th,
    .topic-content-section table td {
        padding: 0.45rem;
        white-space: nowrap;
    }
    
    .topic-card {
        padding: 0.85rem;
    }

    .topic-card h4 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .topic-content {
        max-height: 300px;
    }

    .topic-content-section {
        padding: 0.5rem;
    }

    .topic-content-section table {
        font-size: 0.75rem;
    }

    .topic-card {
        padding: 0.7rem;
    }
}

/* Dark Mode Anpassungen für Settings Menu */
body.dark-mode .settings-menu {
    background: var(--bg-secondary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

body.dark-mode .theme-toggle-btn {
    background: var(--bg-primary);
}

body.dark-mode .theme-toggle-btn:hover {
    background: var(--primary-color);
}

/* ===== Dark Mode Circular Reveal Transition ===== */
.dark-mode-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    clip-path: circle(0% at var(--dm-x, 50%) var(--dm-y, 50%));
    transition: none;
}

.dark-mode-transition-overlay.expanding {
    animation: dmCircleExpand 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes dmCircleExpand {
    0%   { clip-path: circle(0% at var(--dm-x, 50%) var(--dm-y, 50%)); }
    100% { clip-path: circle(150% at var(--dm-x, 50%) var(--dm-y, 50%)); }
}

/* Overlay bekommt die Farben des ZIEL-Theme */
.dark-mode-transition-overlay.to-dark {
    background: rgba(30, 41, 59, 0.45);
}

.dark-mode-transition-overlay.to-light {
    background: rgba(248, 250, 252, 0.45);
}

/* Subtiler Glow-Ring am Ursprungspunkt */
.dark-mode-transition-overlay::after {
    content: '';
    position: absolute;
    left: var(--dm-x, 50%);
    top: var(--dm-y, 50%);
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
}

.dark-mode-transition-overlay.expanding::after {
    animation: dmGlowRing 0.6s ease-out forwards;
}

.dark-mode-transition-overlay.to-dark::after {
    background: radial-gradient(circle, rgba(129, 140, 248, 0.6) 0%, transparent 70%);
    box-shadow: 0 0 40px 20px rgba(129, 140, 248, 0.3);
}

.dark-mode-transition-overlay.to-light::after {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.6) 0%, transparent 70%);
    box-shadow: 0 0 40px 20px rgba(251, 191, 36, 0.3);
}

@keyframes dmGlowRing {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50%  { transform: translate(-50%, -50%) scale(3); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(6); opacity: 0; }
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .floating-settings-btn {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 46px;
        height: 46px;
        font-size: 1.35rem;
    }
    
    .scroll-to-top-btn {
        bottom: 1.2rem;
        left: 1.2rem;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .settings-menu {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-height: calc(100vh - 5.5rem);
    }

    .settings-menu.active {
        bottom: 4.5rem;
    }

    .settings-content {
        max-height: calc(100vh - 10rem);
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .floating-settings-btn {
        bottom: 0.8rem;
        right: 0.8rem;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    
    .scroll-to-top-btn {
        bottom: 0.8rem;
        left: 0.8rem;
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .settings-menu {
        right: 0.5rem;
        left: 0.5rem;
        max-height: calc(100vh - 4.75rem);
    }

    .settings-menu.active {
        bottom: 4rem;
    }

    .settings-content {
        max-height: calc(100vh - 8.5rem);
        padding: 0.9rem;
    }
}

/* ===== Loading Spinner ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

/* Rotating Circle Spinner */
.spinner-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-circle:nth-child(2) {
    border-top-color: var(--accent-color);
    border-right-color: var(--primary-color);
    animation-duration: 1.5s;
    animation-direction: reverse;
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
}

.spinner-circle:nth-child(3) {
    border-top-color: #f59e0b;
    border-right-color: #10b981;
    animation-duration: 2s;
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: white;
    margin-top: 60px;
    font-weight: 600;
    white-space: nowrap;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Pulsing Icon */
.loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
    }
}

/* Dark Mode Spinner */
body.dark-mode .loading-overlay {
    background: rgba(0, 0, 0, 0.85);
}

/* ===== Header mit Logo (Kopfleiste) ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light), var(--accent-color));
    background-size: 200% 200%;
    animation: headerGlow 8s ease-in-out infinite;
    padding: 1.2rem 2rem;
    margin: 0 0 2rem 0;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.2);
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: headerShine 6s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes headerShine {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white;
    transition: all var(--transition-base);
    width: fit-content;
    position: relative;
    z-index: 1;
}

.header-logo:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.header-logo-icon {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.dashboard-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
}

.dashboard-svg-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ui-icon-only,
.ui-leading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
}

.ui-icon-only svg,
.ui-leading-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ui-leading-label {
    display: inline-block;
}

.header-logo-icon .ui-icon-only,
.logo-icon .ui-icon-only,
.quick-icon .ui-icon-only,
.area-icon .ui-icon-only,
.calc-icon .ui-icon-only,
.quiz-icon .ui-icon-only,
.topic-icon .ui-icon-only,
.stat-icon .ui-icon-only,
.stat-hero-icon .ui-icon-only,
.feature-icon .ui-icon-only,
.floating-settings-btn .ui-icon-only {
    width: 100%;
    height: 100%;
}

.content-section > h2,
.section-title,
.impressum-btn,
.theme-btn,
.data-btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.trainer-tab,
.filter-btn,
.subnet-tab,
.start-button,
.stat-card h3,
.skill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.content-section > h2 .ui-leading-icon,
.section-title .ui-leading-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.btn-primary .ui-leading-icon,
.btn-secondary .ui-leading-icon,
.btn-danger .ui-leading-icon,
.data-btn .ui-leading-icon,
.impressum-btn .ui-leading-icon,
.theme-btn .ui-leading-icon,
.trainer-tab .ui-leading-icon,
.filter-btn .ui-leading-icon,
.subnet-tab .ui-leading-icon,
.start-button .ui-leading-icon,
.skill-btn .ui-leading-icon {
    width: 1rem;
    height: 1rem;
}

.stat-card h3 .ui-leading-icon {
    width: 1rem;
    height: 1rem;
}

.header-logo-icon.dashboard-svg-icon {
    width: 2.8rem;
    height: 2.8rem;
    color: rgba(255, 255, 255, 0.96);
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--primary-color);
    opacity: 0.9;
}

#greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.greeting-mark {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0.9;
}

.greeting-mark-moon {
    width: 1.9rem;
    height: 1.9rem;
    opacity: 0.98;
}

.greeting-text {
    display: inline-block;
}

.quick-icon.dashboard-svg-icon {
    width: 2rem;
    height: 2rem;
    color: rgba(255, 255, 255, 0.96);
}

.area-icon.dashboard-svg-icon {
    width: 2rem;
    height: 2rem;
    color: var(--primary-color);
}

.button-icon {
    width: 1rem;
    height: 1rem;
}

.data-actions button,
.impressum-btn,
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.theme-toggle-btn {
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn::before,
.theme-toggle-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
}

.theme-toggle-btn::before {
    background:
        radial-gradient(circle at 18% 34%, rgba(255, 255, 255, 0.95) 0 1.1px, transparent 1.4px),
        radial-gradient(circle at 74% 28%, rgba(191, 219, 254, 0.9) 0 1.2px, transparent 1.5px),
        radial-gradient(circle at 58% 70%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.3px),
        radial-gradient(circle at 84% 64%, rgba(147, 197, 253, 0.78) 0 0.95px, transparent 1.25px);
    animation: themeStarFloat 8s ease-in-out infinite;
}

.theme-toggle-btn::after {
    background:
        radial-gradient(circle at 32% 62%, rgba(255, 255, 255, 0.85) 0 0.95px, transparent 1.2px),
        radial-gradient(circle at 68% 46%, rgba(191, 219, 254, 0.8) 0 1px, transparent 1.35px);
    animation: themeStarTwinkle 5.5s ease-in-out infinite;
}

.settings-trigger-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.settings-header h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.settings-header-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.9;
}

.theme-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.theme-icon svg {
    width: 100%;
    height: 100%;
}

.theme-text {
    position: relative;
    z-index: 1;
}

@keyframes themeStarFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.42;
    }
    50% {
        transform: translateY(-1.5px) scale(1.03);
        opacity: 0.68;
    }
}

@keyframes themeStarTwinkle {
    0%, 100% {
        opacity: 0.28;
    }
    35% {
        opacity: 0.62;
    }
    70% {
        opacity: 0.4;
    }
}

.header-logo-text h1 {
    font-size: 1.45rem;
    margin: 0;
    color: white;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-logo-text p {
    font-size: 0.82rem;
    margin: 0.2rem 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

@media (max-width: 768px) {
    .page-header {
        padding: 0.75rem 1rem;
        margin: -1rem -1rem 1.25rem -1rem;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    .header-logo {
        gap: 0.65rem;
    }
    
    .header-logo-icon {
        font-size: 1.8rem;
    }
    
    .header-logo-text h1 {
        font-size: 1.05rem;
    }
    
    .header-logo-text p {
        font-size: 0.68rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 0.6rem 0.75rem;
        margin: -0.65rem -0.65rem 1rem -0.65rem;
    }
    
    .header-logo-icon {
        font-size: 1.5rem;
    }
    
    .header-logo-text h1 {
        font-size: 0.95rem;
    }
    
    .header-logo-text p {
        font-size: 0.62rem;
    }
}

/* Logo - Klickbar zurück zum Dashboard */
.logo-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.logo-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light), var(--accent-color));
    background-size: 200% 200%;
    animation: headerGlow 8s ease-in-out infinite;
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.08), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.logo:hover::after {
    opacity: 1;
}

.logo-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.logo-text h1 {
    font-size: 1.2rem;
    margin: 0;
    color: white;
    font-weight: 700;
}

.logo-text p {
    font-size: 0.75rem;
    margin: 0.25rem 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state-small {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Info Boxes */
.info-box {
    background: var(--bg-primary);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.info-box h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

/* Quiz Cards */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.quiz-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quiz-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.quiz-questions {
    display: inline-block;
    margin-top: var(--spacing-sm);
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

/* Test Cards */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.test-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.test-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.test-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.test-duration {
    display: inline-block;
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Calculation Cards */
.calc-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.calc-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.calc-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.calc-card ul {
    list-style: none;
    margin-top: var(--spacing-md);
}

.calc-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.calc-card li:last-child {
    border-bottom: none;
}

/* AP Cards */
.ap-overview {
    display: grid;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.ap-card {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.ap-topics {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.ap-topics ul {
    margin-top: var(--spacing-sm);
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.resource-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

/* Goal Forms and Cards */
.goal-form {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.goal-form input[type="text"],
.goal-form textarea,
.goal-form input[type="date"],
.goal-form select {
    width: 100%;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.goals-list {
    display: grid;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.goal-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.goal-card.priority-high {
    border-left-color: var(--danger-color);
}

.goal-card.priority-low {
    border-left-color: var(--secondary-color);
}

.goal-card.completed {
    opacity: 0.7;
    border-left-color: var(--text-light);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.goal-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.goal-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

/* Lernfeld Progress List */
.lf-progress-list {
    display: grid;
    gap: var(--spacing-sm);
}

.lf-progress-item {
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.lf-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

/* Achievement Cards */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.achievement-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 2px solid var(--secondary-color);
}

.achievement-card.locked {
    opacity: 0.5;
    border-color: var(--border-color);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

/* Repeat/Recommendation Cards */
.recommendation-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.schedule-section {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
}

/* Favorites */
.favorites-list {
    display: grid;
    gap: var(--spacing-md);
}

.favorite-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.remove-fav {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.remove-fav:hover {
    transform: scale(1.2);
}

/* Utility Classes */
.text-muted {
    color: var(--text-secondary);
    font-style: italic;
}

/* Lernfeld Detail Seite */
.back-nav {
    margin-bottom: var(--spacing-lg);
}

.lf-progress-section {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: var(--spacing-lg) 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.lf-content {
    margin: var(--spacing-xl) 0;
}

.lf-section {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.lf-section h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
}

.topics-grid {
    display: grid;
    gap: var(--spacing-md);
}

/* Topic-Tags in der Lernfeld-Übersicht */
.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0;
}

.topic-tag {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    line-height: 1.4;
    font-weight: 500;
    text-decoration: none;
}

.topic-tag:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.2);
}

/* Gelesen-markierte Topic-Tags */
.topic-tag-read {
    background: rgba(6, 214, 160, 0.12);
    color: #059669;
    border-color: rgba(6, 214, 160, 0.3);
    font-weight: 600;
}

body.dark-mode .topic-tag-read {
    background: rgba(6, 214, 160, 0.15);
    color: #34d399;
    border-color: rgba(6, 214, 160, 0.25);
}

/* ===== Per-Topic Read Button ===== */
.topic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.topic-header-text {
    flex: 1;
    min-width: 0;
}

.btn-read-toggle {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    line-height: 1.3;
}

.btn-read-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.12);
}

.btn-read-toggle.is-read {
    background: rgba(6, 214, 160, 0.12);
    border-color: rgba(6, 214, 160, 0.4);
    color: #059669;
}

.btn-read-toggle.is-read:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

body.dark-mode .btn-read-toggle.is-read {
    color: #34d399;
    background: rgba(6, 214, 160, 0.15);
    border-color: rgba(6, 214, 160, 0.3);
}

body.dark-mode .btn-read-toggle.is-read:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Gelesen-Status für Topic-Cards */
.topic-card.topic-read {
    background: rgba(6, 214, 160, 0.04);
    border-color: rgba(6, 214, 160, 0.25);
}

.topic-card.topic-read::before {
    background: linear-gradient(180deg, #06d6a0, #059669) !important;
}

body.dark-mode .topic-card.topic-read {
    background: rgba(6, 214, 160, 0.06);
    border-color: rgba(6, 214, 160, 0.2);
}

@media (max-width: 480px) {
    .topic-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-read-toggle {
        align-self: flex-start;
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }
}

.topic-card {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.topic-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.topic-card h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.topic-content {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.topic-content h5 {
    color: var(--text-primary);
    margin: var(--spacing-md) 0 var(--spacing-xs) 0;
}

.topic-content ul {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
}

.topic-content li {
    margin: var(--spacing-xs) 0;
    color: var(--text-secondary);
}

.learning-goals {
    list-style: none;
    padding: 0;
}

.learning-goals li {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--secondary-color);
}

.learning-goals li:before {
    content: "✓ ";
    color: var(--secondary-color);
    font-weight: bold;
    margin-right: var(--spacing-xs);
}

.key-terms {
    display: grid;
    gap: var(--spacing-md);
}

.term-card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-color);
}

.term-card h4 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}

.term-card p {
    color: var(--text-secondary);
}

.summary-box {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    font-size: 1.05rem;
    line-height: 1.8;
}

.exam-info {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
}

.exam-info p {
    margin: var(--spacing-sm) 0;
    font-size: 1.05rem;
}

.lf-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.lf-actions button {
    flex: 1;
    min-width: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-grid,
    .test-grid,
    .calc-categories,
    .resource-grid,
    .achievement-grid {
        grid-template-columns: 1fr;
    }

    .ap-card,
    .resource-card,
    .calc-card,
    .quiz-card,
    .test-card,
    .goal-form,
    .goal-card,
    .goal-creator {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .goal-header,
    .goal-meta,
    .favorite-header,
    .progress-info,
    .lf-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .goal-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .lf-actions {
        flex-direction: column;
    }

    .lf-actions button {
        width: 100%;
        min-width: unset;
    }

    .summary-box {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .exam-info {
        padding: 1rem;
    }

    .exam-info p {
        font-size: 0.92rem;
    }

    .term-card {
        padding: 0.75rem;
    }

    .term-card h4 {
        font-size: 1rem;
    }

    .topic-tag {
        font-size: 0.68rem;
        padding: 0.2rem 0.5rem;
    }

    .topic-tags {
        gap: 0.25rem;
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .topic-tag {
        font-size: 0.62rem;
        padding: 0.15rem 0.4rem;
    }

    .ap-card h3,
    .resource-card h4,
    .quiz-card h4,
    .test-card h4,
    .calc-card h3 {
        font-size: 1rem;
    }

    .quiz-icon,
    .test-icon,
    .calc-icon {
        font-size: 2.2rem;
    }

    .goal-meta {
        font-size: 0.8rem;
    }

    .btn-icon {
        font-size: 1rem;
    }

    .summary-box {
        padding: 0.75rem;
        font-size: 0.88rem;
        line-height: 1.65;
    }

    .term-card {
        padding: 0.6rem;
    }

    .term-card h4 {
        font-size: 0.92rem;
    }
}

/* Calculation Tools */
.calc-container {
    margin-top: var(--spacing-xl);
}

.calc-tools {
    display: grid;
    gap: var(--spacing-xl);
}

.calc-tool {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.calc-tool h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input[type="number"] {
    max-width: 200px;
}

.form-group select {
    max-width: 150px;
    margin-left: var(--spacing-sm);
}

.result-box {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary-color);
}

.result-box h4 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
}

.result-box table {
    width: 100%;
    margin-top: var(--spacing-md);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result-box table th {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 0.75rem 0.9rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.result-box table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.result-box table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.result-box table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.result-box table tbody tr:last-child td {
    border-bottom: none;
}

.result-box .final-result {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: var(--spacing-md);
}

/* ===== Kalkulationen Ergebnis-Tabellen ===== */
.calc-result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--spacing-md) 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background: var(--bg-primary);
}

.calc-result-table tr {
    transition: all 0.2s ease;
}

.calc-result-table th {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    font-weight: 700;
    text-align: left;
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.calc-result-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-result-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05), transparent);
    transform: translateX(2px);
    box-shadow: inset 3px 0 12px rgba(37, 99, 235, 0.1);
}

.calc-result-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.calc-result-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), var(--bg-secondary));
}

.calc-result-table tbody tr:last-child {
    border-bottom: none;
}

.calc-result-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.calc-result-table td:first-child {
    white-space: nowrap;
    padding-right: var(--spacing-md);
    font-weight: 600;
    color: var(--primary-color);
}

.calc-result-table code {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

body.dark-mode .calc-result-table {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .calc-result-table th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

body.dark-mode .calc-result-table code {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.calc-explanation {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-light);
}

body.dark-mode .calc-explanation {
    background: rgba(59, 130, 246, 0.1);
}

.calc-explanation h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.calc-explanation p {
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.input-with-unit {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.input-with-unit input {
    flex: 1;
    max-width: 200px;
}

.input-with-unit select {
    max-width: 120px;
}

/* ===== IP/Subnetting-Rechner ===== */
.subnet-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}
.subnet-tab {
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    transition: all 0.25s;
    flex: 1;
    text-align: center;
    min-width: 100px;
}
.subnet-tab:hover {
    border-color: var(--primary-color, #2563eb);
    color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.05);
}
.subnet-tab.active {
    background: linear-gradient(135deg, var(--primary-color, #2563eb), var(--primary-dark, #1e40af));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.subnet-mode { display: none; }
.subnet-mode.active { display: block; }
.mode-desc {
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 1rem;
    padding: 0.6rem 0.8rem;
    background: rgba(37, 99, 235, 0.04);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color, #2563eb);
}

/* CIDR Slider */
.cidr-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.cidr-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color, #2563eb);
    height: 6px;
}
.cidr-input-group {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color, #2563eb);
}
.cidr-input-group input {
    width: 48px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.3rem;
    background: var(--bg-primary, #fff);
    color: var(--primary-color, #2563eb);
}
.cidr-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    background: var(--bg-secondary, #f8fafc);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* Result Grid Cards */
.subnet-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.subnet-info-card {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    text-align: center;
}
.subnet-info-card.highlight-green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.03));
    border-color: rgba(16, 185, 129, 0.3);
}
.subnet-info-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.25rem;
}
.subnet-info-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.subnet-info-value.big {
    font-size: 1.4rem;
    color: var(--primary-color, #2563eb);
}

/* Binary Display */
.binary-display {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin: 0.8rem 0;
}
.binary-display h4 { font-size: 0.85rem; margin-bottom: 0.5rem; }
.binary-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem;
}
.binary-label {
    font-weight: 700;
    min-width: 50px;
    color: var(--text-secondary, #64748b);
}
.binary-row code {
    background: rgba(37, 99, 235, 0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    color: var(--text-primary, #1e293b);
}

/* Visual Subnet Bar */
.subnet-visual-bar {
    display: flex;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    margin: 0.8rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.subnet-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    transition: all 0.3s;
    position: relative;
}
.subnet-bar-segment span {
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
}
.subnet-bar-segment.free {
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.03),
        rgba(0,0,0,0.03) 5px,
        rgba(0,0,0,0.07) 5px,
        rgba(0,0,0,0.07) 10px
    ) !important;
}
.subnet-bar-segment.free span { color: var(--text-secondary, #64748b); text-shadow: none; }
.subnet-bar-segment:hover { filter: brightness(1.15); transform: scaleY(1.1); }

/* Subnet Detail Table */
.subnet-table-wrap {
    overflow-x: auto;
    margin: 0.5rem 0;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background: var(--bg-primary);
}

.subnet-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.subnet-detail-table thead th {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.subnet-detail-table tbody td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.subnet-detail-table tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.subnet-detail-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.subnet-detail-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), transparent);
    transform: translateX(1px);
    box-shadow: inset 3px 0 12px rgba(37, 99, 235, 0.12);
}

.subnet-detail-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), var(--bg-secondary));
}

.subnet-detail-table tr:last-child td {
    border-bottom: none;
}

body.dark-mode .subnet-table-wrap {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .subnet-detail-table thead th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Efficiency Bar */
.host-efficiency-bar {
    position: relative;
    height: 32px;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    margin: 0.8rem 0;
}
.efficiency-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 10px;
    transition: width 0.5s ease;
    min-width: 2%;
}
.efficiency-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    mix-blend-mode: multiply;
}

/* Alt Options */
.alt-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.alt-option {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    text-align: center;
    background: var(--bg-secondary, #f8fafc);
}
.alt-option.recommended {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
}
.alt-option.insufficient { opacity: 0.5; }
.alt-cidr {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color, #2563eb);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.alt-detail {
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.2rem;
    gap: 0.1rem;
}

/* VLSM Rows */
.vlsm-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    align-items: center;
}
.vlsm-row .vlsm-name {
    flex: 1.5;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1e293b);
}
.vlsm-row .vlsm-hosts {
    flex: 1;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1e293b);
}
.vlsm-remove {
    background: none;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.vlsm-remove:hover {
    background: var(--danger-color, #ef4444);
    color: white;
    border-color: transparent;
}
.vlsm-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .subnet-tabs { flex-direction: column; }
    .subnet-tab { min-width: auto; }
    .subnet-result-grid { grid-template-columns: repeat(2, 1fr); }
    .cidr-slider-wrap { flex-wrap: wrap; }
    .alt-options { flex-direction: column; }
}

/* ===== Text-Konverter ===== */
.text-convert-result {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}
.convert-block {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 0.8rem 1rem;
    position: relative;
}
.convert-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.4rem;
}
.convert-output {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    word-break: break-all;
    color: var(--text-primary, #1e293b);
    background: var(--bg-primary, #fff);
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    max-height: 150px;
    overflow-y: auto;
    user-select: all;
}
.convert-output.decoded-text {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    letter-spacing: 0.5px;
}
.convert-copy {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    transition: all 0.2s;
}
.convert-copy:hover {
    background: var(--primary-color, #2563eb);
    color: white;
    border-color: transparent;
}

/* ===== Globale Suche ===== */
.search-fab {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color, #2563eb), var(--primary-dark, #1e40af));
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35), 0 0 0 1px rgba(37, 99, 235, 0.1);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.2);
}
.search-fab:active {
    transform: translateY(0) scale(0.97);
}

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
}
.search-overlay.active {
    display: flex;
    animation: searchFadeIn 0.25s ease;
}

@keyframes searchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal {
    background: var(--bg-primary, #fff);
    border-radius: 20px;
    width: 92%;
    max-width: 640px;
    max-height: 75vh;
    overflow: hidden;
    box-shadow: 
        0 24px 80px rgba(0,0,0,0.25),
        0 0 0 1px rgba(255,255,255,0.1),
        0 0 60px rgba(37, 99, 235, 0.08);
    display: flex;
    flex-direction: column;
    animation: searchSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchSlideUp {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

body.dark-mode .search-modal {
    background: #1e293b;
    box-shadow: 
        0 24px 80px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.06),
        0 0 60px rgba(37, 99, 235, 0.12);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.4rem;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.03), transparent);
}
.search-input-wrap .search-icon {
    font-size: 1.25rem;
    opacity: 0.45;
    flex-shrink: 0;
}
.search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-primary, #1e293b);
    letter-spacing: -0.01em;
}
.search-input-wrap input::placeholder {
    color: var(--text-light, #94a3b8);
    font-weight: 400;
}
.search-input-wrap .search-close {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 600;
    line-height: 1;
}
.search-input-wrap .search-close:hover {
    background: var(--danger-color, #ef4444);
    color: white;
    border-color: transparent;
}

.search-results-list {
    overflow-y: auto;
    max-height: 58vh;
    padding: 0.35rem;
    scroll-behavior: smooth;
}
.search-results-list::-webkit-scrollbar {
    width: 5px;
}
.search-results-list::-webkit-scrollbar-track {
    background: transparent;
}
.search-results-list::-webkit-scrollbar-thumb {
    background: var(--border-color, #e2e8f0);
    border-radius: 10px;
}

/* Result Count Bar */
.search-results-count {
    padding: 0.55rem 1.1rem;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-light, #94a3b8);
    background: linear-gradient(180deg, var(--bg-secondary, #f8fafc), transparent);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

/* Category Groups */
.search-category {
    margin: 0.3rem 0;
}
.search-category:last-child { margin-bottom: 0; }

.search-category-header {
    padding: 0.55rem 1.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary, #64748b);
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary, #fff);
    backdrop-filter: blur(8px);
}
body.dark-mode .search-category-header {
    background: rgba(30, 41, 59, 0.95);
}

.search-category-count {
    font-size: 0.6rem;
    background: linear-gradient(135deg, var(--primary-color, #2563eb), var(--primary-dark, #1e40af));
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    min-width: 20px;
    text-align: center;
}

/* Result Items */
.search-result-item {
    padding: 0.7rem 1rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.15rem 0.3rem;
    border: 1px solid transparent;
    position: relative;
}
.search-result-item:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.04));
    border-color: rgba(37, 99, 235, 0.12);
    transform: translateX(2px);
}
.search-result-item:active {
    transform: scale(0.99);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color, #e2e8f0);
}
body.dark-mode .search-result-icon {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
}

.search-result-content {
    flex: 1;
    min-width: 0;
}
.search-result-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #1e293b);
    line-height: 1.35;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}
.search-result-desc {
    font-size: 0.76rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.2rem;
    line-height: 1.45;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-result-location {
    font-size: 0.68rem;
    color: var(--primary-color, #2563eb);
    margin-top: 0.25rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.search-result-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.55rem;
    border-radius: 8px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.35rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.search-more-results {
    padding: 0.5rem 1rem;
    font-size: 0.72rem;
    color: var(--text-light, #94a3b8);
    text-align: center;
    font-style: italic;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    margin: 0 0.8rem;
}

/* Empty State */
.search-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-secondary, #64748b);
}
.search-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    filter: grayscale(0.3);
}
.search-empty p {
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Hint Bar */
.search-hint {
    padding: 0.65rem 1.3rem;
    font-size: 0.7rem;
    color: var(--text-light, #94a3b8);
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    gap: 1.2rem;
    background: linear-gradient(0deg, rgba(37, 99, 235, 0.02), transparent);
    flex-wrap: wrap;
}
.search-hint kbd {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .search-overlay { padding-top: 3vh; }
    .search-modal {
        width: 96%;
        max-height: 85vh;
        border-radius: 16px;
    }
    .search-fab {
        top: 0.8rem;
        right: 0.8rem;
        width: 38px;
        height: 38px;
        font-size: 1rem;
        border-radius: 12px;
    }
    .search-result-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    .search-hint { display: none; }
}

/* ===== Große Bildschirme (ab 1920px) ===== */
@media (min-width: 1920px) {
    /* Page Header */
    .page-header {
        padding: 1.5rem 2.5rem;
        margin: -2rem -3rem 2.5rem -3rem;
    }

    .header-logo-icon {
        font-size: 3.2rem;
    }

    .header-logo-text h1 {
        font-size: 1.65rem;
    }

    .header-logo-text p {
        font-size: 0.95rem;
    }

    /* Topic Cards */
    .topic-card {
        padding: 1.5rem;
    }

    .topic-card h4 {
        font-size: 1.2rem;
    }

    .topic-card p {
        font-size: 0.95rem;
    }

    /* Calc Cards */
    .calc-categories {
        grid-template-columns: repeat(3, 1fr);
    }

    .calc-card {
        padding: 2rem;
    }

    .calc-icon {
        font-size: 3.5rem;
    }

    .calc-card li {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }

    /* AP Cards */
    .ap-card {
        padding: 2rem;
    }

    /* Test Grid */
    .test-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .test-card {
        padding: 2rem;
    }

    .test-icon {
        font-size: 3.5rem;
    }

    /* Resource Grid */
    .resource-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .resource-card {
        padding: 2rem;
    }

    /* Floating Buttons */
    .floating-settings-btn {
        width: 64px;
        height: 64px;
        font-size: 1.8rem;
    }

    .scroll-to-top-btn {
        width: 56px;
        height: 56px;
        font-size: 1.7rem;
    }

    /* Settings Menu */
    .settings-menu {
        width: 380px;
    }

    .setting-label {
        font-size: 1.05rem;
    }

    /* Loading Spinner */
    .loading-spinner {
        width: 100px;
        height: 100px;
    }

    .loading-text {
        font-size: 1.75rem;
    }

    /* Form Elements */
    .form-group label {
        font-size: 1.05rem;
    }

    .form-group input,
    .form-group select {
        font-size: 1.05rem;
    }

    /* Result Box */
    .result-box {
        padding: 2rem;
    }

    .result-box .final-result {
        font-size: 1.75rem;
    }

    /* Quiz questions on separate pages */
    .quiz-icon {
        font-size: 3rem;
    }

    /* Topic Tags */
    .topic-tag {
        font-size: 0.82rem;
        padding: 0.3rem 0.7rem;
    }

    .btn-read-toggle {
        font-size: 0.88rem;
        padding: 0.55rem 1rem;
    }

    /* Search FAB */
    .search-fab {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .search-modal {
        max-width: 750px;
    }

    .search-input {
        font-size: 1.1rem;
    }

    /* Subnet / VLSM */
    .vlsm-row input,
    .vlsm-row .vlsm-hosts {
        font-size: 0.95rem;
    }

    /* Text Converter */
    .convert-output {
        font-size: 0.95rem;
    }
}

/* ===== QHD / 2K & 4K mit Skalierung (ab 2560px) ===== */
@media (min-width: 2560px) {
    /* Gradient Orbs */
    .orb-1 {
        width: 700px;
        height: 700px;
    }

    .orb-2 {

    .ap-overview {
        gap: 1rem;
    }

    .resource-card,
    .test-card,
    .quiz-card,
    .calc-card,
    .ap-card,
    .goal-card,
    .goal-form,
    .goal-creator {
        padding: 1rem;
    }
        width: 800px;
        height: 800px;
    }


    .goal-header,
    .goal-meta,
    .favorite-header,
    .progress-info,
    .lf-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .goal-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .ap-card .btn-primary,
    .resource-card .btn-secondary,
    .goal-form .btn-primary,
    .goal-card .btn-icon,
    .quiz-card,
    .test-card,
    .calc-card {
        width: 100%;
    }
    .orb-3 {
        width: 650px;
        height: 650px;
    }

    /* Float Icons */
    .float-icon {
        font-size: 3.5rem;
    }

    /* Page Header */
    .page-header {
        padding: 1.75rem 3rem;
        margin: -3rem -4rem 3rem -4rem;
    }

    .header-logo-icon {
        font-size: 3.8rem;
    }

    .header-logo-text h1 {
        font-size: 2rem;
    }

    .header-logo-text p {
        font-size: 1.1rem;
    }

    .header-logo {
        gap: 1.25rem;
    }

    /* Topic Cards */
    .topic-card {
        padding: 1.75rem;
        border-radius: var(--radius-xl);
    }

    .topic-card h4 {
        font-size: 1.35rem;
    }

    .topic-card p {
        font-size: 1.1rem;
    }

    .topic-content {
        max-height: 600px;
    }

    .topic-content-section {
        padding: 1.25rem;
    }

    .topic-content-section table th,
    .topic-content-section table td {
        padding: 0.85rem;
        font-size: 1.05rem;
    }

    /* Calc Cards */
    .calc-categories {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .calc-card {
        padding: 2.25rem;
        border-radius: var(--radius-xl);
    }

    .calc-icon {
        font-size: 4rem;
        margin-bottom: 1.5rem;
    }

    .calc-card h3 {
        font-size: 1.35rem;
    }

    .calc-card li {
        font-size: 1.05rem;
        padding: 0.7rem 0;
    }

    /* AP Cards */
    .ap-card {
        padding: 2.5rem;
        border-radius: var(--radius-xl);
    }

    .ap-card h3 {
        font-size: 1.5rem;
    }

    .ap-topics {
        padding: 1.5rem;
        font-size: 1.05rem;
    }

    /* Test Grid */
    .test-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .test-card {
        padding: 2.25rem;
        border-radius: var(--radius-xl);
    }

    .test-icon {
        font-size: 4rem;
    }

    .test-duration {
        font-size: 1rem;
    }

    /* Resource Grid */
    .resource-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }

    .resource-card {
        padding: 2.25rem;
        border-radius: var(--radius-xl);
    }

    /* Floating Buttons */
    .floating-settings-btn {
        width: 72px;
        height: 72px;
        font-size: 2rem;
        border-radius: var(--radius-2xl);
        bottom: 2.5rem;
        right: 2.5rem;
    }

    .scroll-to-top-btn {
        width: 64px;
        height: 64px;
        font-size: 1.9rem;
        bottom: 2.5rem;
        left: 2.5rem;
    }

    /* Settings Menu */
    .settings-menu {
        width: 420px;
        border-radius: var(--radius-2xl);
    }

    .settings-header {
        padding: 1.5rem 1.75rem;
    }

    .settings-header h3 {
        font-size: 1.2rem;
    }

    .settings-content {
        padding: 1.75rem;
    }

    .setting-item {
        padding: 1rem 0;
    }

    .setting-label {
        font-size: 1.15rem;
    }

    .close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
    }

    /* Loading Spinner */
    .loading-spinner {
        width: 120px;
        height: 120px;
    }

    .loading-text {
        font-size: 2rem;
        margin-top: 80px;
    }

    .loading-icon {
        font-size: 2.75rem;
    }

    /* Form Elements */
    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-group label {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
    }

    .form-group input,
    .form-group select {
        font-size: 1.1rem;
        padding: 0.85rem 1rem;
        border-radius: var(--radius-lg);
    }

    .form-group input[type="number"] {
        max-width: 250px;
    }

    /* Result Box */
    .result-box {
        padding: 2rem 2.25rem;
        border-radius: var(--radius-lg);
    }

    .result-box h4 {
        font-size: 1.2rem;
    }

    .result-box .final-result {
        font-size: 2rem;
    }

    .result-box td {
        padding: 0.65rem;
        font-size: 1.05rem;
    }

    /* Calc Result Table */
    .calc-result-table td {
        padding: 0.85rem 1rem;
        font-size: 1.05rem;
    }

    /* Quiz Icon */
    .quiz-icon {
        font-size: 3.5rem;
    }

    .quiz-questions {
        font-size: 1rem;
        padding: 0.35rem 0.9rem;
    }

    /* Topic Tags */
    .topic-tags {
        gap: 0.5rem;
    }

    .topic-tag {
        font-size: 0.9rem;
        padding: 0.35rem 0.85rem;
    }

    .btn-read-toggle {
        font-size: 0.95rem;
        padding: 0.6rem 1.15rem;
    }

    /* search FAB */
    .search-fab {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
        border-radius: 18px;
    }

    .search-modal {
        max-width: 850px;
    }

    .search-input {
        font-size: 1.2rem;
        padding: 1rem 1.25rem;
    }

    .search-result-icon {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }

    .search-empty-icon {
        font-size: 3rem;
    }

    .search-empty p {
        font-size: 1rem;
    }

    .search-hint {
        font-size: 0.82rem;
    }

    .search-hint kbd {
        font-size: 0.75rem;
    }
}

/* ===== INLINE QUIZZES STYLES ===== */

.inline-quizzes-section {
    margin-top: 3rem;
    padding: 2.5rem 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
}

body.dark-mode .inline-quizzes-section {
    background: transparent;
}

/* Knowledge Checks */
.knowledge-checks {
    margin-bottom: 2.5rem;
}

.knowledge-checks h5 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.knowledge-check-box {
    background: transparent;
    padding: 1.5rem 0;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.knowledge-check-box:last-child {
    border-bottom: none;
}

.knowledge-check-box:hover {
    box-shadow: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    padding-left: 1rem;
    padding-right: 1rem;
}

.check-question {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.check-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.check-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.check-answer {
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border-left: 3px solid var(--secondary-color);
    animation: slideDown 0.3s ease;
}

.check-answer.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.check-answer p {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* Multiple Choice Section */
.inline-multiple-choice {
    margin-top: 2.5rem;
}

.inline-multiple-choice h5 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.inline-question-box {
    background: transparent;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.inline-question-box:last-child {
    border-bottom: none;
}

.inline-question-box h6 {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.inline-answers {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.inline-answer-label {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.75rem;
}

.inline-answer-label:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.inline-answer-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.inline-answer-label span {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    font-size: 1rem;
}

/* Feedback Messages */
.inline-answer-feedback {
    padding: 1.2rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.inline-answer-feedback.hidden {
    display: none;
}

.inline-answer-feedback.quiz-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-left-color: #10b981;
    color: #047857;
}

body.dark-mode .inline-answer-feedback.quiz-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
    color: #6ee7b7;
}

.inline-answer-feedback.quiz-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border-left-color: #ef4444;
    color: #991b1b;
}

body.dark-mode .inline-answer-feedback.quiz-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
    color: #fca5a5;
}

.feedback-content strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.feedback-content p {
    margin: 0.5rem 0 0 0;
    line-height: 1.5;
}

/* Button Disabled State */
.btn-read-toggle:disabled,
.btn-read-toggle.btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: var(--text-light) !important;
}

/* Topic Links */
.topic-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    height: 100%;
}

.topic-link:hover .topic-header {
    transform: translateY(-2px);
}

.topic-status {
    display: flex;
    gap: 0.5rem;
}

.badge-read {
    background: #d1fae5;
    color: #047857;
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

body.dark-mode .badge-read {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.badge-unread {
    background: #fef3c7;
    color: #92400e;
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

body.dark-mode .badge-unread {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 0;
    border-bottom: none;
}


.breadcrumb-nav .btn-secondary {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.breadcrumb-nav .btn-secondary:hover {
    opacity: 1;
}

#breadcrumb-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Topic Detail Content */
#topicHeader {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
}

#topicHeader::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

#topicHeader h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    color: white;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.topic-detail-content {
    background: transparent;
    padding: 2.5rem 0;
    border-radius: 0;
    margin-bottom: 2rem;
    box-shadow: none;
    border-bottom: none;
    line-height: 1.8;
    color: var(--text-primary);
}

.topic-actions {
    display: flex;
    gap: 1.2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    flex-wrap: wrap;
    border-top: none;
}

.topic-actions .btn-primary,
.topic-actions .btn-secondary {
    flex: 1;
    min-width: 220px;
}

/* ===== RPG LEVEL SYSTEM STYLES ===== */

.rpg-info-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
}

.rpg-level-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: transparent;
    border: 3px solid white;
    border-radius: 50%;
    backdrop-filter: none;
    cursor: pointer;
    perspective: 900px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.rpg-level-badge:hover {
    border-color: rgba(219, 234, 254, 0.82);
    box-shadow:
        0 0 10px rgba(96, 165, 250, 0.18),
        0 0 20px rgba(59, 130, 246, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.rpg-level-badge-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-style: preserve-3d;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.rpg-level-badge:hover .rpg-level-badge-inner {
    transform: rotateY(180deg);
}

.rpg-level-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    border-radius: 50%;
}

.rpg-level-face-back {
    transform: rotateY(180deg);
}

.rpg-level-back-icon {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.22rem;
    width: 1.9rem;
    height: 1.7rem;
    margin-bottom: 0.35rem;
}

.stats-glyph-bar {
    display: block;
    width: 0.28rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(219, 234, 254, 0.82));
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.14);
}

.stats-glyph-bar-1 {
    height: 0.7rem;
}

.stats-glyph-bar-2 {
    height: 1.15rem;
}

.stats-glyph-bar-3 {
    height: 0.92rem;
}

.rpg-level-number {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.rpg-level-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.rpg-level-info {
    flex: 1;
}

.rpg-level-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.rpg-xp-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    overflow: hidden;
    height: 8px;
    margin-bottom: 0.5rem;
}

.rpg-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 1));
    transition: width 0.5s ease;
}

.rpg-xp-text {
    font-size: 0.9rem;
    opacity: 0.95;
}

.rpg-next-level {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.3rem;
}

/* Achievements Display */
.achievements-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.achievement-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.achievement-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

.achievement-card.locked {
    opacity: 0.4;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.achievement-locked-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Skill Tree */
.skill-tree-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
}

.skill-tree-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.skill-node {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skill-node.unlocked {
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.skill-node.locked {
    opacity: 0.5;
    border-color: #6b7280;
}

.skill-node.next {
    border-color: #f59e0b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
}

.skill-node:hover:not(.locked) {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.skill-name {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.skill-requirement {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.skill-bonus {
    font-size: 0.85rem;
    color: #fbbf24;
    font-weight: 600;
}

/* Level Up Animation */
@keyframes levelUpScale {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes levelUpGlow {
    0% { box-shadow: 0 0 10px; }
    50% { box-shadow: 0 0 40px; }
    100% { box-shadow: 0 0 10px; }
}

.level-up-animate {
    animation: levelUpScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              levelUpGlow 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .rpg-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;

    .ap-card h3,
    .resource-card h4,
    .quiz-card h4,
    .test-card h4,
    .calc-card h3,
    .goal-card h4 {
        font-size: 1rem;
    }

    .quiz-icon,
    .test-icon,
    .calc-icon {
        font-size: 2.2rem;
        margin-bottom: 0.75rem;
    }

    .goal-meta {
        font-size: 0.8rem;
    }

    .btn-icon {
        font-size: 1rem;
    }
    }
    
    .rpg-level-badge {
        width: 80px;
        height: 80px;
    }
    
    .rpg-level-number {
        font-size: 2rem;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .skill-tree-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 1rem;
    }
}

/* ===== XP NOTIFICATION ANIMATIONS ===== */
@keyframes slideInOut {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
}

/* XP Notification Popup */
.xp-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 10000;
    animation: slideInOut 2.5s ease-in-out forwards;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Achievement Unlock Notification */
.achievement-unlock-notif {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    z-index: 10000;
    animation: slideInOut 5s ease-in-out forwards;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.achievement-unlock-notif strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.achievement-unlock-notif .achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.achievement-unlock-notif .xp-reward {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.95;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .xp-notification {
        top: 80px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    .achievement-unlock-notif {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

.topic-actions .btn-primary,
.topic-actions .btn-secondary {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
    

.topic-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.topic-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Quiz Progress */
.topic-quiz-progress {
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: none;
    border-bottom: none;
}

.topic-quiz-progress .progress-info {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.topic-quiz-progress .progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.topic-quiz-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

#quizProgressPercent {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== MODAL STYLES ===== */

/* Modal Container - Zentralisiert */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    z-index: 10000;
}

body.dark-mode .modal-content {
    background: #1e1e2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Topic Confirm Modal */
.topic-confirm-modal {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

/* Topic Incomplete Modal */
.topic-incomplete-modal {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

.topic-incomplete-modal .modal-header {
    border-bottom-color: #f59e0b;
}

.topic-incomplete-modal .modal-header h3 {
    color: #f59e0b;
}

body.dark-mode .topic-incomplete-modal .modal-header h3 {
    color: #fbbf24;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body p {
    margin: 0.75rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 1rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modal Buttons */
.modal-footer .btn-primary,
.modal-footer .btn-secondary,
.modal-footer .btn-tertiary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-footer .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-footer .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.modal-footer .btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.modal-footer .btn-tertiary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
}

.modal-footer .btn-tertiary:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Dark Mode */
body.dark-mode .modal-header {
    border-bottom-color: #6ee7b7;
}

body.dark-mode .modal-header h3 {
    color: #6ee7b7;
}

body.dark-mode .modal-footer .btn-secondary {
    background: #2a2a3e;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .modal-footer .btn-secondary:hover {
    background: #3a3a4e;
}

body.dark-mode .modal-footer .btn-tertiary {
    border-color: #6ee7b7;
    color: #6ee7b7;
}

body.dark-mode .modal-footer .btn-tertiary:hover {
    background: rgba(110, 231, 183, 0.15);
}

/* Responsive Modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        border-radius: 1rem;
    }

    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-body p {
        font-size: 0.95rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        gap: 0.5rem;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary,
    .modal-footer .btn-tertiary {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .inline-quizzes-section {
        padding: 1.25rem;
        margin-top: 2rem;
    }

    .knowledge-check-box,
    .inline-question-box {
        padding: 1rem;
    }

    .check-toggle-btn {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .inline-answer-label {
        padding: 0.75rem 0.85rem;
    }
}
    

    /* Subnet / VLSM */
    .vlsm-row input,
    .vlsm-row .vlsm-hosts {
        font-size: 1.05rem;
        padding: 0.6rem 0.85rem;
    }

    .vlsm-remove {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    /* Text Converter */
    .convert-label {
        font-size: 0.82rem;
    }

    .convert-output {
        font-size: 1.05rem;
        padding: 0.8rem 1rem;
    }

    .convert-output.decoded-text {
        font-size: 1.35rem;
    }

    .convert-copy {
        font-size: 0.82rem;
        padding: 0.3rem 0.75rem;
    }

    /* Exam Info */
    .exam-info {
        font-size: 1.05rem;
    }

    .summary-box {
        font-size: 1.05rem;
        padding: 1.25rem;
    }

    .term-card {
        padding: 1.25rem;
    }

    .term-card h4 {
        font-size: 1.25rem;
    }


/* ===== 4K UHD Bildschirme ohne Skalierung (ab 3840px) ===== */
@media (min-width: 3840px) {
    /* Gradient Orbs viel größer */
    .orb-1 {
        width: 1000px;
        height: 1000px;
    }

    .orb-2 {
        width: 1100px;
        height: 1100px;
    }

    .orb-3 {
        width: 900px;
        height: 900px;
    }

    /* Float Icons */
    .float-icon {
        font-size: 4.5rem;
    }

    /* Page Header */
    .page-header {
        padding: 2.25rem 4rem;
        margin: -4rem -5rem 4rem -5rem;
    }

    .header-logo-icon {
        font-size: 4.5rem;
    }

    .header-logo-text h1 {
        font-size: 2.5rem;
    }

    .header-logo-text p {
        font-size: 1.35rem;
    }

    .header-logo {
        gap: 1.5rem;
    }

    /* Topic Cards */
    .topic-card {
        padding: 2.25rem;
    }

    .topic-card h4 {
        font-size: 1.65rem;
    }

    .topic-card p {
        font-size: 1.3rem;
    }

    .topic-content {
        max-height: 800px;
    }

    .topic-content-section {
        padding: 1.75rem;
    }

    .topic-content-section table th,
    .topic-content-section table td {
        padding: 1.1rem;
        font-size: 1.25rem;
    }

    /* Calc Cards */
    .calc-categories {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }

    .calc-card {
        padding: 2.75rem;
    }

    .calc-icon {
        font-size: 5rem;
        margin-bottom: 2rem;
    }

    .calc-card h3 {
        font-size: 1.65rem;
    }

    .calc-card li {
        font-size: 1.25rem;
        padding: 0.85rem 0;
    }

    /* AP Cards */
    .ap-card {
        padding: 3rem;
    }

    .ap-card h3 {
        font-size: 1.85rem;
    }

    .ap-topics {
        padding: 2rem;
        font-size: 1.25rem;
    }

    /* Test Grid */
    .test-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }

    .test-card {
        padding: 2.75rem;
    }

    .test-icon {
        font-size: 5rem;
    }

    .test-duration {
        font-size: 1.2rem;
    }

    /* Resource Grid */
    .resource-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 2.5rem;
    }

    .resource-card {
        padding: 2.75rem;
    }

    /* Floating Buttons */
    .floating-settings-btn {
        width: 88px;
        height: 88px;
        font-size: 2.5rem;
        bottom: 3rem;
        right: 3rem;
    }

    .scroll-to-top-btn {
        width: 78px;
        height: 78px;
        font-size: 2.3rem;
        bottom: 3rem;
        left: 3rem;
    }

    /* Settings Menu */
    .settings-menu {
        width: 520px;
        right: 3rem;
    }

    .settings-header {
        padding: 1.75rem 2rem;
    }

    .settings-header h3 {
        font-size: 1.4rem;
    }

    .settings-content {
        padding: 2rem;
    }

    .setting-item {
        padding: 1.25rem 0;
    }

    .setting-label {
        font-size: 1.35rem;
    }

    .close-btn {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    /* Loading Spinner */
    .loading-spinner {
        width: 150px;
        height: 150px;
    }

    .loading-text {
        font-size: 2.5rem;
        margin-top: 100px;
    }

    .loading-icon {
        font-size: 3.5rem;
    }

    /* Form Elements */
    .form-group {
        margin-bottom: 2rem;
    }

    .form-group label {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select {
        font-size: 1.3rem;
        padding: 1.1rem 1.25rem;
    }

    .form-group input[type="number"] {
        max-width: 300px;
    }

    /* Result Box */
    .result-box {
        padding: 2.5rem;
    }

    .result-box h4 {
        font-size: 1.45rem;
    }

    .result-box .final-result {
        font-size: 2.5rem;
    }

    .result-box td {
        padding: 0.85rem;
        font-size: 1.25rem;
    }

    /* Calc Result Table */
    .calc-result-table td {
        padding: 1rem 1.25rem;
        font-size: 1.25rem;
    }

    /* Quiz Icon */
    .quiz-icon {
        font-size: 4.5rem;
    }

    .quiz-questions {
        font-size: 1.2rem;
        padding: 0.45rem 1.1rem;
    }

    /* Topic Tags */
    .topic-tags {
        gap: 0.65rem;
        margin: 0.85rem 0;
    }

    .topic-tag {
        font-size: 1.05rem;
        padding: 0.45rem 1rem;
    }

    .btn-read-toggle {
        font-size: 1.1rem;
        padding: 0.75rem 1.4rem;
    }

    /* Search FAB */
    .search-fab {
        width: 68px;
        height: 68px;
        font-size: 1.7rem;
        border-radius: 22px;
        top: 1.8rem;
        right: 2.2rem;
    }

    .search-modal {
        max-width: 1100px;
    }

    .search-input {
        font-size: 1.4rem;
        padding: 1.25rem 1.5rem;
    }

    .search-result-icon {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }

    .search-empty-icon {
        font-size: 4rem;
    }

    .search-empty p {
        font-size: 1.2rem;
    }

    .search-hint {
        font-size: 0.95rem;
        padding: 0.85rem 1.5rem;
    }

    .search-hint kbd {
        font-size: 0.85rem;
        padding: 0.15rem 0.55rem;
    }

    /* Subnet / VLSM */
    .vlsm-row input,
    .vlsm-row .vlsm-hosts {
        font-size: 1.2rem;
        padding: 0.75rem 1rem;
    }

    .vlsm-remove {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    .vlsm-color {
        width: 16px;
        height: 16px;
    }

    /* Text Converter */
    .convert-block {
        padding: 1.1rem 1.35rem;
    }

    .convert-label {
        font-size: 0.95rem;
    }

    .convert-output {
        font-size: 1.2rem;
        padding: 1rem 1.15rem;
    }

    .convert-output.decoded-text {
        font-size: 1.65rem;
    }

    .convert-copy {
        font-size: 0.95rem;
        padding: 0.35rem 0.85rem;
    }

    /* Exam Info */
    .exam-info {
        font-size: 1.25rem;
    }

    .exam-info p {
        font-size: 1.25rem;
    }

    .summary-box {
        font-size: 1.25rem;
        padding: 1.75rem;
    }

    .term-card {
        padding: 1.75rem;
    }

    .term-card h4 {
        font-size: 1.5rem;
    }

    /* Scrollbar */
    .topic-content::-webkit-scrollbar {
        width: 10px;
    }
}


/* ==========================================================
   UNIVERSAL PAGE TRANSITIONS
   ========================================================== */

/* --- Eintrittabdeckung (sofort sichtbar via html-Klasse) --- */
html.pt-entering::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99998;
    background: #ffffff;
    pointer-events: none;
}

html.pt-entering.dark-mode::after {
    background: #1e293b;
}

/* Akzentlinie am unteren Rand der Abdeckung */
html.pt-entering::before {
    content: '';
    position: fixed;
    bottom: 0; left: 0;
    width: 100%; height: 3px;
    z-index: 99999;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    pointer-events: none;
}

/* Reveal-Animation: Abdeckung fährt nach oben raus */
html.pt-entering.pt-reveal::after {
    animation: ptWipeOut 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

html.pt-entering.pt-reveal::before {
    animation: ptWipeOut 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes ptWipeOut {
    from { transform: translateY(0%); }
    to   { transform: translateY(-100%); }
}

/* --- Exit-Wipe (Overlay fährt von unten hoch und bedeckt Seite) --- */
/* ===== ZOOM-BLUR PAGE TRANSITION ===== */
.page-transition-zoom-blur {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99998;
    background: var(--bg-primary);
    opacity: 0;
    pointer-events: none;
    transform: scale(1);
    filter: blur(0px);
}

body.dark-mode .page-transition-zoom-blur {
    background: var(--bg-primary);
}

.page-transition-zoom-blur.active {
    animation: ptZoomBlur 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes ptZoomBlur {
    0% {
        opacity: 0;
        transform: scale(1);
        filter: blur(0px);
    }
    70% {
        opacity: 0.3;
        transform: scale(1.1);
        filter: blur(3px);
    }
    100% {
        opacity: 1;
        transform: scale(1.8);
        filter: blur(20px);
    }
}

/* ===== BATTLE SYSTEM UI ===== */
.battle-container {
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.98), rgba(50, 50, 70, 0.98));
    border: 3px solid #667eea;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.4);
    animation: slideInDown 0.6s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.battle-header {
    text-align: center;
    margin-bottom: 1rem;
}

.battle-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.25rem;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.battle-arena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.75rem;
}

.battle-combatant {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player-side {
    text-align: center;
}

.enemy-side {
    text-align: center;
}

.combatant-avatar {
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.combatant-info {
    width: 100%;
}

.combatant-info h4 {
    margin: 0.25rem 0;
    color: white;
    font-size: 1rem;
}

.health-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #666;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 0.25rem 0;
}

.health-bar-fill {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 0.25rem;
}

.health-text {
    font-size: 0.8rem;
    color: #aaa;
    font-weight: bold;
}

.battle-vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f59e0b;
    text-align: center;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.battle-log {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #667eea;
    border-radius: 0.5rem;
    padding: 0.75rem;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #aaa;
}

.log-entry {
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.log-entry:last-child {
    border-bottom: none;
}

/* Battle Result Screens */
.battle-result {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.95), rgba(50, 50, 70, 0.95));
    border: 2px solid;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.battle-result.victory {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
}

.battle-result.defeat {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.battle-result h2 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.battle-result.victory h2 {
    color: #22c55e;
}

.battle-result.defeat h2 {
    color: #ef4444;
}

.battle-result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-left: 3px solid #667eea;
}

.stat-item label {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.25rem;
}

.stat-item .value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #22c55e;
}

@media (max-width: 768px) {
    .battle-container {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .battle-header h3 {
        font-size: 1.1rem;
    }

    .battle-arena {
        flex-direction: row;
        gap: 0.75rem;
        padding: 0.5rem;
    }
    
    .combatant-avatar {
        font-size: 2rem;
    }

    .combatant-info h4 {
        font-size: 0.9rem;
    }

    .health-bar {
        height: 18px;
    }
    
    .battle-log {
        max-height: 100px;
        font-size: 0.8rem;
    }
    
    .battle-result-stats {
        grid-template-columns: 1fr;
    }

    #battleAbilityRow,
    #battleItemRow {
        flex-direction: column;
    }

    #battleAbilityRow .skill-btn,
    #battleItemRow .skill-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .battle-container {
        padding: 0.5rem;
        border-width: 2px;
    }

    .battle-arena {
        gap: 0.5rem;
    }

    .combatant-avatar {
        font-size: 1.75rem;
    }

    .health-text {
        font-size: 0.7rem;
    }
}
