* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Mode Colors */
    --primary-color: #667eea;
    --primary-hover: #5568d3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --spacing: 16px;
    
    /* Animation */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --background: #121212;
    --surface: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.7);
}

/* Dark Mode spezifische Verbesserungen */
[data-theme="dark"] .chat-item {
    border-bottom-color: #2a2a2a;
}

[data-theme="dark"] .chat-item:hover {
    background: #252525;
}

[data-theme="dark"] .message-bubble {
    background: #2a2a2a;
    color: #ffffff;
}

[data-theme="dark"] .message.own .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

[data-theme="dark"] .modal-content {
    background: #1e1e1e;
    border: 1px solid #333333;
}

[data-theme="dark"] .modal-body input {
    background: #252525;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .modal-body input:focus {
    border-color: #667eea;
    background: #2a2a2a;
}

[data-theme="dark"] .chat-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .chat-input-container {
    background: #1e1e1e;
    border-top-color: #333333;
}

[data-theme="dark"] #messageInput {
    background: #252525;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] #messageInput:focus {
    border-color: #667eea;
    background: #2a2a2a;
}

[data-theme="dark"] .chat-messages {
    background: #121212;
}

[data-theme="dark"] .chat-sidebar {
    background: #1e1e1e;
    border-right-color: #333333;
}

[data-theme="dark"] .chat-item.active {
    background: #2a2a2a;
    border-left: 3px solid #667eea;
}

[data-theme="dark"] .profile-detail-item {
    border-bottom-color: #333333;
}

[data-theme="dark"] .profile-settings {
    border-top-color: #333333;
}

[data-theme="dark"] .setting-item {
    border-bottom-color: #333333;
}

[data-theme="dark"] .btn-secondary {
    background: #404040;
    color: #ffffff;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4a4a4a;
}

[data-theme="dark"] .chat-item-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] .loading {
    color: #b0b0b0;
}

[data-theme="dark"] .no-chat-selected {
    color: #b0b0b0;
}

[data-theme="dark"] .chat-item-name {
    color: #ffffff;
}

[data-theme="dark"] .chat-item-preview {
    color: #b0b0b0;
}

[data-theme="dark"] .chat-item-time {
    color: #808080;
}

[data-theme="dark"] .message-name {
    color: #ffffff;
}

[data-theme="dark"] .message-time {
    color: #808080;
}

[data-theme="dark"] .message-name.clickable-name {
    color: #a0c4ff;
}

[data-theme="dark"] .message-name.clickable-name:hover {
    color: #667eea;
}

[data-theme="dark"] .clickable-title,
[data-theme="dark"] .clickable-username {
    color: #ffffff;
}

[data-theme="dark"] .clickable-title:hover,
[data-theme="dark"] .clickable-username:hover {
    color: #a0c4ff;
}

[data-theme="dark"] .profile-detail-item .detail-label {
    color: #b0b0b0;
}

[data-theme="dark"] .profile-detail-item .detail-value {
    color: #ffffff;
}

[data-theme="dark"] .profile-username {
    color: #b0b0b0;
}

[data-theme="dark"] .profile-number {
    color: #b0b0b0;
}

[data-theme="dark"] .setting-item label:first-child {
    color: #ffffff;
}

[data-theme="dark"] .slider {
    background-color: #404040;
}

[data-theme="dark"] input:checked + .slider {
    background-color: #667eea;
}

