/* Mobile-First CSS für app-mobile.html - Angepasst für Desktop-ähnliche Funktionalität */

/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #f8fafc;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.mobile-app-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-lang-btn,
.mobile-premium-btn,
.mobile-back-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Spezifische Styles für den Home Button */
.mobile-back-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.mobile-back-btn:hover,
.mobile-back-btn:focus {
    background: rgba(255, 255, 255, 0.2) !important;
}

.mobile-lang-btn:active,
.mobile-premium-btn:active,
.mobile-back-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #1e293b;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.mobile-sidebar.open {
    left: 0;
}

.sidebar-header {
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.sidebar-header h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-sidebar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 16px 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.language-switcher {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 16px;
}

.lang-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(74, 85, 104, 0.8) 0%, rgba(90, 108, 125, 0.8) 100%);
    border: 2px solid transparent;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.lang-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: #667eea;
    color: #f7fafc;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 0 16px 8px;
    background: #334155;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
    color: #e2e8f0;
    border-left: 3px solid transparent;
}

.nav-item:active {
    transform: scale(0.98);
    background: #667eea;
    border-left-color: #667eea;
}

.nav-item i {
    width: 24px;
    margin-right: 16px;
    color: #cbd5e1;
}

.nav-item span {
    flex: 1;
    color: #f8fafc;
    font-weight: 500;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.mobile-main {
    margin-top: 60px;
    padding: 16px;
    min-height: calc(100vh - 60px);
}

/* Content Header */
.content-header {
    margin-bottom: 24px;
    position: relative;
}

.content-header::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.content-title {
    color: #f7fafc;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #f7fafc 0%, #cbd5e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-subtitle {
    color: #cbd5e0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

/* Content Body */
.content-body {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(45, 55, 72, 0.95) 100%);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.content-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(102, 126, 234, 0.02) 50%, transparent 60%);
    pointer-events: none;
}

/* Lecture Content */
.lecture-content {
    color: #e2e8f0;
    line-height: 1.7;
}

.lecture-content h3 {
    color: #f7fafc;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.lecture-content p {
    margin-bottom: 16px;
}

.lecture-content ul, .lecture-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.lecture-content li {
    margin-bottom: 8px;
}

/* Question Items */
.question-item {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.8) 0%, rgba(74, 85, 104, 0.8) 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.question-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.2);
}

.question-text {
    color: #f7fafc;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.question-answer {
    color: #e2e8f0;
    background: #4a5568;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    display: none;
}

.question-answer.show {
    display: block;
}

.toggle-answer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.toggle-answer:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Quiz Section */
.quiz-section {
    display: none;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 16px;
}

.quiz-section.active {
    display: block;
}

.quiz-question {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9) 0%, rgba(74, 85, 104, 0.9) 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
    z-index: 1;
    word-wrap: break-word;
    word-break: break-word;
}

.quiz-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.quiz-options {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.quiz-option {
    background: linear-gradient(135deg, rgba(74, 85, 104, 0.8) 0%, rgba(90, 108, 125, 0.8) 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e2e8f0;
    position: relative;
    overflow: visible;
    z-index: 1;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.5;
}

.quiz-option:hover {
    background: linear-gradient(135deg, rgba(90, 108, 125, 0.9) 0%, rgba(102, 126, 234, 0.2) 100%);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.quiz-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quiz-option.correct {
    background: #48bb78;
    color: white;
}

.quiz-option.incorrect {
    background: #f56565;
    color: white;
}

.quiz-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.quiz-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quiz-btn:hover {
    background: #5a67d8;
}

.quiz-btn:disabled {
    background: #4a5568;
    cursor: not-allowed;
}

.quiz-btn.secondary {
    background: #4a5568;
    color: #e2e8f0;
}

.quiz-btn.secondary:hover {
    background: #5a6c7d;
}

.quiz-explanation {
    background: #4a5568;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    color: #e2e8f0;
}

/* Glossary Section */
.glossary-section {
    display: none;
}

.glossary-section.active {
    display: block;
}

.glossary-search {
    margin-bottom: 20px;
}

.glossary-input {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.8) 0%, rgba(74, 85, 104, 0.8) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    color: #f7fafc;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.glossary-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.glossary-input::placeholder {
    color: #a0aec0;
    opacity: 0.7;
}

.glossary-item {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.8) 0%, rgba(74, 85, 104, 0.8) 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glossary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.glossary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.2);
}

