/**
 * SecureChat - Complete CSS Styling
 * Based on the provided mockup design
 * Responsive, modern, glassmorphism design
 * VOLLSTÄNDIGE VERSION MIT ALLEN KORREKTUREN
 */

:root {
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-bg: rgba(30, 30, 30, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-content p {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-spinner.large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

.loading-spinner.small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left: 2px solid var(--primary-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Modal */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.login-modal {
    background: var(--dark-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header .logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input {
    padding: 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.login-btn {
    padding: 16px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.login-btn.loading .btn-text {
    display: none;
}

.login-btn.loading .btn-loading {
    display: inline;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

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

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary-dark);
}

/* Main App Container */
.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    margin: 0;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: var(--dark-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: var(--transition);
    z-index: 1000;
}

/* Mobile Header - STANDARDMÄSSIG VERSTECKT */
.mobile-header {
    display: none; /* KORRIGIERT: Standardmäßig versteckt */
    flex-shrink: 0;
    height: 60px;
    padding: 15px 20px;
    background: var(--dark-bg);
    border-bottom: 1px solid var(--glass-border);
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    z-index: 1001;
}

/* Menu Toggle Button */
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--glass-bg);
    transform: scale(1.1);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.header {
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    color: var(--primary-color);
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.security-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 500;
}

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

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

.user-info {
    padding: 20px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hash-key-display {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 10px;
    color: var(--primary-color);
    word-break: break-all;
    background: rgba(76, 175, 80, 0.1);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* Chat List Styling - KORRIGIERT */
.chat-list {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding: 12px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

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

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-chat-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.chat-loading p {
    margin-top: 16px;
    font-size: 14px;
}

.chat-item {
    padding: 16px 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
    margin: 4px 8px;
    border-radius: 0 12px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-item:hover {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.chat-item.active {
    background: rgba(76, 175, 80, 0.15);
    border-left-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
}

.chat-preview {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-unread {
    position: absolute;
    top: 8px;
    right: 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* Main Content - Standard Layout für Desktop */
.main-content {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    position: relative;
    height: 100vh; /* Volle Höhe auf Desktop */
    overflow: hidden;
}

/* Chat Header - KORRIGIERT für besseres Layout */
.chat-header {
    flex-shrink: 0;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* KORRIGIERT: stretch statt center */
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    min-height: 80px;
    gap: 20px; /* Abstand zwischen Elementen */
}

/* Chat Info Container - Verbesserte Struktur */
.chat-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0; /* Ermöglicht Text-Truncation */
}

.chat-info h3 {
    margin: 0 0 4px 0; /* KORRIGIERT: Explizite Margins */
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Text-Truncation bei langen Namen */
    line-height: 1.2; /* Kontrollierte Zeilenhöhe */
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(11px, 2.5vw, 13px);
    color: var(--primary-color);
    font-weight: 500;
    margin: 0; /* KORRIGIERT: Explizite Margin-Entfernung */
    line-height: 1; /* Verhindert zusätzlichen Zeilenabstand */
}

/* Call Controls - Flexibles Layout */
.call-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0; /* Verhindert Schrumpfung */
}

.call-btn {
    padding: 12px 16px;
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    min-height: 44px; /* Touch-Target für Mobile */
}

.audio-call {
    background: var(--secondary-color);
    color: white;
}

.video-call {
    background: var(--primary-color);
    color: white;
}

.call-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

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

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: auto !important; /* Kein smooth für Polling */
    contain: layout style paint;
    height: 0;
    min-height: 200px;
}

.messages-container.user-scrolling {
    scroll-behavior: smooth; /* Smooth nur für User-Scrolling */
}

/* Scrollbar-Styling verbessert */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Für Firefox */
.messages-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Welcome Message Zentrierung */
.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100%;
    color: var(--text-primary);
    padding: 40px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.welcome-message h2 {
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 600;
}

.welcome-message p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.security-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.security-info p {
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.security-info ul {
    list-style: none;
    text-align: left;
}

.security-info li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.message {
    max-width: min(70%, 500px);
    padding: 14px 18px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    contain: layout style paint; 
    font-size: 14px;
    line-height: 1.5;
    animation: messageSlideIn 0.3s ease;
}

/* Scroll-Animation für neue Nachrichten */
@keyframes scrollHighlight {
    0% {
        background: rgba(76, 175, 80, 0.2);
    }
    100% {
        background: transparent;
    }
}

.message.new-message {
    animation: scrollHighlight 2s ease-out;
}

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

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    border-bottom-left-radius: 6px;
}

/* System Message Styling - Für verschlüsselte System-Nachrichten */
.message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 16px;
    padding: 8px 16px;
    font-size: 12px;
    font-style: italic;
    max-width: 80%;
    text-align: center;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message.system .message-meta {
    font-size: 10px;
    opacity: 0.6;
    justify-content: center;
}

.message-meta {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.encryption-badge {
    background: rgba(76, 175, 80, 0.2);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 8px;
    border: 1px solid var(--primary-color);
    font-weight: 600;
}

/* Input Area */
.input-area {
    flex-shrink: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    align-items: flex-end;
    backdrop-filter: blur(20px);
    min-height: 88px;
}

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

.attachment-btn {
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.attachment-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.message-input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: var(--border-radius-lg);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    font-family: var(--font-family);
}

.message-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.message-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Call Overlay */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    z-index: 2000;
    padding: 20px;
}

.call-overlay.active {
    display: flex;
}

.call-info {
    text-align: center;
    margin-bottom: 40px;
}

.call-info h3 {
    font-size: clamp(20px, 5vw, 28px);
    margin-bottom: 12px;
    font-weight: 600;
}

.call-status {
    color: var(--primary-color);
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 500;
}

.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 800px;
}

.video-box {
    aspect-ratio: 16/9;
    background: #1a1a1a;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 24px;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.call-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.mute-btn {
    background: var(--secondary-color);
    color: white;
}

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

.video-toggle {
    background: var(--primary-color);
    color: white;
}

.action-btn:hover {
    transform: scale(1.1);
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 3000;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    font-weight: 500;
    max-width: calc(100vw - 40px);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.error {
    background: rgba(244, 67, 54, 0.95);
}

.toast.warning {
    background: rgba(255, 152, 0, 0.95);
}

.toast.info {
    background: rgba(33, 150, 243, 0.95);
}

.toast.success {
    background: rgba(76, 175, 80, 0.95);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
}

/* WebRTC Status */
.webrtc-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--border-radius-lg);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    font-weight: 500;
}

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

/* Email Verification Overlay */
.email-verification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.verification-info {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.verification-info h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 18px;
}

.verification-info p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.expires-info {
    color: var(--warning-color) !important;
    font-weight: 600;
}

.verification-input {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.resend-btn, .back-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.resend-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.verification-help {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
}

.verification-help h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 14px;
}

.verification-help ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.verification-help li {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.verification-help li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Neue Animationen für E-Mail-Verifizierung */
@keyframes inputFocus {
    from { transform: scale(1); box-shadow: none; }
    to { transform: scale(1.02); box-shadow: 0 0 20px rgba(76, 175, 80, 0.3); }
}

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

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes welcomeGlow {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 30px rgba(76, 175, 80, 0.4); }
}

/* Success State Styling */
.verification-success-content {
    text-align: center;
    padding: 20px;
}

.success-animation {
    margin: 20px 0;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: checkmarkBounce 0.6s ease;
}

.checkmark {
    color: white;
    font-size: 40px;
    font-weight: bold;
}

@keyframes checkmarkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-message h3 {
    color: var(--primary-color);
    margin: 20px 0 10px 0;
}

.success-features {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 20px 0;
}

.success-features h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.feature-item {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: left;
}

.redirect-info {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.success-logo {
    color: var(--primary-color) !important;
    animation: successPulse 2s infinite;
}

/* SecureChat Onboarding Styles */
.new-user-welcome {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.new-user-welcome .welcome-icon {
    font-size: 80px;
    margin-bottom: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.onboarding-progress {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.onboarding-progress p {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.onboarding-features {
    margin: 40px 0;
}

.onboarding-features h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 20px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.onboarding-features .feature-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.onboarding-features .feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.onboarding-features .feature-item h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.onboarding-features .feature-item p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.onboarding-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.primary-btn, .secondary-btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

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

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

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

/* Empty State für Chat-Liste */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-primary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.empty-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.refresh-btn, .create-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.refresh-btn {
    background: var(--secondary-color);
    color: white;
}

.refresh-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.create-btn {
    background: var(--primary-color);
    color: white;
}

.create-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Loading Animation für Onboarding */
.onboarding-progress .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(76, 175, 80, 0.3);
    border-left: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Pulse Animation für neue Inhalte */
.new-content {
    animation: contentPulse 0.5s ease-out;
}

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

/* File Messages Styling */
.message-file {
    max-width: 300px;
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 80px; /* Verhindert Layout-Shifts */
}

.message-file:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.file-preview {
    min-height: 60px; /* Basis-Höhe für Placeholder */
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.file-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.file-video {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    pointer-events: none;
}

.file-icon-large {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: rgba(255, 255, 255, 0.05);
}

.file-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-preview:hover .file-overlay {
    opacity: 1;
}

.file-preview:hover .file-image {
    transform: scale(1.05);
}

.file-icon {
    font-size: 24px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.file-info {
    padding: 12px;
    color: #1e3c72;;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.3;
}

.file-size {
    font-size: 12px;
    opacity: 0.8;
}

.image-placeholder,
.video-placeholder {
    min-height: 150px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.3);
    border-left: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.video-loading-text {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    text-align: center;
}

.error-message {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
}

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

.file-image,
.file-video {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.message-file {
    contain: layout style; /* Performance-Optimierung */
}

/* Verhindert Layout-Shift während Loading */
.message-file .file-preview {
    contain: layout;
}

/* Message Text Styling */
.message-text {
    line-height: 1.4;
}

/* Media Viewer Overlay */
.media-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.media-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: mediaZoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.media-video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    outline: none;
}

.media-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 10001;
}

.media-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

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

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

.media-info {
    margin-top: 20px;
    text-align: center;
    color: white;
    max-width: 500px;
}

.media-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.media-details {
    font-size: 14px;
    opacity: 0.8;
}

.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.media-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.media-nav.prev {
    left: 30px;
}

.media-nav.next {
    right: 30px;
}

.keyboard-shortcuts {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
}

/* Upload Progress Overlay */
.upload-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.upload-progress-modal {
    background: var(--dark-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    max-width: 450px;
    width: 100%;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.upload-progress-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.upload-cancel-btn {
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.upload-cancel-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.upload-file-info {
    margin-bottom: 20px;
}

.upload-filename {
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-word;
    color: var(--primary-color);
}

.upload-stage {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-progress-text {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.upload-features {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--border-radius);
    padding: 12px;
    font-size: 12px;
    text-align: center;
    color: var(--primary-color);
}

/* Verschlüsselte Dateien Styling */
.encrypted-file {
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.1);
}

.encrypted-file:hover {
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
}

.encryption-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    backdrop-filter: blur(5px);
}

.optimization-badge {
    background: rgba(33, 150, 243, 0.2);
    color: var(--secondary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.error-file {
    border: 1px solid rgba(244, 67, 54, 0.3);
    background: rgba(244, 67, 54, 0.05);
}

.error-file .file-overlay {
    background: rgba(244, 67, 54, 0.6);
}

.error-file .file-info {
    color: rgba(244, 67, 54, 0.8);
}

/* Loading-State für verschlüsselte Bilder */
.encrypted-file .file-image {
    background: linear-gradient(90deg, 
        rgba(76, 175, 80, 0.1) 25%, 
        rgba(76, 175, 80, 0.2) 50%, 
        rgba(76, 175, 80, 0.1) 75%
    );
    background-size: 200% 100%;
}

.encrypted-file .file-image[src]:not([src=""]) {
    animation: encryptedImageLoad 0.5s ease;
}

@keyframes encryptedImageLoad {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* File Type Specific Styling */
.image-file .file-preview {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

.video-file .file-preview {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
}

.document-file .file-preview {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
}

/* Loading Animation für Bilder */
.file-image[loading] {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus Management */
.focusable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* In style.css hinzufügen */
/* Message Status System - In style.css hinzufügen */

.message-status {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Status-spezifische Farben */
.message-status.pending {
    color: #999;
    opacity: 0.7;
}

.message-status.sent {
    color: #ffffff;
}

.message-status.delivered {
    color: #bbbbbb;
}

.message-status.read {
    color: #1e3c72 !important;
    font-weight: 600;
}

/* Message-Meta Bereich erweitern */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.7;
}

.message.sent .message-meta {
    flex-direction: row;
}

.message.received .message-meta {
    justify-content: flex-start;
}

/* Encryption Badge anpassen */
.encryption-badge {
    background: rgba(255, 255, 255, 0.7);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

/* Status-Icon Animation */
.message-status {
    animation: statusFadeIn 0.3s ease-in-out;
}

@keyframes statusFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover-Effekt für Status-Details */
.message-status:hover {
    opacity: 1;
    cursor: help;
}

/* Spezielle Behandlung für File-Messages */
.message-file .message-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    margin-top: 8px;
}

/* Dark Theme Anpassungen */
@media (prefers-color-scheme: dark) {
    .message-status.pending {
        color: #666;
    }
    
    .message-status.sent,
    .message-status.delivered {
        color: #66BB6A;
    }
    
    .message-status.read {
        color: #42A5F5 !important;
    }
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .message-status {
        font-size: 13px;
        margin-left: 6px;
    }
    
    .message-meta {
        font-size: 10px;
        gap: 4px;
    }
}

/* RESPONSIVE BREAKPOINTS */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 280px 1fr;
    }
    
    .mobile-header {
        display: none; /* Bleibt versteckt auf Tablets */
    }
    
    .main-content {
        height: 100vh; /* Volle Höhe auf Tablets */
    }
    
    .call-btn span {
        display: none;
    }
    
    .call-btn {
        padding: 12px;
        border-radius: 50%;
        width: 48px;
        height: 48px;
    }
}

/* MOBILE BREAKPOINT - Mobile Header wird angezeigt */
@media (max-width: 768px) {
    /* App Container - Grid Layout anpassen */
    .app-container {
        grid-template-columns: 1fr; /* Nur eine Spalte auf Mobile */
        position: relative;
    }
    
    /* Sidebar - Als Overlay auf Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        transform: translateX(-100%);
        z-index: 1500;
        box-shadow: var(--shadow);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Sidebar Overlay hinter Sidebar wenn geöffnet */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: -1;
    }
    
    .sidebar.open::before {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Mobile Header - NUR auf Mobile anzeigen */
    .mobile-header {
        display: flex !important; /* KORRIGIERT: Nur auf Mobile anzeigen */
        position: sticky;
        top: 0;
        z-index: 1001;
    }
    
    /* Main Content - Höhe anpassen für Mobile Header */
    .main-content {
        grid-column: 1;
        height: calc(100vh - 60px); /* Mobile Header Höhe abziehen */
        overflow: hidden;
    }
    
    /* Chat Header - Kleinere Padding auf Mobile */
    .chat-header {
        padding: 16px 20px;
        min-height: 70px;
        gap: 12px;
    }
    
    .chat-info h3 {
        font-size: 16px;
    }
    
    .online-status {
        font-size: 11px;
    }
    
    .call-controls {
        gap: 8px;
    }
    
    .call-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 40px;
    }
    
    /* Call Button Text auf Mobile ausblenden falls zu eng */
    .call-btn span {
        display: none;
    }
    
    .call-btn {
        padding: 12px;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
    
    /* Messages Container - Touch Scrolling */
    .messages-container {
        -webkit-overflow-scrolling: touch;
        padding: 16px;
        gap: 12px;
    }
    
    .message {
        max-width: 85%;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Input Area - Kompakter auf Mobile */
    .input-area {
        padding: 16px;
        min-height: 80px;
        gap: 8px;
    }
    
    .message-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .send-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .video-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .call-actions {
        gap: 16px;
    }
    
    .action-btn {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
    
    .login-modal {
        padding: 32px;
        max-width: 400px;
    }
    
    /* Toast auf Mobile */
    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        transform: translateY(-100px);
        max-width: none;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    /* Media Viewer auf Mobile */
    .media-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .media-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .media-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .media-nav.prev {
        left: 10px;
    }

    .media-nav.next {
        right: 10px;
    }

    .media-title {
        font-size: 16px;
    }

    .media-details {
        font-size: 12px;
    }

    .message-file {
        max-width: 250px;
    }
    
    /* Upload Progress auf Mobile */
    .upload-progress-modal {
        padding: 20px;
        margin: 16px;
    }
    
    .upload-progress-header h3 {
        font-size: 16px;
    }
    
    .upload-cancel-btn {
        width: 28px;
        height: 28px;
    }
    
    .upload-features {
        font-size: 11px;
        padding: 10px;
    }
    
    /* Responsive Logo im Mobile Header */
    .mobile-header .logo {
        font-size: clamp(18px, 4vw, 22px);
        font-weight: 700;
        color: var(--primary-color);
    }
}

/* KLEINE MOBILE GERÄTE */
@media (max-width: 480px) {
    .mobile-header {
        height: 56px; /* Etwas kleiner auf sehr kleinen Geräten */
        padding: 12px 16px;
    }
    
    .main-content {
        height: calc(100vh - 60px); /* Angepasste Höhe */
    }
    
    .sidebar {
        width: 280px; /* Schmaler auf kleinen Geräten */
    }
    
    .chat-header {
        padding: 12px 16px;
        min-height: 64px;
    }
    
    .menu-toggle {
        font-size: 22px;
        padding: 6px;
    }
    
    .chat-item {
        padding: 14px 16px;
        margin: 2px 4px;
    }
    
    .messages-container {
        padding: 12px;
        gap: 12px;
    }
    
    .message {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    .input-area {
        padding: 12px;
        gap: 8px;
    }
    
    .call-overlay {
        padding: 16px;
    }
    
    .call-info {
        margin-bottom: 30px;
    }
    
    .video-container {
        margin-bottom: 30px;
    }
    
    .action-btn {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }
    
    .webrtc-status {
        bottom: 16px;
        left: 16px;
        right: 16px;
        justify-content: center;
        font-size: 11px;
    }
    
    .login-modal {
        padding: 24px;
        margin: 16px;
    }
    
    .login-header .logo {
        font-size: 28px;
    }
    
    .welcome-icon {
        font-size: 48px;
    }
    
    .welcome-message h2 {
        font-size: 24px;
    }
    
    .security-info {
        padding: 20px;
        margin: 0 16px;
    }
    
    /* Verification auf Mobile */
    .verification-input {
        font-size: 20px;
        letter-spacing: 4px;
    }
    
    .verification-info {
        padding: 16px;
    }
    
    .verification-help {
        padding: 12px;
    }
    
    /* Onboarding auf Mobile */
    .new-user-welcome {
        padding: 20px 15px;
    }
    
    .new-user-welcome .welcome-icon {
        font-size: 60px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature-item {
        padding: 15px;
    }
    
    .feature-icon {
        font-size: 28px;
    }
    
    .onboarding-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
}

/* EXTRA KLEINE GERÄTE */
@media (max-width: 360px) {
    .mobile-header {
        height: 52px;
        padding: 10px 12px;
    }
    
    .main-content {
        height: calc(100vh - 52px);
    }
    
    .sidebar {
        width: 260px;
    }
    
    .menu-toggle {
        font-size: 20px;
        padding: 4px;
    }
    
    .call-actions {
        gap: 12px;
    }
    
    .action-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    
    .message {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    .login-modal {
        padding: 20px;
    }
    
    .onboarding-progress {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .feature-item h4 {
        font-size: 15px;
    }
    
    .feature-item p {
        font-size: 13px;
    }
}

/* Desktop - Sicherstellen dass Mobile Header versteckt bleibt */
@media (min-width: 769px) {
    .mobile-header {
        display: none !important; /* Force Hide auf Desktop */
    }
    
    .main-content {
        height: 100vh; /* Volle Höhe ohne Mobile Header */
    }
    
    .sidebar {
        position: static; /* Normal positioning auf Desktop */
        transform: none;
        width: auto;
        z-index: auto;
        box-shadow: none;
    }
    
    .app-container {
        grid-template-columns: 320px 1fr; /* Zwei-Spalten Layout */
    }
}

/* Landscape Phones */
@media (max-height: 500px) and (orientation: landscape) {
    .call-overlay {
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        padding: 16px;
    }
    
    .call-info {
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    .video-container {
        margin-bottom: 0;
        margin-right: 20px;
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }
    
    .call-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .welcome-message {
        padding: 20px;
    }
    
    .security-info {
        max-width: 300px;
        padding: 16px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.08);
        --glass-border: rgba(255, 255, 255, 0.15);
    }
}

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

/* Touch targets */
@media (pointer: coarse) {
    .chat-item, .call-btn, .action-btn, .menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}