/* Root Variables */
:root {
    --primary-color: #7C3AED;
    --primary-light: #A78BFA;
    --primary-dark: #6D28D9;
    --secondary-color: #EC4899;
    --accent-color: #F59E0B;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --background-color: #0F172A;
    --surface-color: #1E293B;
    --surface-light: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --grade-1: #10B981;
    --grade-2: #34D399;
    --grade-3: #FCD34D;
    --grade-4: #FB923C;
    --grade-5: #F87171;
    --grade-6: #EF4444;
    --dock-height: 70px;
    --header-height: 120px;
    --safe-area-bottom: env(safe-area-inset-bottom);
    --safe-area-top: env(safe-area-inset-top);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* App Container */
.app {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Page Management */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    background-color: var(--background-color);
    overflow-y: auto;
    padding-bottom: calc(var(--dock-height) + var(--safe-area-bottom) + 10px);

    flex: 0 0 100%;
    height: 100%;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.page.active {
    display: flex;
}

#page-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Login & Register Pages */
.login-container,
.register-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3);
}

.logo-container h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.logo-container p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Forms */
.login-form,
.register-form {
    width: 100%;
    max-width: 400px;
}

.input-field {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--surface-light);
}

.input-field.large {
    min-height: 150px;
    resize: vertical;
}

.info-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 16px;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(124, 58, 237, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background-color: var(--surface-light);
    border-color: var(--primary-color);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 14px;
    cursor: pointer;
    margin-top: 16px;
    transition: color 0.3s ease;
}

.link-btn:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-top));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.notification-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--danger-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.page-header {
    background-color: var(--surface-color);
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-top));
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.page-header h1 {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
}

.add-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.add-btn:hover {
    color: var(--primary-dark);
}

/* Dashboard Content */
.dashboard-content {
    padding: 20px;
}

/* Mobile optimized quick stats */
.quick-stats.mobile-optimized {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 4px; /* Kleiner Abstand vom Rand */
}

.quick-stats.mobile-optimized .stat-card.full-width {
    width: 100%;
    margin-bottom: 8px;
}

.quick-stats.mobile-optimized .stats-row {
    display: flex;
    gap: 8px; /* Kleinerer Gap zwischen den Cards */
}

.quick-stats.mobile-optimized .stats-row .stat-card {
    flex: 1;
    padding: 16px 12px; /* Kompaktere Padding */
}

/* Kleinere Icons und Text für mobile Stats */
.quick-stats.mobile-optimized .stats-row .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    margin-right: 10px;
}

.quick-stats.mobile-optimized .stats-row .stat-value {
    font-size: 1.3rem; /* Kleinere Schrift */
    font-weight: 600;
    line-height: 1.1;
}

.quick-stats.mobile-optimized .stats-row .stat-label {
    font-size: 0.8rem;
    margin-top: 2px;
    line-height: 1.2;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: white;
    font-size: 20px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Today's Schedule */
.today-schedule {
    margin-bottom: 24px;
}

.today-schedule h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.schedule-preview {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.schedule-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background-color 0.3s ease;
}

.schedule-item:last-child {
    margin-bottom: 0;
}

.schedule-item:hover {
    background-color: var(--surface-light);
}

.schedule-item.break {
    background-color: rgba(124, 58, 237, 0.1);
}

.schedule-item.current-lesson {
    background-color: rgba(124, 58, 237, 0.2);
    border: 2px solid var(--primary-color);
}

.schedule-item .time,
.schedule-item .schedule-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 90px;
    font-weight: 500;
}

.schedule-item .subject,
.schedule-item .schedule-subject {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    margin-left: 12px;
}

.schedule-item .room,
.schedule-item .schedule-room {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    min-width: 50px;
    margin-left: 12px;
}

.schedule-item .schedule-teacher {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    min-width: 80px;
    margin-left: 8px;
}