[data-theme="dark"] .btn-primary {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

[data-theme="dark"] .chat-item-badge {
    background: #667eea;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .online-indicator {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="dark"] .dot {
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

/* Sidebar Action Buttons - Dark Mode */
[data-theme="dark"] .btn-new-chat,
[data-theme="dark"] .btn-new-group {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: 2px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .btn-new-chat:hover,
[data-theme="dark"] .btn-new-group:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-new-chat:active,
[data-theme="dark"] .btn-new-group:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.5);
}

/* Alle Buttons im Dark Mode verbessern */
[data-theme="dark"] button:not(.send-button):not(.copy-btn):not(.theme-toggle):not(.modal-close) {
    color: #ffffff;
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
    color: #ffffff;
}

[data-theme="dark"] .btn-secondary {
    background: #404040;
    color: #ffffff;
    border: 1px solid #555555;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4a4a4a;
    border-color: #666666;
    color: #ffffff;
}

[data-theme="dark"] .logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

body > .chat-container {
    flex: 1;
    overflow: hidden;
}

.chat-container {
    width: 100%;
    min-height: calc(100vh - 80px);
    background: var(--surface);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: background-color var(--transition-normal);
}

/* Linke Seitenleiste */
.chat-sidebar {
    width: 350px;
    min-width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: var(--spacing);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.sidebar-header h2 {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-number-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.user-number-display .label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.user-number-display .number {
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 1px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: auto;
    transition: background 0.2s, transform 0.1s;
    min-width: 28px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.sidebar-actions {
    padding: var(--spacing);
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.btn-new-chat,
.btn-new-group {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), color var(--transition-normal);
}

.btn-new-chat:hover,
.btn-new-group:hover {
    background: var(--background);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-new-chat:active,
.btn-new-group:active {
    transform: translateY(0);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-item {
    padding: 12px var(--spacing);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-item:hover {
    background: var(--background);
}

.chat-item.active {
    background: #e7f3ff;
    border-left: 3px solid var(--primary-color);
}

.chat-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chat-item-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Rechte Seite: Chat-Ansicht */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing);
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing);
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing);
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    margin-top: 8px;
}

.user-name-display {
    flex: 1;
}

.username {
    font-weight: 500;
    font-size: 0.95rem;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(15deg);
}

.theme-icon {
    display: inline-block;
    transition: transform var(--transition-normal);
}

[data-theme="dark"] .theme-icon {
    transform: rotate(180deg);
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: background var(--transition-fast), transform var(--transition-fast);
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing);
    background: var(--background);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-chat-selected,
.no-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 2rem;
    text-align: center;
}

.error-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-primary);
    transition: color var(--transition-normal);
}

