/* Reset und Grundlagen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

:root {
    --primary-color: #4a6fa5;
    --primary-dark: #385d8a;
    --secondary-color: #6d8bc7;
    --accent-color: #ff7e5f;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --medium-gray: #adb5bd;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --box-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

body {
    background-color: #f5f7fb;
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Theme Overrides */
body.dark-theme {
    --primary-color: #6ea3ff;
    --secondary-color: #557ca8;
    --light-color: #0b1220;
    --dark-color: #e9eef6;
    --gray-color: #c1c7cd;
    --light-gray: #1b2430;
    background-color: #0b1220;
    color: var(--dark-color);
}

/* Dark-mode backgrounds for common components */
body.dark-theme .sidebar,
body.dark-theme .topbar,
body.dark-theme .card,
body.dark-theme .modal,
body.dark-theme .notification-popup,
body.dark-theme .login-container,
body.dark-theme .welcome-card,
body.dark-theme .stat-card,
body.dark-theme .dashboard,
body.dark-theme .album-item,
body.dark-theme .photo-item,
body.dark-theme .albums-grid,
body.dark-theme .photos-grid {
    background-color: #0f1720;
    color: var(--dark-color);
    box-shadow: none;
    border-color: #1f2a36;
}

/* Specific adjustments for cards and special components */
body.dark-theme .welcome-card {
    /* Softer dark gradient to keep highlight */
    background: linear-gradient(135deg, rgba(74,111,165,0.12), rgba(109,139,199,0.08));
    color: var(--dark-color);
}

body.dark-theme .stat-card {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--dark-color);
}

body.dark-theme .login-container {
    background-color: #0b1220;
    border: 1px solid #1f2a36;
    box-shadow: none;
}

/* Form controls */
body.dark-theme input[type="text"],
body.dark-theme input[type="password"],
body.dark-theme input[type="email"],
body.dark-theme textarea,
body.dark-theme select,
body.dark-theme .form-control {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
}

/* Password toggle styles */
.password-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.password-with-toggle {
    padding-right: 40px; /* space for the icon */
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.password-toggle:hover {
    background-color: rgba(0,0,0,0.04);
    color: var(--dark-color);
}

/* Dark theme adjustments for toggle */
body.dark-theme .password-toggle {
    color: #9aa6b5;
}

body.dark-theme .password-toggle:hover {
    background-color: rgba(255,255,255,0.03);
}


body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #6b7788;
}

/* Tables and lists */
body.dark-theme table,
body.dark-theme thead,
body.dark-theme tbody,
body.dark-theme tr,
body.dark-theme th,
body.dark-theme td {
    background-color: transparent;
    color: var(--dark-color);
    border-color: #1f2a36;
}

/* Buttons */
body.dark-theme .btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.06);
}

body.dark-theme .btn-secondary {
    background-color: transparent;
    color: var(--gray-color);
    border: 1px solid #1f2a36;
}

/* Album / Photo items */
body.dark-theme .album-cover,
body.dark-theme .photo-item {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid #1f2a36;
}

/* Kalender spezifische Dark-Regeln */
body.dark-theme .calendar-container {
    color: var(--dark-color);
}

