/**
 * Planaxa - Clean Modern Design System
 * Einfach, schön, performant - keine unnötigen Effekte
 */

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Variables === */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Radius */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions - schnell und smooth */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradient */
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* === Base === */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* === Input Fields === */
.input-group {
    margin-bottom: 1.25rem;
}

.input-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gray-900);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-field::placeholder {
    color: var(--gray-400);
}

/* === Cards === */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* === Badge === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.navbar-link:hover {
    color: var(--primary);
}

/* === Container === */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 4rem 0;
}

/* === Utilities === */
.text-center { text-align: center; }
.text-gray { color: var(--gray-600); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 1rem; }

/* === Animations (subtil) === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

/* === Responsive === */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar-container {
        padding: 1rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* === Dashboard Layout === */
.app-container {
    display: flex;
    min-height: 100vh;
    background: #0f172a;
}

.sidebar {
    width: 280px;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #a78bfa;
}

.logo i {
    font-size: 1.75rem;
}

.logo-tagline {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    font-weight: 400;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    background: #334155;
    color: #e2e8f0;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #a78bfa;
    font-weight: 600;
    border-left: 3px solid #a78bfa;
}

.nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.125rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #334155;
}

.privacy-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    padding: 0.5rem;
    background: #334155;
    border-radius: var(--radius);
}

.privacy-badge i {
    color: #22c55e;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #a78bfa;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: #0f172a;
    min-height: 100vh;
}

.main-header {
    background: #1e293b;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Header - standardmäßig versteckt */
.mobile-header {
    display: none;
}

.mobile-overlay {
    display: none;
}

.main-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all var(--transition);
}

.session-timer i {
    font-size: 1rem;
}

.session-timer:hover {
    border-color: #475569;
    background: #1e293b;
}

.content-area {
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* === Dashboard Grid === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.1);
    transition: all var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(167, 139, 250, 0.3);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
}

.card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: #a78bfa;
}

.card-content {
    padding: 1.5rem;
}

.page-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(167, 139, 250, 0.1);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 i {
    color: #a78bfa;
}

.page-description {
    color: #94a3b8;
    margin: 0;
}

/* === Settings === */
.settings-container {
    max-width: 800px;
}

.settings-section {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
}

.settings-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-info {
    background: #0f172a;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #334155;
}

.settings-info p {
    margin: 0.5rem 0;
    color: #94a3b8;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-info i {
    color: #a78bfa;
}

.section-description {
    color: #94a3b8;
    margin-bottom: 1rem;
}

.settings-sections {
    max-width: 900px;
}

/* === Dashboard Cards === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-card-change {
    font-size: 0.875rem;
    color: var(--success);
}

/* === Data Tables === */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* === Modals === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1e293b;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #334155;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e293b;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all var(--transition);
}

.modal-close:hover {
    background: #334155;
    color: #f1f5f9;
}

.modal-content {
    padding: 1.5rem;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* === Forms === */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-input, .form-select, .form-textarea {
    padding: 0.75rem 1rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: var(--radius);
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all var(--transition);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #a78bfa;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: #64748b;
}

.form-select {
    cursor: pointer;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* === Chat Styles === */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-secondary);
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    animation: slideUp 0.2s ease;
}