.schedule-item .teacher {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Compact schedule for dashboard */
.schedule-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-compact .subject-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.schedule-compact .room-info {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.schedule-compact .teacher-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.schedule-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 90px;
    font-weight: 500;
    padding-right: 12px;
}

.schedule-teacher {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    min-width: 80px;
}

/* User Management */
.user-item {
    background-color: var(--surface-light);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-role {
    min-width: 180px;
}

.role-select {
    width: 100%;
    padding: 6px 8px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Schedule Last Updated */
.schedule-last-updated {
    background-color: rgba(124, 58, 237, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.schedule-last-updated-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.update-schedule-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.update-schedule-btn:hover {
    background-color: rgba(124, 58, 237, 0.1);
}

/* Manager Items */
.manager-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.admin-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-input-group .input-field {
    flex: 1;
    margin-bottom: 0;
}

.admin-add-btn {
    padding: 16px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.admin-add-btn:hover {
    background-color: var(--primary-dark);
}

/* Subject Manager Styles */
.subject-manager-item {
    padding: 16px;
}

.subject-manager-info {
    display: flex;
    flex-direction: column;
}

.subject-manager-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.subject-manager-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.subject-abbreviation {
    font-weight: 500;
    color: var(--primary-color);
}

.subject-description {
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 20px;
}

.quick-actions h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.action-card {
    background-color: var(--surface-color);
    border: none;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.action-card:hover {
    transform: translateY(-2px);
    background-color: var(--surface-light);
}

.action-card i {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.action-card span {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Page Content */
.page-content {
    padding: 20px;
    flex: 1;
}

/* Grades */
#subjects-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subject-item {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.subject-item:hover {
    transform: translateX(4px);
    background-color: var(--surface-light);
}

.subject-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: white;
    font-size: 20px;
}

.subject-info {
    flex: 1;
}

.subject-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.subject-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.subject-average {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Average Display */
.average-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.average-display.small .average-circle {
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
}

.average-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.average-circle.grade-1 { background: linear-gradient(135deg, var(--grade-1), #059669); }
.average-circle.grade-2 { background: linear-gradient(135deg, var(--grade-2), #10B981); }
.average-circle.grade-3 { background: linear-gradient(135deg, var(--grade-3), #F59E0B); }
.average-circle.grade-4 { background: linear-gradient(135deg, var(--grade-4), #EA580C); }
.average-circle.grade-5 { background: linear-gradient(135deg, var(--grade-5), #DC2626); }
.average-circle.grade-6 { background: linear-gradient(135deg, var(--grade-6), #B91C1C); }

/* Grade Details */
#grades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.grade-item {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.grade-value {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    margin-right: 16px;
}

.grade-1 { background-color: var(--grade-1); }
.grade-2 { background-color: var(--grade-2); }
.grade-3 { background-color: var(--grade-3); }
.grade-4 { background-color: var(--grade-4); }
.grade-5 { background-color: var(--grade-5); }
.grade-6 { background-color: var(--grade-6); }

.grade-info {
    flex: 1;
}

.grade-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.grade-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Add Grade Section */
.add-grade-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.add-grade-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.grade-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.grade-btn {
    background-color: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.grade-btn:hover {
    transform: translateY(-2px);
}

.grade-btn.selected {
    border-color: var(--primary-color);
    background-color: rgba(124, 58, 237, 0.1);
}

.grade-btn[data-value="1"] { background-color: var(--grade-1); color: white; }
.grade-btn[data-value="2"] { background-color: var(--grade-2); color: white; }
.grade-btn[data-value="3"] { background-color: var(--grade-3); color: var(--text-primary); }
.grade-btn[data-value="4"] { background-color: var(--grade-4); color: white; }
.grade-btn[data-value="5"] { background-color: var(--grade-5); color: white; }
.grade-btn[data-value="6"] { background-color: var(--grade-6); color: white; }

/* Schedule */
.schedule-container {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.weekday-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.weekday-tab {
    background-color: var(--surface-light);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.weekday-tab.active {
    background-color: var(--primary-color);
    color: white;
}

/* Group Selector */
.group-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.group-btn {
    background-color: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.group-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Week Navigation */
.week-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 16px;
    background-color: var(--surface-color);
    border-radius: 12px;
}

.week-nav-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.week-nav-btn:hover {
    background-color: var(--surface-light);
}

.week-nav-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.week-info {
    text-align: center;
}

.week-dates {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.week-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

#schedule-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-entry {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--surface-light);
}

.schedule-entry.break {
    background-color: rgba(124, 58, 237, 0.1);
}

.schedule-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 80px;
    font-weight: 500;
}

.schedule-subject {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

.schedule-room {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    min-width: 45px;
    line-height: 1.2;
}

.schedule-entry .teacher {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Schedule Editor */
.schedule-editor {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.schedule-editor-table {
    margin: 20px 0;
    overflow-x: auto;
}

.schedule-editor-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface-light);
    border-radius: 12px;
    overflow: hidden;
}

.schedule-editor-table th,
.schedule-editor-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.schedule-editor-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.schedule-editor-table select {
    width: 100%;
    padding: 8px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.schedule-editor-table input {
    width: 100%;
    padding: 8px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Feedback Week Info */
.feedback-week-info {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.feedback-week-info h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Homework Cards */
.homework-item {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.homework-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.homework-due {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.homework-due.text-danger {
    color: var(--danger-color);
}

.homework-due.text-warning {
    color: var(--warning-color);
}

.homework-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Exam Cards */
.exam-item {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.exam-header {
    flex: 1;
}

.exam-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.exam-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.exam-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.exam-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px;
    background-color: var(--surface-light);
    border-radius: 12px;
    min-width: 80px;
}

.exam-countdown i {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 4px;
}

.countdown-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Contact Cards */
.contact-item {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-item:hover {
    transform: translateX(4px);
    background-color: var(--surface-light);
}

.contact-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 16px;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.contact-subject {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.contact-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Classmates */
.classmate-item {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.classmate-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 16px;
}

.classmate-info {
    flex: 1;
}

.classmate-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.classmate-role {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.classmate-birthday {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.classmate-role-icon {
    width: 24px;
    height: 24px;
    margin-left: 12px;
    color: var(--primary-color);
}

/* Feedback */
.feedback-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feedback-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.mood-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mood-btn {
    background-color: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-btn:hover {
    transform: scale(1.05);
}

.mood-btn.selected {
    border-color: var(--primary-color);
    background-color: rgba(124, 58, 237, 0.1);
}

.feedback-stats {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.mood-bar {
    position: relative;
    height: 40px;
    background-color: var(--surface-light);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 16px;
}

.mood-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: calc(var(--mood-level) * 20%);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
}

.mood-value {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1;
}

/* Feedback Comments */
.feedback-comments {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feedback-comments h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.feedback-comment {
    background-color: var(--surface-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.comment-author {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.comment-text {
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-notice {
    background-color: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    border-left: 4px solid var(--warning-color);
}

.comment-notice p {
    color: var(--warning-color);
    font-size: 0.9rem;
    margin: 0;
}

/* Statistics Page */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.trend-indicator.positive {
    color: var(--success-color);
}

.trend-indicator.negative {
    color: var(--danger-color);
}

.trend-indicator.neutral {
    color: var(--text-muted);
}

/* Add/Edit Forms */
.form-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-row .input-field {
    flex: 1;
}

.item-manager {
    margin-bottom: 20px;
}

.manager-item {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.manager-item-content {
    flex: 1;
}

.manager-item-actions {
    display: flex;
    gap: 8px;
}

.manager-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.edit-btn {
    color: var(--primary-color);
}

.edit-btn:hover {
    background-color: rgba(124, 58, 237, 0.1);
}

.delete-manager-btn {
    color: var(--danger-color);
}

.delete-manager-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.delete-notification-btn {
    color: var(--danger-color);
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.delete-notification-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Time slot */
.time-slot {
    background-color: var(--surface-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.time-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.time-slot-time {
    font-weight: 600;
    color: var(--text-primary);
}

.time-slot-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.group-content {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 12px;
}

.group-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Feedback availability indicator */
.feedback-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.feedback-availability {
    background-color: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.feedback-availability p {
    color: var(--warning-color);
    font-size: 0.9rem;
    margin: 0;
}

/* Kummerkasten */
.kummerkasten-info {
    background-color: rgba(124, 58, 237, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.kummerkasten-info i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.kummerkasten-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.kummer-submission {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kummer-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.kummer-content {
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.kummer-actions {
    display: flex;
    gap: 8px;
}

.kummer-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mark-read-btn {
    background-color: var(--success-color);
    color: white;
}

.mark-read-btn:hover {
    background-color: #059669;
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
}

.delete-btn:hover {
    background-color: #dc2626;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 16px;
    padding-bottom: calc(8px + var(--safe-area-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    width: 100%;
    z-index: 9999;
}

.page.active:not(#login-page):not(#register-page) ~ .bottom-nav {
    display: block;
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    pointer-events: auto;
}

.nav-item i {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* Menu List */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    background-color: var(--surface-color);
    border: none;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background-color: var(--surface-light);
    transform: translateX(4px);
}

.menu-item i:first-child {
    font-size: 20px;
    color: var(--primary-color);
    margin-right: 16px;
    width: 24px;
}

.menu-item span {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
}

.menu-item i:last-child {
    color: var(--text-muted);
    font-size: 14px;
}

.menu-item.logout {
    margin-top: 20px;
    color: var(--danger-color);
}

.menu-item.logout i:first-child {
    color: var(--danger-color);
}

/* Admin Sections */
.admin-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

#pending-users {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pending-user {
    background-color: var(--surface-light);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pending-user-info {
    flex: 1;
}

.pending-user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.pending-user-email {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pending-user-actions {
    display: flex;
    gap: 8px;
}

.approve-btn,
.reject-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.approve-btn {
    color: var(--success-color);
}

.approve-btn:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

.reject-btn {
    color: var(--danger-color);
}

.reject-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

#notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    background-color: var(--surface-light);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notification-item.unread {
    border-left: 4px solid var(--primary-color);
}

.notification-actions {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Notifications */
.notification-toast {
    position: fixed;
    bottom: calc(var(--dock-height) + 20px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: calc(100vw - 40px);
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification-toast i {
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

#notification-text {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Additional Mobile Optimizations */
@media (max-height: 600px) {
    .dashboard-content {
        padding: 12px;
    }
    
    .quick-stats {
        margin-bottom: 16px;
    }
    
    .today-schedule,
    .quick-actions {
        margin-bottom: 16px;
    }
    
    .modal-content {
        max-height: 90vh;
        padding: 16px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Spezielle mobile Optimierungen für die Stats Row */
    .quick-stats.mobile-optimized .stats-row .stat-card {
        min-height: 80px; /* Feste Mindesthöhe */
        display: flex;
        align-items: center;
        padding: 12px 10px;
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-info {
        flex: 1;
        min-width: 0; /* Wichtig für Text-Wrapping */
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-value {
        font-size: 1.1rem;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap; /* Verhindert Zeilenumbruch bei Zahlen */
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-label {
        font-size: 0.75rem;
        margin-top: 2px;
        line-height: 1.1;
        word-break: break-word; /* Erlaubt Zeilenumbruch bei langen Labels */
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .action-card {
        padding: 16px;
    }
    
    .action-card i {
        font-size: 24px;
    }
    
    .action-card span {
        font-size: 0.8rem;
    }
    
    .mood-selector {
        gap: 6px;
    }
    
    .mood-btn {
        min-width: 45px;
        height: 45px;
        font-size: 18px;
        padding: 6px 10px;
    }
    
    .grade-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .grade-btn {
        padding: 12px;
        font-size: 1.1rem;
    }
    
    .dashboard-content {
        padding: 16px;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .today-schedule {
        margin-bottom: 20px;
    }
    
    .quick-actions {
        margin-bottom: 16px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .schedule-item .time {
        min-width: 70px;
        font-size: 0.75rem;
    }
    
    .homework-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .exam-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .exam-countdown {
        align-self: flex-end;
        min-width: 70px;
    }
}

@media (max-width: 375px) {
    /* Noch kompaktere Darstellung für sehr kleine Bildschirme */
    .quick-stats.mobile-optimized {
        padding: 0 2px;
        gap: 10px;
    }
    
    .quick-stats.mobile-optimized .stats-row {
        gap: 6px;
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-card {
        min-height: 75px;
        padding: 10px 8px;
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 6px;
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-value {
        font-size: 1rem;
    }
    
    .quick-stats.mobile-optimized .stats-row .stat-label {
        font-size: 0.7rem;
    }
    
    .action-card {
        padding: 12px;
    }
    
    .action-card i {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .action-card span {
        font-size: 0.75rem;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-right: 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .mood-btn {
        min-width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (min-width: 769px) {
    .app {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    }
    
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .notification-toast {
        max-width: 400px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.page.active {
    animation: fadeIn 0.3s ease;
}

/* PWA Install Button */
.install-prompt {
    position: fixed;
    bottom: calc(var(--dock-height) + 80px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    max-width: calc(100vw - 40px);
}

.install-prompt.show {
    display: flex;
}

.install-prompt button {
    background-color: white;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-prompt button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .page {
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    .notification-toast {
        bottom: calc(var(--dock-height) + 20px + env(safe-area-inset-bottom));
    }
    
    .install-prompt {
        bottom: calc(var(--dock-height) + 80px + env(safe-area-inset-bottom));
    }
}

/* Dark mode scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus styles for accessibility */
.input-field:focus,
.primary-btn:focus,
.secondary-btn:focus,
.nav-item:focus,
.menu-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #64748b;
        --text-muted: #94a3b8;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}