[data-theme="dark"] .error-message {
    color: #ffffff;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 80%;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.message:hover {
    transform: translateX(2px);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.message-name {
    font-weight: 600;
    color: var(--text-primary);
}

.message-name.clickable-name {
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.message-name.clickable-name:hover {
    color: var(--primary-color);
}

.message-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.message-bubble {
    background: var(--surface);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    word-wrap: break-word;
    line-height: 1.5;
}

.message.own .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-delete-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
    margin-left: 8px;
}

.message:hover .message-delete-btn {
    opacity: 1;
}

.message-delete-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.message-delete-btn:active {
    transform: scale(0.95);
}

.message-bubble.deleted {
    opacity: 0.6;
    font-style: italic;
}

.message-deleted {
    font-style: italic;
    opacity: 0.7;
    color: var(--text-secondary);
}

.message.own .message-bubble.deleted {
    background: rgba(102, 126, 234, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .message-bubble.deleted {
    opacity: 0.5;
}

[data-theme="dark"] .message.own .message-bubble.deleted {
    background: rgba(102, 126, 234, 0.2);
    color: rgba(255, 255, 255, 0.5);
}

/* Rechtsklick-Kontextmenü */
.message-context-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 150px;
    padding: 4px 0;
    animation: contextMenuSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contextMenuSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.context-menu-item:hover {
    background: var(--background);
}

.context-menu-item-danger {
    color: #e74c3c;
}

.context-menu-item-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

[data-theme="dark"] .message-context-menu {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .context-menu-item:hover {
    background: #333;
}

/* Nachrichten-Info Modal */
.message-reads-list {
    max-height: 400px;
    overflow-y: auto;
}

.message-read-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.message-read-item:last-child {
    border-bottom: none;
}

.message-read-item:hover {
    background: var(--background);
}

.read-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.read-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.read-item-info {
    flex: 1;
}

.read-item-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.read-item-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.read-badge {
    color: #4CAF50;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-read-item.unread .read-item-name {
    opacity: 0.6;
}

[data-theme="dark"] .message-read-item {
    border-color: #444;
}

[data-theme="dark"] .message-read-item:hover {
    background: #333;
}

/* Call UI */
.call-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.call-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.call-btn.audio {
    background: rgba(76, 175, 80, 0.8);
}

.call-btn.video {
    background: rgba(102, 126, 234, 0.9);
}

.call-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* ============================================
   FLOATING CALL WINDOW (Discord/Zoom Style)
   ============================================ */

.call-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 300px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.call-window:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.call-window.fullscreen {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    max-height: 900px;
    bottom: unset;
    right: unset;
    cursor: default;
}

.call-window.minimized {
    width: 200px;
    height: 150px;
    cursor: pointer;
}

.call-window.minimized .call-videos {
    display: none;
}

.call-window.minimized .call-controls {
    display: none;
}

.call-window.minimized .call-header {
    padding: 8px;
}

.call-window-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.call-window-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.call-type-icon {
    font-size: 1.2rem;
}

.call-duration {
    font-size: 0.9rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.call-window-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.call-window-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1rem;
}

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

.call-window-videos {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-window-videos.fullscreen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.call-window-videos.minimized {
    display: none;
}

.call-window .remote-video-wrapper,
.call-window .local-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.call-window.fullscreen .remote-video-wrapper,
.call-window.fullscreen .local-video-wrapper {
    width: 100%;
    height: 100%;
}

.call-window:not(.fullscreen) .remote-video-wrapper {
    width: 100%;
    height: 100%;
}

.call-window:not(.fullscreen) .local-video-wrapper {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.call-window .local-video-wrapper video,
.call-window .remote-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-window .local-video-wrapper video {
    transform: scaleX(-1); /* Mirror für lokales Video */
}

.call-window-controls {
    background: rgba(0, 0, 0, 0.7);
    padding: 12px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}

.call-window-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    transition: all 0.2s;
}

.call-window-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.call-window-control-btn.active {
    background: rgba(76, 175, 80, 0.8);
}

.call-window-control-btn.hangup {
    background: #f44336;
}

.call-window-control-btn.hangup:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.call-window-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 5;
}

/* Dark Mode für Call Window */
[data-theme="dark"] .call-window {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .call-window-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .call-window {
        width: calc(100vw - 40px);
        height: 250px;
        bottom: 10px;
        right: 20px;
        left: 20px;
    }
    
    .call-window.fullscreen {
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }
}

/* Alte Call Modal Styles (für Kompatibilität) */
.call-modal {
    max-width: 900px;
    width: 100%;
    background: var(--surface);
}

/* Incoming Call Overlay - Fullscreen mit Blur */
.incoming-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.incoming-call-content {
    text-align: center;
    color: white;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.incoming-call-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    border-radius: 50%;
    overflow: visible;
}

.avatar-initial-large {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 2;
}

.avatar-pulse {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

.incoming-call-name {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: white;
}

.incoming-call-type {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.incoming-call-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.btn-call-accept,
.btn-call-reject {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-call-accept {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-call-accept:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(76, 175, 80, 0.5);
}

.btn-call-accept:active {
    transform: scale(0.95);
}

.btn-call-reject {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.btn-call-reject:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(244, 67, 54, 0.5);
}

.btn-call-reject:active {
    transform: scale(0.95);
}

[data-theme="dark"] .incoming-call-overlay {
    background: rgba(0, 0, 0, 0.9);
}

.call-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.call-videos {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 8px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.video-wrapper.local {
    max-height: 220px;
}

.video-wrapper.remote {
    max-height: 340px;
}

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

.call-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.call-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.call-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.call-control-btn.hangup {
    background: #e74c3c;
    color: #fff;
}

.call-control-btn.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
}

@media (max-width: 900px) {
    .call-videos {
        grid-template-columns: 1fr;
    }

    .video-wrapper.local {
        max-height: 180px;
    }

    .video-wrapper.remote {
        max-height: 260px;
    }
}

.chat-input-container {
    padding: var(--spacing);
    background: var(--surface);
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.attach-button,
.voice-button {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-normal);
    flex-shrink: 0;
}

.attach-button:hover,
.voice-button:hover {
    background: var(--background);
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.attach-button:active,
.voice-button:active {
    transform: scale(0.95);
}

[data-theme="dark"] .attach-button,
[data-theme="dark"] .voice-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .attach-button:hover,
[data-theme="dark"] .voice-button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a91 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
    transform: scale(1.1);
}

[data-theme="dark"] .attach-button:active,
[data-theme="dark"] .voice-button:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

.upload-preview {
    padding: 10px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.upload-preview-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.upload-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    border: 2px solid var(--border-color);
    transition: border-color var(--transition-fast), background-color var(--transition-normal);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--background);
    color: var(--text-secondary);
}

.upload-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.upload-preview-item .remove-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.upload-preview-close {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.upload-preview-close:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

[data-theme="dark"] .upload-preview {
    background: #1a1a1a;
    border-bottom-color: #333333;
}

[data-theme="dark"] .upload-preview-item {
    background: #252525;
    border-color: #404040;
}

[data-theme="dark"] .upload-preview-item .file-icon {
    background: #1e1e1e;
    color: #808080;
}

/* Voice Recording Modal */
.voice-recording-modal {
    max-width: 400px;
}

.voice-recording-display {
    text-align: center;
    padding: 20px;
}

.voice-waveform {
    width: 100%;
    height: 100px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background-color var(--transition-normal);
}

.voice-waveform::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 2px;
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.voice-timer {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: monospace;
    transition: color var(--transition-normal);
}

.voice-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition-normal);
}

.voice-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-voice-record,
.btn-voice-stop,
.btn-voice-send {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn-voice-record {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-voice-record:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-voice-stop {
    background: #dc3545;
    color: white;
}

.btn-voice-stop:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-voice-send {
    background: #28a745;
    color: white;
}

.btn-voice-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

[data-theme="dark"] .voice-waveform {
    background: #1a1a1a;
}

[data-theme="dark"] .voice-timer {
    color: #ffffff;
}

[data-theme="dark"] .voice-status {
    color: #b0b0b0;
}

/* Message Attachments */
.message-attachment {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.message-attachment img,
.message-attachment video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
}

.message-attachment audio {
    width: 100%;
    max-width: 400px;
}

.message-attachment .file-download {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-normal);
}

.message-attachment .file-download:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.message-attachment .file-icon {
    font-size: 2rem;
}

.message-attachment .file-info {
    flex: 1;
}

.message-attachment .file-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.message-attachment .file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .message-attachment .file-download {
    background: #252525;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .message-attachment .file-download:hover {
    background: #2a2a2a;
    border-color: #667eea;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-normal), color var(--transition-normal);
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#messageInput::placeholder {
    color: var(--text-secondary);
    transition: color var(--transition-normal);
}

.send-button {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal), background-color var(--transition-normal);
}

.modal[style*="flex"] .modal-content {
    transform: scale(1) translateY(0);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: var(--spacing);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: var(--spacing);
}

.clickable-title,
.clickable-username {
    cursor: pointer;
    transition: opacity 0.2s;
}

.clickable-title:hover,
.clickable-username:hover {
    opacity: 0.8;
}

/* Profil-Modal */
.modal-profile .modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-initial {
    font-size: 2rem;
    font-weight: 600;
    color: white;
}

.profile-info h2 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.profile-username {
    color: var(--text-secondary);
    margin: 0 0 5px 0;
}

.profile-number {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
}

.profile-details {
    margin-bottom: 20px;
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
}

.profile-settings {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.profile-settings h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.settings-section {
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label:first-child {
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.settings-actions {
    margin-top: 20px;
}

.profile-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.modal-body input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    margin-top: 8px;
}

.participant-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.participant-input input {
    flex: 1;
    margin: 0;
}

.btn-add {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

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

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.btn-primary:hover {
    opacity: 0.9;
}

.participants-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-tag {
    background: var(--background);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.participant-tag .remove {
    cursor: pointer;
    color: var(--text-secondary);
}

.participant-tag .remove:hover {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height (iOS Safari) */
    }
    
    .chat-sidebar {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 10;
        transition: transform 0.3s ease;
    }
    
    .chat-sidebar.hidden {
        transform: translateX(-100%);
    }
    
    .chat-main {
        height: 100%;
        width: 100%;
    }
    
    .chat-header .header-content {
        padding: 10px 12px;
    }
    
    /* Back Button auf Mobile */
    .mobile-back-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        background: transparent;
        color: var(--text-primary, #fff);
        font-size: 20px;
        cursor: pointer;
        border-radius: 8px;
        margin-right: 8px;
        flex-shrink: 0;
    }
    .mobile-back-btn:active {
        background: rgba(255,255,255,0.1);
    }
    
    .message {
        max-width: 88%;
    }
    
    .message-content {
        font-size: 15px;
    }
    
    /* Input auf Mobile */
    .chat-input-form {
        gap: 6px;
    }
    
    .chat-input-form input[type="text"] {
        font-size: 16px !important; /* Verhindert iOS-Zoom beim Tippen */
    }
    
    /* Sidebar Header kompakt */
    .sidebar-header {
        padding: 12px 14px;
    }
    
    .sidebar-header h2 {
        font-size: 18px;
    }
    
    /* Chat-Items etwas größer für Touch */
    .chat-item {
        padding: 12px 14px;
        min-height: 64px;
    }
    
    /* Modal fullscreen auf Mobile */
    .modal-content {
        width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 40px) !important;
        max-height: calc(100dvh - 40px) !important;
        margin: 10px;
    }
    
    /* Upload Preview */
    .upload-preview {
        max-height: 120px;
    }
    
    .upload-preview-items {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

/* ---- PWA Standalone Modus (installierte App) ---- */
@media (display-mode: standalone) {
    body {
        /* Safe area für iPhone Notch etc. */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .chat-container {
        height: 100vh;
        height: 100dvh;
    }
    
    /* Status bar area auf iOS */
    .sidebar-header,
    .chat-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    /* Bottom safe area für Input */
    .chat-input-container,
    .chat-input-form {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* ---- Kleine Bildschirme (iPhone SE etc.) ---- */
@media (max-width: 380px) {
    .message {
        max-width: 92%;
    }
    
    .sidebar-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .sidebar-actions button {
        width: 100%;
        font-size: 13px;
    }
    
    .chat-item {
        padding: 10px 10px;
    }
}

/* ---- Tablet ---- */
@media (min-width: 769px) and (max-width: 1024px) {
    .chat-sidebar {
        width: 280px;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--border-radius);
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* ===== FOOTER STYLES ===== */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 20px var(--spacing);
    margin-top: auto;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

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

.footer-separator {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.footer-copyright p {
    margin: 0;
}

/* Dark Mode Footer */
[data-theme="dark"] .site-footer {
    background: var(--surface);
    border-top-color: var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.5);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 16px var(--spacing);
    }
    
    .footer-content {
        gap: 10px;
    }
    
    .footer-links {
        gap: 8px;
    }
    
    .footer-link,
    .footer-separator {
        font-size: 13px;
    }
    
    .footer-copyright {
        font-size: 12px;
    }
}