.chat-message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.chat-bubble {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.chat-message.own .chat-bubble {
    background: var(--primary);
    color: white;
}

.chat-sender {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.chat-message.own .chat-sender {
    color: rgba(255, 255, 255, 0.9);
}

.chat-text {
    margin: 0;
    word-wrap: break-word;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.chat-message.own .chat-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: white;
}

.chat-form {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color var(--transition);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-send-btn {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* === Admin Panel === */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.admin-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.admin-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* === Homework & Exams === */
.homework-section, .exams-section, .events-section {
    margin-bottom: 2rem;
}

.homework-section h3, .exams-section h3, .events-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f1f5f9;
}

.homework-grid, .exams-grid, .events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.homework-card, .exam-card, .event-card {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: all var(--transition);
    border-left: 4px solid transparent;
    border: 1px solid #334155;
}

.homework-card:hover, .exam-card:hover, .event-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    border-color: #475569;
}

.homework-card.completed {
    opacity: 0.6;
    background: #0f172a;
}

.homework-card.overdue {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.homework-card.due-today {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.exam-card.past, .event-card.past {
    opacity: 0.6;
    background: #0f172a;
}

.exam-card.today, .event-card.today {
    border-left-color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.homework-header, .exam-header, .event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.homework-subject, .exam-subject, .item-subject {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.homework-date, .exam-date, .item-date, .event-date {
    font-size: 0.875rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.item-time, .event-time {
    font-size: 0.875rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.homework-title, .exam-title, .event-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #f1f5f9;
}

.homework-description, .exam-topics, .event-description, .event-location {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0.5rem 0;
}

.homework-footer, .exam-footer, .event-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
}

.homework-priority {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.priority-high {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.priority-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.priority-low {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.homework-actions, .exam-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: #334155;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.exam-weight {
    font-size: 0.875rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.exam-grade {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* === Dashboard Items === */
.dashboard-item {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    border: 1px solid #334155;
}

.dashboard-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transform: translateX(4px);
}

.dashboard-item.completed {
    opacity: 0.5;
}

.dashboard-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dashboard-item-title {
    font-weight: 600;
    color: #f1f5f9;
    margin: 0.5rem 0;
}

.dashboard-item-description, .dashboard-item-location {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.dashboard-item-priority {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    margin-top: 0.5rem;
}

/* === Grades === */
.grades-overview {
    margin-bottom: 2rem;
}

.overall-average {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid #334155;
}

.overall-average h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #f1f5f9;
}

.grades-subject-section {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: 1px solid #334155;
}

.grades-subject-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f1f5f9;
}

.subject-average {
    font-weight: 600;
    margin-left: auto;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.grade-card {
    background: #0f172a;
    border-radius: var(--radius);
    padding: 1rem;
    transition: all var(--transition);
    border: 1px solid #334155;
}

.grade-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.grade-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.grade-value {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
}

.grade-good {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.grade-ok {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.grade-bad {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.grade-summary-dashboard {
    text-align: center;
}

.grade-avg-overall {
    padding: 2rem;
}

.grade-avg-overall .grade-value {
    font-size: 3rem;
    font-weight: 700;
    color: #a78bfa;
    display: block;
    margin-bottom: 0.5rem;
}

.grade-avg-overall .grade-label {
    font-size: 1rem;
    color: #94a3b8;
}

/* === Subjects === */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: all var(--transition);
    border: 1px solid #334155;
}

.subject-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.subject-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subject-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.subject-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
}

.subject-actions {
    display: flex;
    gap: 0.5rem;
}

.subject-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
}

.subject-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.subject-stats .stat i {
    color: #a78bfa;
    width: 16px;
}

/* === Chat Message Styles === */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: #1e293b;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid #334155;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #0f172a;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    animation: slideUp 0.2s ease;
}

.chat-message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.chat-bubble {
    background: #1e293b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #334155;
}

.chat-message.own .chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.chat-sender {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #f1f5f9;
}

.chat-message.own .chat-sender {
    color: rgba(255, 255, 255, 0.9);
}

.chat-text {
    margin: 0;
    word-wrap: break-word;
    color: #e2e8f0;
}

.chat-message.own .chat-text {
    color: white;
}

.chat-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.chat-message.own .chat-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #334155;
    background: #1e293b;
}

.chat-form {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #334155;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    background: #0f172a;
    color: #e2e8f0;
}

.chat-input::placeholder {
    color: #64748b;
}

.chat-input:focus {
    outline: none;
    border-color: #a78bfa;
}

.chat-send-btn {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    font-size: 1.125rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.message-author-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.message-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: #f1f5f9;
}

.message-role {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.message-role.role-admin {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.message-role.role-user {
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
}

.message-time {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.message-content {
    margin: 0.5rem 0;
    word-wrap: break-word;
    color: #e2e8f0;
}

.message-delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: all var(--transition);
}

.chat-message:hover .message-delete-btn {
    opacity: 1;
}

.message-delete-btn:hover {
    background: #dc2626;
}

.own-message {
    align-self: flex-end;
}

.own-message .chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.other-message .chat-bubble {
    background: #1e293b;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* === Loading States === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Dashboard Responsive === */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-280px);
        transition: transform var(--transition);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid, .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* === Dashboard Enhancements === */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(102, 126, 234, 0.4), 0 4px 6px -2px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

.btn-secondary:hover {
    background: #475569 !important;
}

.homework-card, .exam-card, .event-card, .subject-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.homework-card:hover, .exam-card:hover, .event-card:hover, .subject-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

.grade-card {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
}

.grade-card:hover {
    transform: scale(1.02);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* === Enhanced Chat Styles (Discord-like) === */

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background: #313338;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #313338;
    scroll-behavior: smooth;
}

/* Message Wrapper (Discord-Style) */
.chat-message-wrapper {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    position: relative;
    transition: background 0.1s ease;
}

.chat-message-wrapper:hover {
    background: rgba(4, 4, 5, 0.07);
}

/* Avatar */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Message Main Content */
.message-main {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Message Header */
.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

/* Username */
.message-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f2f3f5;
    cursor: pointer;
    transition: text-decoration 0.1s ease;
}

.message-author:hover {
    text-decoration: underline;
}

/* Role Badge (Discord-Style) */
.message-role {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.message-role.role-admin {
    background: #5865f2;
    color: white;
}

.message-role.role-user {
    background: #4e5058;
    color: #b5bac1;
}

/* Timestamp */
.message-time {
    font-size: 0.75rem;
    color: #949ba4;
    font-weight: 500;
    margin-left: 0.25rem;
}

/* Message Content */
.message-content {
    color: #dbdee1;
    font-size: 0.95rem;
    line-height: 1.375rem;
    word-wrap: break-word;
    word-break: break-word;
}

/* Delete Button */
.message-delete-btn {
    position: absolute;
    top: -0.25rem;
    right: 0.5rem;
    background: #ed4245;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.15s ease;
}

.chat-message-wrapper:hover .message-delete-btn {
    opacity: 1;
}

.message-delete-btn:hover {
    background: #c03537;
}

/* Chat Input Container */
.chat-input-container {
    padding: 1rem;
    background: #313338;
    border-top: 1px solid #1e1f22;
}

.chat-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Chat Input (Discord-Style) */
.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #383a40;
    color: #dbdee1;
    transition: background 0.15s ease;
}

.chat-input::placeholder {
    color: #6d6f78;
}

.chat-input:focus {
    outline: none;
    background: #404249;
}

/* Send Button */
.chat-send-btn {
    padding: 0.75rem 1rem;
    background: #5865f2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.chat-send-btn:hover {
    background: #4752c4;
}

.chat-send-btn:active {
    transform: translateY(1px);
}

/* Empty State */
.chat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #949ba4;
    font-size: 1rem;
}

/* Scrollbar (Discord-Style) */
.chat-messages::-webkit-scrollbar {
    width: 16px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #1e1f22;
    border: 4px solid #313338;
    border-radius: 8px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #2b2d31;
}

/* === User Profile Modal (Discord-Style) === */
.user-profile-modal {
    width: 100%;
    max-width: 500px;
    background: #232428;
    border-radius: 8px;
    overflow: hidden;
}

.user-profile-banner {
    width: 100%;
    height: 100px;
}

.user-profile-content {
    padding: 1rem 1.5rem 1.5rem;
    position: relative;
}

.user-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    border: 6px solid #232428;
    margin-top: -50px;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-profile-info {
    color: #f2f3f5;
}

.user-profile-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.user-profile-section {
    margin-bottom: 1.25rem;
}

.user-profile-section:last-child {
    margin-bottom: 0;
}

.user-profile-section h4 {
    color: #f2f3f5;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile-section h4 i {
    color: #949ba4;
}

.user-profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1rem;
    background: #2b2d31;
    border-radius: 8px;
}

.profile-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #b5bac1;
    font-size: 0.95rem;
}

.profile-detail i {
    width: 20px;
    color: #949ba4;
}

/* User Mention (clickable @mentions) */
.user-mention {
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-block;
}

.user-mention:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
}

/* === Mention Autocomplete (Discord-Style) === */
.mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #2b2d31;
    border: 1px solid #1e1f22;
    border-radius: 8px 8px 0 0;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s ease;
}

.mention-item:hover,
.mention-item.selected {
    background: #404249;
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.mention-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.mention-name {
    color: #f2f3f5;
    font-weight: 600;
    font-size: 0.9rem;
}

.mention-autocomplete::-webkit-scrollbar {
    width: 8px;
}

.mention-autocomplete::-webkit-scrollbar-thumb {
    background: #1e1f22;
    border-radius: 4px;
}

/* Selection */
::selection {
    background: rgba(167, 139, 250, 0.3);
    color: #f1f5f9;
}

/* ========================================
   MOBILE RESPONSIVE DESIGN (nur für Smartphones)
   PC & Tablet bleiben unverändert
   ======================================== */

@media only screen and (max-width: 768px) {
    /* Dashboard Layout */
    .dashboard-container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }
    
    /* Sidebar - versteckt und als Overlay */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    /* Mobile Overlay für Sidebar */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* Main Content - volle Breite */
    .main-content {
        flex: 1;
        width: 100%;
        padding: 0;
        overflow-y: auto;
    }
    
    /* Mobile Header (Hamburger Menu) */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        background: #1e293b;
        border-bottom: 1px solid #334155;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        font-size: 1.25rem;
    }
    
    .mobile-header h2 {
        font-size: 1.25rem;
        color: #f1f5f9;
    }
    
    /* Content Area */
    .content-area {
        padding: 1rem;
    }
    
    /* Header */
    .header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Desktop Header verstecken auf Mobile */
    .main-header {
        display: none;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    /* Grid Layouts - single column */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Stats Cards */
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        width: 100%;
    }
    
    input, select, textarea {
        font-size: 16px; /* Verhindert Auto-Zoom auf iOS */
    }
    
    /* Buttons */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Tables - responsive scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.875rem;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Chat - Mobile Optimierungen */
    .chat-container {
        height: calc(100vh - 60px);
        border-radius: 0;
    }
    
    .chat-messages {
        padding: 1rem 0.75rem;
    }
    
    .message-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .message-content {
        max-width: calc(100% - 50px);
    }
    
    .message-header {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .message-username {
        font-size: 0.9rem;
    }
    
    .message-time {
        font-size: 0.7rem;
    }
    
    .message-text {
        font-size: 0.95rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .chat-input-container {
        padding: 0.75rem;
    }
    
    .chat-input {
        min-height: 42px;
        font-size: 16px; /* Verhindert Auto-Zoom */
    }
    
    .chat-send-btn {
        width: 42px;
        height: 42px;
    }
    
    /* User Profile Modal - Mobile */
    .user-profile-modal {
        max-width: 100%;
    }
    
    .user-profile-banner {
        height: 80px;
    }
    
    .user-profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        top: 40px;
        left: 1rem;
    }
    
    .user-profile-info {
        padding: 60px 1rem 1rem 1rem;
    }
    
    .user-profile-name {
        font-size: 1.25rem;
        flex-wrap: wrap;
    }
    
    .user-profile-section h4 {
        font-size: 1rem;
    }
    
    .profile-detail {
        font-size: 0.875rem;
    }
    
    /* Mention Autocomplete - Mobile */
    .mention-autocomplete {
        max-height: 160px;
    }
    
    .mention-item {
        padding: 0.75rem;
    }
    
    .mention-avatar {
        width: 36px;
        height: 36px;
    }
    
    /* Calendar - Mobile */
    .calendar-grid {
        gap: 0.25rem;
    }
    
    .calendar-day {
        height: 50px;
        font-size: 0.875rem;
        padding: 0.25rem;
    }
    
    /* Hausaufgaben/Arbeiten Listen */
    .homework-item,
    .exam-item,
    .grade-item {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .homework-subject,
    .exam-subject {
        font-size: 0.875rem;
    }
    
    .homework-title,
    .exam-title {
        font-size: 1rem;
    }
    
    /* Settings - Mobile */
    .settings-section {
        padding: 1rem;
    }
    
    .settings-section h3 {
        font-size: 1.25rem;
    }
    
    /* Profile Image Upload */
    #current-profile-image {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    /* Sidebar Logo - Mobile anpassen */
    .logo {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    /* Touch-optimierte Elemente */
    .message-delete,
    .modal-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Verhindere Text-Selection bei Touch */
    .nav-link,
    .btn,
    .message-delete {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }
    
    /* Scrollbar für mobile verstecken */
    .chat-messages::-webkit-scrollbar,
    .table-container::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
}

/* Extra small phones (< 375px) */
@media only screen and (max-width: 374px) {
    .mobile-header h2 {
        font-size: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .chat-input {
        font-size: 14px;
    }
    
    table {
        font-size: 0.75rem;
    }
}