.glossary-term {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.glossary-definition {
    color: #e2e8f0;
    margin-bottom: 16px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Glossary Detail Fields */
.glossary-detail,
.glossary-example,
.glossary-examples {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-size: 0.9rem;
    line-height: 1.5;
}

.glossary-detail strong,
.glossary-example strong,
.glossary-examples strong {
    color: #667eea;
    font-weight: 600;
    margin-right: 8px;
}

.glossary-example {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
}

.glossary-examples {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

/* Difficulty Badge */
.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.difficulty-basic {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.difficulty-intermediate {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.difficulty-advanced {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-spinner.show {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #334155;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #f8fafc;
    font-size: 1rem;
}

/* Premium Popup */
.premium-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.premium-popup.show {
    opacity: 1;
    visibility: visible;
}

.premium-content {
    background: #1e293b;
    margin: 16px;
    padding: 24px;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
}

.premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.premium-header h2 {
    color: #f8fafc;
    font-size: 1.3rem;
}

.close-popup {
    width: 44px;
    height: 44px;
    background: #334155;
    border: none;
    border-radius: 12px;
    color: #f8fafc;
    font-size: 1.2rem;
    cursor: pointer;
}

.premium-features {
    margin-bottom: 24px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.feature:last-child {
    margin-bottom: 0;
}

.feature i {
    color: #667eea;
    font-size: 1.2rem;
}

.feature span {
    color: #f8fafc;
}

.premium-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.premium-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.premium-btn.primary {
    background: #667eea;
    color: white;
}

.premium-btn.secondary {
    background: #334155;
    color: #f8fafc;
}

.premium-btn:active {
    transform: scale(0.95);
}

/* Markdown Styles */
.question-text strong, .glossary-term strong, .glossary-definition strong,
.question-answer strong, .lecture-content strong {
    font-weight: 700;
    color: #667eea;
}

.question-text em, .glossary-term em, .glossary-definition em,
.question-answer em, .lecture-content em {
    font-style: italic;
    color: #e2e8f0;
}

.question-text code, .glossary-term code, .glossary-definition code,
.question-answer code, .lecture-content code {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.question-text ul, .glossary-term ul, .glossary-definition ul,
.question-answer ul, .lecture-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.question-text ol, .glossary-term ol, .glossary-definition ol,
.question-answer ol, .lecture-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.question-text li, .glossary-term li, .glossary-definition li,
.question-answer li, .lecture-content li {
    margin: 0.25rem 0;
    color: #e2e8f0;
}

.question-text p, .glossary-term p, .glossary-definition p,
.question-answer p, .lecture-content p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.question-text h1, .glossary-term h1, .glossary-definition h1,
.question-answer h1, .lecture-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f7fafc;
    margin: 1rem 0 0.5rem 0;
}

.question-text h2, .glossary-term h2, .glossary-definition h2,
.question-answer h2, .lecture-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f7fafc;
    margin: 0.75rem 0 0.5rem 0;
}

.question-text h3, .glossary-term h3, .glossary-definition h3,
.question-answer h3, .lecture-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f7fafc;
    margin: 0.5rem 0 0.25rem 0;
}

.question-text blockquote, .glossary-term blockquote, .glossary-definition blockquote,
.question-answer blockquote, .lecture-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #cbd5e0;
    font-style: italic;
}

.question-examples,
.question-characteristics,
.question-factors,
.question-conclusion {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #4a5568;
    border-radius: 6px;
    color: #e2e8f0;
}

.question-examples ul,
.question-characteristics ul,
.question-factors ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.question-examples li,
.question-characteristics li,
.question-factors li {
    margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .mobile-header {
        padding: 0 12px;
    }
    
    .mobile-main {
        padding: 12px;
    }
    
    .content-body {
        padding: 20px;
    }
    
    .content-title {
        font-size: 1.5rem;
    }
    
    .question-item,
    .glossary-item,
    .quiz-question {
        padding: 16px;
        margin-bottom: 12px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .mobile-menu-toggle,
    .mobile-lang-btn,
    .mobile-premium-btn,
    .mobile-back-btn,
    .close-sidebar {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-item,
    .quiz-option {
        min-height: 44px;
    }
} 