body.dark-theme .calendar-header {
    background-color: #0b1220;
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .calendar-grid {
    background-color: #081018; /* grid gaps */
}

body.dark-theme .calendar-day {
    background-color: #0b1220;
    color: var(--dark-color);
}

body.dark-theme .calendar-day:hover {
    background-color: rgba(255,255,255,0.02);
}

body.dark-theme .calendar-day.other-month {
    background-color: #071018;
    color: #6b7788;
}

body.dark-theme .calendar-day-number {
    color: var(--dark-color);
}

body.dark-theme .calendar-event {
    background-color: rgba(255,255,255,0.02);
    border-left-color: var(--primary-color);
    color: var(--dark-color);
    box-shadow: none;
}

body.dark-theme .calendar-event-title {
    color: var(--dark-color);
}

body.dark-theme .calendar-event-details {
    color: #9aa6b6;
}

/* Counter / Klickzähler Dark rules */
body.dark-theme .counter-container {
    color: var(--dark-color);
}

body.dark-theme .counter-header {
    /* keep gradient but darken slightly */
    background: linear-gradient(135deg, rgba(110,163,255,0.12), rgba(85,124,168,0.08));
    color: var(--dark-color);
}

body.dark-theme .counter-card {
    background-color: #0b1220;
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .counter-display span {
    color: var(--primary-color);
}

body.dark-theme .counter-info {
    background-color: rgba(255,255,255,0.02);
    color: var(--primary-color);
}

body.dark-theme .stats-section {
    background-color: #0b1220;
    border: 1px solid #1f2a36;
}

body.dark-theme .sidebar-menu a:hover {
    background-color: rgba(110,163,255,0.08);
}

body.dark-theme .sidebar-menu a.active {
    background-color: rgba(110,163,255,0.12);
    color: var(--primary-color);
}

body.dark-theme .mobile-nav {
    background-color: #0f1720;
    border-top: 1px solid #1f2a36;
}

body.dark-theme .avatar,
body.dark-theme .avatar-large {
    box-shadow: none;
}

/* Nachrichten spezifische Dark-Regeln */
body.dark-theme .messages-header {
    background-color: #0b1220;
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .messages-list {
    background-color: #0b1220;
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .message-item {
    background-color: transparent;
    color: var(--dark-color);
    border-bottom: 1px solid #1f2a36;
}

body.dark-theme .message-item:hover {
    background-color: rgba(255,255,255,0.02);
}

body.dark-theme .message-item.unread {
    background-color: rgba(110,163,255,0.06);
    border-left-color: var(--primary-color);
}

body.dark-theme .message-sender {
    color: var(--dark-color);
}

body.dark-theme .message-time,
body.dark-theme .message-preview {
    color: #9aa6b6;
}

body.dark-theme .message-subject {
    color: var(--primary-color);
}

/* Album spezifische Dark-Regeln */
body.dark-theme .albums-grid,
body.dark-theme .album-card,
body.dark-theme .album-cover,
body.dark-theme .album-info,
body.dark-theme .album-detail-header {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .album-card:hover {
    background-color: rgba(255,255,255,0.02);
}

body.dark-theme .album-title,
body.dark-theme .album-meta,
body.dark-theme .album-access {
    color: var(--dark-color);
}

body.dark-theme .album-access.public { background-color: rgba(110,163,255,0.06); }
body.dark-theme .album-access.private { background-color: rgba(255,255,255,0.02); }

/* Extra: ensure modal/new-message form in dark */
body.dark-theme #newMessageModal .modal,
body.dark-theme #newMessageModal .modal-body,
body.dark-theme #newMessageModal .form-control,
body.dark-theme #newMessageModal textarea {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
}

/* General fallback for any remaining white boxes */
body.dark-theme .box,
body.dark-theme .card,
body.dark-theme .panel,
body.dark-theme .panel-body,
body.dark-theme .section {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
}

/* Photos / Albums specific */
body.dark-theme .photos-header,
body.dark-theme .photos-container .text-center {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .photos-header h2,
body.dark-theme .photos-container .text-center h3,
body.dark-theme .photos-container .text-center p {
    color: var(--dark-color);
}

/* Settings & Admin */
body.dark-theme .settings-section,
body.dark-theme .admin-section,
body.dark-theme .settings-section .settings-form,
body.dark-theme .settings-section h2 {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .settings-section h2 { border-bottom-color: #1f2a36; }

/* Dashboard: recent activities and other boxes */
body.dark-theme .recent-activities,
body.dark-theme .recent-activities ul {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .recent-activities li { border-bottom: 1px dashed rgba(255,255,255,0.03); }

/* Counter: ensure all small boxes are dark */
body.dark-theme .counter-main > *,
body.dark-theme .counter-card,
body.dark-theme .counter-info,
body.dark-theme .stats-section {
    background-color: #0b1220;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
}

/* Tone down bright decorative gradients for better dark contrast */
body.dark-theme .counter-card::before {
    background: linear-gradient(90deg, rgba(255,126,95,0.12), rgba(254,180,123,0.08), rgba(134,168,231,0.06));
}

/* Small utility adjustments */
body.dark-theme .text-muted { color: #9aa6b6 !important; }
body.dark-theme .btn { box-shadow: none; }
body.dark-theme .error, body.dark-theme .loader { background-color: transparent; }


/* Slight icon button styling */
.btn.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-color);
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
}

.btn.icon-btn:hover { color: var(--primary-color); }

.hidden {
    display: none !important;
}

/* ========== CONSENT/COOKIE POP-UP STYLES ========== */

.consent-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUpFromBottom 0.4s ease-out;
}

.consent-popup.hidden {
    display: none;
}

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.consent-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.consent-content {
    flex: 1;
}

.consent-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.consent-content h3 i {
    font-size: 1.5rem;
}

.consent-content > p {
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.consent-details {
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border-left: 3px solid var(--accent-color);
}

.consent-details p {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.consent-details ul {
    list-style: none;
    padding-left: 1rem;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.consent-details li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.consent-details li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.consent-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.consent-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.consent-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.consent-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.consent-actions .btn {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consent-actions .btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-color);
    border: 1px solid var(--medium-gray);
}

.consent-actions .btn-secondary:hover {
    background-color: var(--medium-gray);
    color: white;
}

/* Dark theme adjustments */
body.dark-theme .consent-popup {
    background-color: #1b2430;
    border-top-color: var(--primary-color);
}

body.dark-theme .consent-content h3 {
    color: var(--primary-color);
}

body.dark-theme .consent-content > p {
    color: var(--dark-color);
}

body.dark-theme .consent-details {
    background-color: var(--light-gray);
    border-left-color: var(--accent-color);
}

body.dark-theme .consent-details p,
body.dark-theme .consent-details ul {
    color: var(--dark-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .consent-container {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }
    
    .consent-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .consent-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .consent-links {
        flex-direction: column;
    }
    
    .consent-links a {
        justify-content: center;
    }
}

/* Login Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header p {
    color: var(--gray-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #dde1e7;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.login-imprint-link {
    display: block;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.login-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.login-imprint-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.login-imprint-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.login-footer-links .separator {
    color: var(--light-gray);
    font-weight: normal;
}

/* Hauptlayout */
#mainLayout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);

    /* Fixed position so navigation stays visible while scrolling */
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    overflow: hidden;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    scrollbar-width: thin;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.sidebar-header p {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-height: calc(100vh - 180px);
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.sidebar-menu a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.sidebar-menu a i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.badge {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--light-gray);
    color: var(--gray-color);
    font-size: 0.85rem;
    text-align: center;
}

/* Topbar */
.topbar {
    background-color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark-color);
    cursor: pointer;
    display: none;
}

.topbar h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification {
    position: relative;
    cursor: pointer;
    color: var(--gray-color);
    font-size: 1.25rem;
    background: none;
    border: none;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hauptinhalt */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* Platz für die feste Sidebar */
    margin-left: 260px;
} 

.content-area {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Container für neue Menü-Punkte */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.welcome-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(74, 111, 165, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.95rem;
    color: var(--gray-color);
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.recent-activities {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.recent-activities h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.recent-activities ul {
    list-style: none;
}

.recent-activities li {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
}

.recent-activities li:last-child {
    border-bottom: none;
}

.recent-activities li i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* Kalender */
.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.calendar-day-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.calendar-day {
    background-color: white;
    min-height: 120px;
    padding: 0.5rem;
    position: relative;
    transition: var(--transition);
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day-number {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
}

.calendar-day.today .calendar-day-number {
    background-color: var(--primary-color);
    color: white;
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: var(--medium-gray);
}

.calendar-events {
    margin-top: 2rem;
}

.calendar-event {
    background-color: white;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: var(--transition);
}

.calendar-event:hover {
    transform: translateX(5px);
}

.calendar-event-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.calendar-event-details {
    display: flex;
    gap: 1rem;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.calendar-event-details i {
    margin-right: 0.5rem;
}

/* Nachrichten */
.messages-container {
    max-width: 1000px;
    margin: 0 auto;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.messages-list {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.message-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: var(--transition);
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item.unread {
    background-color: rgba(74, 111, 165, 0.05);
    border-left: 4px solid var(--primary-color);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.message-sender {
    font-weight: 600;
    color: var(--dark-color);
}

.message-time {
    color: var(--gray-color);
    font-size: 0.875rem;
}

.message-subject {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.message-preview {
    color: var(--gray-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Fotoalben */
.photos-container {
    max-width: 1400px;
    margin: 0 auto;
}

.photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.album-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.album-cover {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-info {
    padding: 1.5rem;
}

.album-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.album-meta {
    display: flex;
    justify-content: space-between;
    color: var(--gray-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.album-access {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--light-gray);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.album-access.public {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.album-access.private {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

/* Album Detailansicht */
.album-detail-header {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.photo-item:hover {
    transform: scale(1.03);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.7));
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

/* Trinkspiele styles - improved */
.games-container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.games-body { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.games-left { width: 320px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,251,0.98)); padding: 1.25rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); border: 1px solid var(--light-gray); }
.games-right { flex: 1; background: linear-gradient(180deg, rgba(255,255,255,0.98), #ffffff); padding: 1.25rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); border: 1px solid var(--light-gray); }
.players-list { margin-bottom: 0.5rem; }
.players-list .player-input { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.player-input .player-name { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--light-gray); }
.players-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.player { padding: 8px 12px; background: var(--light-gray); border-radius: 20px; font-weight:600; }
.player.active { background: var(--primary-color); color: white; transform: scale(1.03); box-shadow: var(--box-shadow); }
.game-card { padding: 1rem; border-radius: 12px; background: linear-gradient(135deg,#f8fafc,#fff); box-shadow: var(--box-shadow); }
.games-menu button { display: block; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 10px; border-radius: 10px; border: 1px solid var(--light-gray); background: transparent; font-weight:600; transition: var(--transition); }
.games-menu button:hover { transform: translateY(-3px); box-shadow: var(--box-shadow); }
.games-menu button.active { background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); color: #fff; border-color: transparent; }
.card-box { width: 90px; height: 130px; perspective: 1000px; display: inline-block; }
.card-face { width: 100%; height: 100%; background: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; box-shadow: var(--box-shadow); backface-visibility: hidden; }
.card-box.flip { transform-style: preserve-3d; }
.card-box.flip .card-face { transform: rotateY(180deg); transition: transform 0.6s; }
.pulse { animation: pulse 900ms ease; }
@keyframes pulse { 0%{transform:scale(1);}50%{transform:scale(1.06);}100%{transform:scale(1);} }
.black-q { font-size: 1rem; line-height:1.5; }
.bus-anim { font-size: 1.1rem; font-weight: 700; }

/* Responsive */
@media (max-width: 900px) {
    .games-left { width: 100%; }
    .games-right { width: 100%; }
}

/* Dark theme adjustments for games */
body.dark-theme .games-left,
body.dark-theme .games-right {
    background: linear-gradient(180deg, rgba(8,12,18,0.7), rgba(10,14,22,0.72));
    border: 1px solid #1f2a36;
    box-shadow: none;
    color: var(--dark-color);
}
body.dark-theme .games-menu button {
    border-color: rgba(255,255,255,0.04);
    color: var(--dark-color);
    background: transparent;
}
body.dark-theme .games-menu button.active {
    background: linear-gradient(90deg, rgba(80,120,190,0.12), rgba(90,110,160,0.12));
    color: var(--dark-color);
    border-color: transparent;
}
body.dark-theme .player { background: rgba(255,255,255,0.03); color: var(--dark-color); }
body.dark-theme .player.active { background: var(--primary-color); color: white; }

/* Ensure game-card (ready state) is styled in dark mode */
body.dark-theme .game-card {
    background: linear-gradient(180deg, rgba(12,18,24,0.8), rgba(8,12,18,0.82));
    color: var(--dark-color);
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: none;
}
body.dark-theme .game-card .text-muted {
    color: #9aa6b6 !important;
}

/* Dark theme for Kings Cup card faces */
body.dark-theme .card-face {
    background: linear-gradient(180deg, rgba(20,28,38,0.9), rgba(12,16,22,0.95));
    color: var(--dark-color);
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
body.dark-theme .card-box .card-face { backface-visibility: hidden; }



.photo-info {
    color: white;
    width: 100%;
}

.photo-name {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.photo-date {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Einstellungen */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}

.settings-section h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-form {
    max-width: 500px;
}

/* Admin Bereich */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}

.admin-section h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.admin-table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--dark-color);
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

/* Dark theme styles for Admin table */
body.dark-theme .admin-section {
    background-color: #0b1220 !important;
    color: var(--dark-color) !important;
    border: 1px solid #1f2a36 !important;
}

body.dark-theme .admin-table th {
    background-color: rgba(255,255,255,0.02) !important;
    color: #cdd9e6 !important;
    border-bottom: 1px solid #1f2a36 !important;
}

body.dark-theme .admin-table td {
    background-color: transparent !important;
    color: #e6eef7 !important;
    border-bottom: 1px solid #1f2a36 !important;
}

body.dark-theme .admin-table tr:hover {
    background-color: rgba(255,255,255,0.02) !important;
}

body.dark-theme .admin-table .actions .btn {
    background: rgba(255,255,255,0.02) !important;
    color: #e6eef7 !important;
    border: 1px solid rgba(255,255,255,0.04) !important;
}


.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

/* Backdrop for dynamically created modals (direct body children) */
body > .modal {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), var(--box-shadow-lg);
}

/* When modal is inside modal-overlay, reset positioning */
.modal-overlay .modal {
    position: static;
    transform: none;
    box-shadow: var(--box-shadow-lg);
}

/* Ensure modal is always centered */
.modal {
    margin: auto;
}

.modal-lg {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-color);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

/* Benachrichtigungs-Popup */
.notification-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1001;
}

.notification-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: rgba(74, 111, 165, 0.05);
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.notification-message {
    color: var(--gray-color);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.notification-time {
    color: var(--medium-gray);
    font-size: 0.75rem;
}

/* Benutzer-Menü Popup */
.user-menu-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 250px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1001;
}

/* Users list for message recipient selection */
.users-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.users-list .empty-message {
    padding: 12px;
    text-align: center;
    color: var(--medium-gray);
}

.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.user-item:hover {
    background-color: rgba(74,111,165,0.04);
}

.user-item.selected {
    background-color: rgba(74,111,165,0.12);
    border: 1px solid rgba(74,111,165,0.18);
}

.user-item .avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.user-item .user-item-text {
    display: flex;
    flex-direction: column;
}

.user-item .user-item-name {
    font-weight: 600;
}

.user-item .user-item-fullname {
    font-size: 0.85rem;
}

.user-info {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
}

.user-menu-options {
    padding: 0.5rem 0;
}

.user-menu-options a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.user-menu-options a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.user-menu-options a i {
    width: 20px;
    margin-right: 10px;
}

/* Dark theme for user menu popup */
body.dark-theme .user-menu-popup {
    background-color: #0f1720;
    color: var(--dark-color);
    border: 1px solid #1f2a36;
    box-shadow: none;
}

body.dark-theme .user-menu-popup .user-info {
    border-bottom: 1px solid #1f2a36;
}

body.dark-theme .user-menu-popup .user-menu-options a {
    color: var(--dark-color);
}

body.dark-theme .user-menu-popup .user-menu-options a:hover {
    background-color: rgba(255,255,255,0.02);
    color: var(--primary-color);
}

/* Vollbild Bildbetrachter */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.image-viewer-header {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.image-viewer-body {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.image-viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-viewer-footer {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: white;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    /* Auf kleineren Bildschirmen entfernen wir die Margin, da die Sidebar überlappt */
    .main-content {
        margin-left: 0;
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem;
    }
    
    .calendar-grid {
        display: none;
    }
    
    .calendar-events {
        display: block;
    }
    
    .notification-popup {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .user-menu-popup {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
}

/* Animationen */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Klassen */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray-color);
}

.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; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Drag & Drop für Uploads */
.drop-zone {
    border: 2px dashed var(--light-gray);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.05);
}

.drop-zone.active {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.1);
}

/* Ladeanimation */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-color);
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dark-color);
    z-index: 1000;
    margin-bottom: -5px;
}

/* ========== Klickzähler Styles ========== */
.counter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.counter-header {
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.counter-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.counter-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.counter-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--box-shadow-lg);
    position: relative;
    overflow: hidden;
}

.counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b, #86a8e7, #91eae4);
}

.counter-display {
    margin-bottom: 2rem;
}

.counter-display span {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
    display: block;
    line-height: 1;
}

.counter-label {
    font-size: 1.2rem;
    color: var(--gray-color);
    margin-top: 0.5rem;
}

.counter-button {
    background: linear-gradient(135deg, #ff7e5f, #feb47b);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
    box-shadow: 0 10px 20px rgba(255, 126, 95, 0.3);
    animation: pulse 2s infinite;
}

.counter-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 126, 95, 0.4);
}

.counter-button:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 126, 95, 0.3);
}

.counter-info {
    margin-top: 2rem;
    padding: 1rem;
    background-color: rgba(74, 111, 165, 0.1);
    border-radius: 10px;
    color: var(--primary-color);
}

.counter-info i {
    margin-right: 10px;
}

.stats-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.leaderboard {
    margin-top: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    border-radius: 50%;
    font-weight: 700;
    margin-right: 1rem;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    background-color: gold;
    color: white;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    background-color: silver;
    color: white;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    background-color: #cd7f32;
    color: white;
}

.leaderboard-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--dark-color);
}

.leaderboard-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.leaderboard-count {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.leaderboard-percentage {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.history-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.history-list {
    margin-top: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.history-item:hover {
    background-color: #f8f9fa;
}

.history-item:last-child {
    border-bottom: none;
}

.history-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.history-info {
    flex: 1;
}

.history-user {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.history-time {
    color: var(--gray-color);
    font-size: 0.875rem;
}

.history-count {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Animationen */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 20px rgba(255, 126, 95, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 30px rgba(255, 126, 95, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 10px 20px rgba(255, 126, 95, 0.3);
    }
}

@keyframes clickEffect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.click-animation {
    animation: clickEffect 0.3s ease;
}

/* Responsive Design für Counter */
@media (max-width: 768px) {
    .counter-container {
        padding: 1rem;
    }
    
    .counter-header h1 {
        font-size: 1.8rem;
    }
    
    .counter-display span {
        font-size: 4rem;
    }
    
    .counter-button {
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== ADMIN KLICK-STATISTIKEN ========== */
.stats-summary .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.5rem;
}

.history-list-sm {
    max-height: 300px;
    overflow-y: auto;
}

.history-item-sm {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.history-item-sm:last-child {
    border-bottom: none;
}

.history-info-sm {
    flex: 1;
}

.history-user-sm {
    font-size: 0.875rem;
    font-weight: 500;
}

.history-time-sm {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.reset-history-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.reset-history-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.reset-type {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 1rem;
    min-width: 100px;
    text-align: center;
}

.reset-info {
    flex: 1;
}

.reset-info div {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Responsive für Admin-Bereich */
@media (max-width: 992px) {
    .admin-actions .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-actions button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ========== MOBILE FIRST APPROACH ========== */

/* Basis-Styles für alle Geräte */
:root {
    --mobile-padding: 1rem;
    --tablet-padding: 1.5rem;
    --desktop-padding: 2rem;
}

/* ========== MOBILE (bis 768px) ========== */
@media (max-width: 768px) {
    /* Allgemeine Anpassungen */
    body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    /* Login Container */
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
        width: calc(100% - 2rem);
        max-width: none;
    }
    
    /* Sidebar für Mobile - Hidden by default */
    .sidebar {
        position: fixed;
        width: 280px;
        height: 100vh;
        left: -280px;
        top: 0;
        z-index: 1000;
        transform: none;
        transition: left 200ms ease;
        overflow: hidden;
    }
    
    /* Sidebar visible when active */
    .sidebar.active {
        left: 0;
        transform: none;
    }
    
    .menu-toggle {
        display: block !important;
    }
    
    /* Main content full width on mobile */
    .main-content {
        width: 100%;
        margin-left: 0;
        transition: margin-left 200ms ease, width 200ms ease;
    }
    
    /* When sidebar is visible, shift content */
    body.sidebar-visible .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }

    /* Topbar positioning on mobile */
    .topbar {
        width: 100%;
        left: 0;
        position: fixed;
        z-index: 99;
    }

    .content-area {
        margin-top: 60px;
    }

    /* ========== COLLAPSED SIDEBAR (MOBILE) ========== */
    /* Toggled via adding class 'sidebar-collapsed' on <body> or 'collapsed' on .sidebar */
    .sidebar.collapsed,
    body.sidebar-collapsed .sidebar {
        width: 64px !important;
        left: -64px !important;
    }

    .sidebar.collapsed.active,
    body.sidebar-collapsed .sidebar.active {
        left: 0 !important;
    }

    body.sidebar-collapsed .main-content,
    .sidebar.collapsed ~ .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.sidebar-collapsed body.sidebar-visible .main-content {
        margin-left: 64px !important;
        width: calc(100% - 64px) !important;
    }

    /* Hide textual labels and role/name when collapsed */
    .menu-label { display: inline-block; transition: opacity 120ms ease; }
    .sidebar.collapsed .menu-label,
    body.sidebar-collapsed .menu-label {
        opacity: 0; visibility: hidden; width: 0; height: 0; margin: 0; padding: 0;
    }

    .sidebar.collapsed .sidebar-menu a,
    body.sidebar-collapsed .sidebar-menu a {
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-header p,
    body.sidebar-collapsed .sidebar-header p,
    .sidebar.collapsed #currentUser,
    body.sidebar-collapsed #currentUser {
        display: none;
    }

    .sidebar.collapsed .sidebar-header i,
    body.sidebar-collapsed .sidebar-header i { margin-right: 0; }

    .sidebar.collapsed .sidebar-menu a i,
    body.sidebar-collapsed .sidebar-menu a i { font-size: 1.25rem; }

    
    /* Topbar für Mobile - Full width */
    .topbar {
        padding: 1rem;
        position: fixed;
        left: 0;
        width: 100%;
        top: 0;
        z-index: 99;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Ensure user menu on right is visible like desktop */
    .topbar-right .user-menu { display: block !important; }
    /* Hide the extra mobile links button (we use the hamburger) */
    #mobileLinksBtn { display: none !important; }
    
    .topbar h1 {
        font-size: 1.2rem;
    }
    
    /* Content Area */
    .content-area {
        padding: 1rem;
        margin-top: 70px; /* Platz für Topbar */
        min-height: calc(100vh - 70px);
    }
    
    /* Dashboard */
    .stats-cards {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .welcome-card h2 {
        font-size: 1.4rem;
    }
    
    /* Kalender */
    .calendar-grid {
        display: none; /* Auf Mobile keine Kalendergrid */
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Nachrichten */
    .messages-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .message-item {
        padding: 1rem;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Fotoalben */
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 1rem;
    }
    
    .album-cover {
        height: 150px;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 0.5rem;
    }
    
    /* Klickzähler */
    .counter-container {
        padding: 1rem;
    }
    
    .counter-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .counter-display span {
        font-size: 3rem;
    }
    
    .counter-button {
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Admin Bereich */
    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    /* Modal */
    .modal {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Formulare */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .d-flex {
        flex-wrap: wrap;
    }
    
    /* Utility Classes für Mobile */
    .hide-on-mobile {
        display: none !important;
    }
    
    .show-on-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
}

/* ========== TABLET (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .calendar-grid {
        display: grid;
    }
}

/* ========== KLEINE DESKTOPS (1025px - 1366px) ========== */
@media (min-width: 1025px) and (max-width: 1366px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ========== TOUCH-FREUNDLICHE ELEMENTE ========== */
@media (hover: none) and (pointer: coarse) {
    /* Größere Touch-Targets für Mobile */
    button, 
    .btn,
    .sidebar-menu a,
    .tab,
    .message-item,
    .calendar-event,
    .album-card,
    .photo-item {
        min-height: 44px; /* Apple Human Interface Guidelines */
        min-width: 44px;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px; /* Verhindert automatisches Zoomen in iOS */
    }
    
    /* Größere Abstände für Touch */
    .sidebar-menu li {
        margin-bottom: 0.5rem;
    }
    
    /* Scroll-Verbesserungen */
    .content-area {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========== DUNKELMODUS FÜR MOBILE (NUR WENN KEINE BENUTZERWAHL) ========== */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    /* Diese Regeln gelten nur, wenn der Benutzer keine explizite Theme-Wahl trifft.
       Wir prüfen das über Klassen auf dem <html>-Element: .user-theme-dark / .user-theme-light */
    html:not(.user-theme-dark):not(.user-theme-light) body {
        background-color: #121212;
        color: #ffffff;
    }
    
    html:not(.user-theme-dark):not(.user-theme-light) .sidebar,
    html:not(.user-theme-dark):not(.user-theme-light) .topbar,
    html:not(.user-theme-dark):not(.user-theme-light) .stat-card,
    html:not(.user-theme-dark):not(.user-theme-light) .calendar-event,
    html:not(.user-theme-dark):not(.user-theme-light) .message-item,
    html:not(.user-theme-dark):not(.user-theme-light) .album-card,
    html:not(.user-theme-dark):not(.user-theme-light) .admin-section {
        background-color: #1e1e1e;
        color: #ffffff;
    }
    
    html:not(.user-theme-dark):not(.user-theme-light) .sidebar-menu a:hover {
        background-color: #2d2d2d;
    }
} 

/* ========== RESPONSIVE LAYOUTS ========== */

/* Flexbox Container */
.responsive-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.responsive-item {
    flex: 1 1 300px; /* Mindestbreite 300px */
    max-width: 100%;
}

/* Grid System */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
}

/* Card Layout für Mobile */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .card {
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 10px;
    }
    
    /* Mobile-spezifische Card Varianten */
    .card.flat {
        box-shadow: none;
        border: 1px solid var(--light-gray);
    }
}

/* Navigation für Mobile (modernisiert) */
.mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Floating pill-style bottom nav with blur */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: 780px;
        justify-content: space-between;
        gap: 0.25rem;
        background: rgba(255,255,255,0.82);
        backdrop-filter: blur(8px);
        border-radius: 999px;
        padding: 0.45rem 0.6rem;
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
        z-index: 1000;
        align-items: center;
    }

    /* Dark theme variant */
    body.dark-theme .mobile-nav {
        background: rgba(16,16,16,0.6);
        box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    }

    .mobile-nav-item {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0.45rem;
        text-decoration: none;
        color: var(--muted-color);
        font-size: 0.85rem;
        border-radius: 999px;
        transition: all 0.18s ease;
        min-height: 44px; /* größere Touch-Ziele */
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
        line-height: 1;
        margin-bottom: 0.12rem;
        transition: transform 0.18s ease, color 0.18s ease;
    }

    .mobile-nav-item span {
        display: block;
        font-size: 0.72rem;
        margin-top: 0;
        opacity: 0.95;
    }

    .mobile-nav-item.active {
        color: var(--primary-color);
        background: linear-gradient(90deg, rgba(74,111,165,0.12), rgba(74,111,165,0.06));
        transform: translateY(-3px);
        box-shadow: 0 6px 12px rgba(74,111,165,0.08);
    }

    .mobile-nav-item:active { transform: scale(0.98); }

    /* Platz für Mobile Navigation (safe-area berücksichtigen) */
    .content-area { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

    /* Topbar kompakter auf Handy */
    .topbar { padding: 0.45rem 0.75rem; height: 56px; align-items: center; }
    .topbar-left h1 { font-size: 1rem; margin-left: 0.4rem; }
    .menu-toggle { width: 44px; height: 44px; border-radius: 8px; }

    /* Touch-targets & Lesbarkeit */
    .sidebar-menu a, .mobile-nav-item { -webkit-tap-highlight-color: transparent; }

    /* Kleine Animation beim Wechsel */
    .mobile-nav-item.active i { transform: translateY(-2px) scale(1.02); }



/* Responsive Bilder */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Aspect Ratio Container für Bilder */
.aspect-ratio-container {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
}

.aspect-ratio-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Mobile-spezifische Bildgrößen */
@media (max-width: 768px) {
    .album-cover {
        height: 150px;
    }
    
    .photo-item img {
        height: 180px;
    }
    
    .avatar {
        width: 35px;
        height: 35px;
    }
    
    .avatar-large {
        width: 60px;
        height: 60px;
    }
}


/* ========== MOBILE UTILITY CLASSES ========== */

/* Display Klassen */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Text Anpassungen */
@media (max-width: 768px) {
    .text-small-mobile {
        font-size: 0.875rem;
    }
    
    .text-large-mobile {
        font-size: 1.1rem;
    }
    
    .text-center-mobile {
        text-align: center;
    }
    
    .text-left-mobile {
        text-align: left;
    }
    
    .text-right-mobile {
        text-align: right;
    }
}

/* Margin & Padding für Mobile */
@media (max-width: 768px) {
    .m-0-mobile {
        margin: 0 !important;
    }
    
    .p-1-mobile {
        padding: 0.5rem !important;
    }
    
    .p-2-mobile {
        padding: 1rem !important;
    }
    
    .mb-2-mobile {
        margin-bottom: 1rem !important;
    }
    
    .mt-2-mobile {
        margin-top: 1rem !important;
    }
}

/* Flexbox für Mobile */
@media (max-width: 768px) {
    .flex-column-mobile {
        flex-direction: column !important;
    }
    
    .flex-wrap-mobile {
        flex-wrap: wrap !important;
    }
    
    .justify-center-mobile {
        justify-content: center !important;
    }
    
    .align-center-mobile {
        align-items: center !important;
    }
}

/* Grid für Mobile */
@media (max-width: 768px) {
    .grid-1-mobile {
        grid-template-columns: 1fr !important;
    }
    
    .grid-2-mobile {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

}

/* ========== STRONG DARK-THEME OVERRIDES (END) ========== */
/* These rules are intentionally !important to ensure the user-chosen dark mode takes precedence
   over any mobile or system-level styles. */
body.dark-theme .card,
body.dark-theme .photos-header,
body.dark-theme .photos-container .text-center,
body.dark-theme .albums-grid,
body.dark-theme .album-card,
body.dark-theme .album-cover,
body.dark-theme .album-info,
body.dark-theme .settings-section,
body.dark-theme .admin-section,
body.dark-theme .messages-list,
body.dark-theme .message-item,
body.dark-theme .messages-header,
body.dark-theme .counter-card,
body.dark-theme .stats-section,
body.dark-theme .stat-card,
body.dark-theme .recent-activities,
body.dark-theme .recent-activities ul,
body.dark-theme .calendar-header,
body.dark-theme .calendar-day,
body.dark-theme .calendar-event,
body.dark-theme .modal,
body.dark-theme .login-container {
    background-color: #0b1220 !important;
    color: var(--dark-color) !important;
    border: 1px solid #1f2a36 !important;
    box-shadow: none !important;
}

/* Form controls */
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select,
body.dark-theme .form-control {
    background-color: #0b1220 !important;
    color: var(--dark-color) !important;
    border: 1px solid #1f2a36 !important;
}

/* Ensure stat boxes in counter are dark */
body.dark-theme .counter-main > *,
body.dark-theme .counter-main .stat-card,
body.dark-theme .stats-grid > * {
    background: none !important; /* remove gradients */
    background-color: #0b1220 !important;
    color: var(--dark-color) !important;
    border: 1px solid #1f2a36 !important;
}

/* Adjust stat-item specifics in dark mode */
body.dark-theme .stat-item {
    background: rgba(255,255,255,0.02) !important;
    color: var(--dark-color) !important;
    border: 1px solid #1f2a36 !important;
    box-shadow: none !important;
}

body.dark-theme .stat-item:hover {
    transform: none !important;
}

body.dark-theme .stat-value {
    color: var(--primary-color) !important;
}
body.dark-theme .stat-label {
    color: #9aa6b5 !important;
}
/* Make sure buttons and badges are readable */
body.dark-theme .btn,
body.dark-theme .badge,
body.dark-theme .album-access {
    box-shadow: none !important;
}

/* Mobile nav readability */
body.dark-theme .mobile-nav,
body.dark-theme .mobile-nav-item {
    background-color: #0f1720 !important;
    color: var(--dark-color) !important;
}

/* ========== IMPRESSUM STYLES ========== */

.imprint-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.imprint-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--light-gray);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.imprint-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.imprint-section p {
    margin-bottom: 1rem;
    color: var(--dark-color);
    line-height: 1.8;
    font-size: 0.95rem;
}

.imprint-section p:last-child {
    margin-bottom: 0;
}

.imprint-section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease;
}

.imprint-section a:hover {
    border-bottom-color: var(--primary-color);
}

.imprint-section strong {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Dark theme adjustments */
body.dark-theme .imprint-section {
    background-color: var(--light-gray);
    color: var(--dark-color);
}

body.dark-theme .imprint-section h4,
body.dark-theme .imprint-section strong {
    color: var(--primary-color);
}

body.dark-theme .imprint-section p {
    color: var(--dark-color);
}

/* Sidebar Footer Link */
.sidebar-footer {
    position: relative;
}

.footer-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-link:hover {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--primary-dark);
}

body.dark-theme .footer-link {
    color: var(--primary-color);
}

body.dark-theme .footer-link:hover {
    background-color: rgba(110, 163, 255, 0.15);
}

/* Scrollbar styling für Impressum */
.imprint-container::-webkit-scrollbar {
    width: 6px;
}

.imprint-container::-webkit-scrollbar-track {
    background: transparent;
}

.imprint-container::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

/* ======================
   Responsive Sidebar + Mobile Layout
   ====================== */

:root {
    --bg-surface: #f8fbff;
    --surface: #ffffff;
    --surface-alt: #f5f7fb;
    --surface-strong: #e9eef7;
    --text-primary: #1f2937;
    --text-secondary: #566178;
    --text-muted: #718096;
    --border-default: #dfe3ea;
    --border-strong: rgba(74, 111, 165, 0.16);
    --shadow-soft: 0 12px 40px rgba(20, 39, 75, 0.06);
    --shadow-strong: 0 12px 35px rgba(15, 23, 42, 0.12);
}

body {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

body.dark-theme {
    --bg-surface: #080f1a;
    --surface: #111b2a;
    --surface-alt: #16243d;
    --surface-strong: #0c1523;
    --text-primary: #e7effc;
    --text-secondary: #a8b4d1;
    --text-muted: #8fa2c4;
    --border-default: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
}

.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border-default);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    overflow: hidden;
    transition: width 0.3s ease, transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 30;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-default);
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.sidebar-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    max-height: calc(100vh - 180px);
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.95rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 14px;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(74, 111, 165, 0.08);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    border-left: 4px solid var(--primary-color);
}

.sidebar-menu a i {
    width: 28px;
    min-width: 28px;
    margin-right: 12px;
    font-size: 1.05rem;
}

.sidebar-menu a .menu-label {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.25s ease, margin 0.25s ease;
}

.sidebar.collapsed .sidebar-menu a .menu-label {
    opacity: 0;
    margin-left: -8px;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-default);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.sidebar-footer .footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar {
    background-color: var(--surface);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: rgba(74, 111, 165, 0.08);
    border: 1px solid transparent;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.menu-toggle:hover {
    background: rgba(74, 111, 165, 0.14);
}

.topbar h1 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification,
.btn.icon-btn {
    background: rgba(74, 111, 165, 0.06);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.85rem;
}

.notification:hover,
.btn.icon-btn:hover {
    background: rgba(74, 111, 165, 0.14);
}

    .main-content {
}

body.sidebar-collapsed .main-content {
    margin-left: 80px;
}

body.sidebar-visible .main-content {
    filter: brightness(0.96);
}

.content-area {
    flex-grow: 1;
    padding: 1.5rem;
    width: 100%;
    min-height: calc(100vh - 100px);
}

.dashboard,
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card,
.welcome-card,
.card,
.modal,
.notification-popup,
.user-menu-popup,
.album-item,
.photo-item {
    background-color: var(--surface);
    color: var(--text-primary);
}

body.dark-theme .sidebar,
body.dark-theme .topbar,
body.dark-theme .content-area,
body.dark-theme .card,
body.dark-theme .modal,
body.dark-theme .notification-popup,
body.dark-theme .user-menu-popup,
body.dark-theme .album-item,
body.dark-theme .photo-item,
body.dark-theme .welcome-card,
body.dark-theme .stat-card {
    background-color: var(--surface-dark);
    color: var(--text-primary);
    border-color: var(--border-default);
    box-shadow: none;
}

body.dark-theme .sidebar-menu a:hover,
body.dark-theme .sidebar-menu a.active {
    background-color: rgba(110, 163, 255, 0.12);
}

body.dark-theme .topbar {
    border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .sidebar-footer {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 320px;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .topbar {
        padding: 0.85rem 1rem;
    }

    .topbar-left {
        gap: 0.75rem;
    }

    .topbar h1 {
        font-size: 1.15rem;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
    }

    .content-area {
        padding: 1rem;
        min-height: calc(100vh - 92px);
    }

    .dashboard,
    .page-container {
        padding: 0;
    }

    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background-color: var(--surface);
        border-top: 1px solid var(--border-default);
        display: flex;
        justify-content: space-between;
        gap: 0.25rem;
        padding: 0.35rem 0.5rem;
        z-index: 30;
    }

    .mobile-nav-item {
        flex: 1;
        text-align: center;
        color: var(--text-secondary);
        text-decoration: none;
        padding: 0.5rem 0.35rem;
        border-radius: 14px;
        transition: background-color 0.2s ease, color 0.2s ease;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        font-size: 0.8rem;
    }

    .mobile-nav-item.active,
    .mobile-nav-item:hover {
        background-color: rgba(74, 111, 165, 0.1);
        color: var(--primary-color);
    }

    .mobile-nav-item i {
        font-size: 1.05rem;
    }

    .mobile-nav-item span {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0.75rem 0.85rem;
    }

    .topbar-right {
        gap: 0.75rem;
    }

    .content-area {
        padding: 0.85rem;
    }
}
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-block;
    margin-top: 0.5rem;
}

.imprint-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========== Spotify Playlist ========== */
.playlist-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
}

.playlist-card h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.spotify-embed {
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.spotify-embed iframe {
    border-radius: var(--border-radius);
}

.btn-spotify {
    background-color: #1DB954;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-spotify:hover {
    background-color: #1ed760;
    color: white;
    text-decoration: none;
}

/* ========== Section Header für neue Seiten ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.section-header h1 {
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header .btn {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.section-header .btn:hover {
    background-color: rgba(255,255,255,0.3);
}

/* ========== Eigene Counter Cards ========== */
.counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.counters-grid .counter-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow-lg);
}

.counters-grid .counter-display {
    margin-bottom: 1.5rem;
}

.counters-grid .counter-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
}

.counters-grid .counter-label {
    font-size: 1.1rem;
    color: var(--gray-color);
    margin-top: 0.5rem;
}

.counters-grid .counter-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.counters-grid .click-counter-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.counters-grid .click-counter-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--box-shadow);
}

.counters-grid .click-for-others-btn {
    background: linear-gradient(135deg, var(--accent-color), #feb47b);
    color: white;
}

.counters-grid .click-for-others-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--box-shadow);
}

.counters-grid .counter-info {
    margin: 1rem 0;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.counters-grid .counter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* ========== Dokumente Cards ========== */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
}

.doc-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

/* ========== Umfragen Cards ========== */
.polls-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.poll-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--light-gray);
}

.poll-header h3 {
    margin-bottom: 1rem;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.poll-option {
    padding: 0.75rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
}

.poll-option:hover:not([disabled]) {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.05);
}

.poll-option.voted {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.1);
}

.poll-ended {
    opacity: 0.7;
}

/* ========== Statistik Cards ========== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-overview .stat-card {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.stats-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.stats-section h2 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pie-chart-container {
    max-width: 400px;
    margin: 0 auto;
}

/* ========== Kasse Cards ========== */
.balance-card {
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.balance-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 800;
}

.cash-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cash-logs {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.cash-logs h2 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: var(--light-color);
}

.log-amount.positive {
    color: var(--success-color);
    font-weight: 600;
}

.log-amount.negative {
    color: var(--danger-color);
    font-weight: 600;
}

.log-meta {
    text-align: right;
    font-size: 0.85rem;
    color: var(--gray-color);
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-color);
}

.empty-state i {
    margin-bottom: 1rem;
    display: block;
    color: var(--medium-gray);
}

/* ========== Mitglieder Checkbox Liste ========== */
.members-checkbox-list,
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.25rem;
    cursor: pointer;
}

/* Dark theme overrides for new components */
body.dark-theme .playlist-card,
body.dark-theme .counters-grid .counter-card,
body.dark-theme .document-card,
body.dark-theme .poll-card,
body.dark-theme .stats-section,
body.dark-theme .cash-logs,
body.dark-theme .balance-card,
body.dark-theme .log-item {
    background-color: #0b4180;
    color: var(--dark-color);
    border-color: #1f2a36;
}

body.dark-theme .section-header {
    background: linear-gradient(135deg, rgba(74,111,165,0.3), rgba(109,139,199,0.2));
}