:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-input: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

.landing-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo h1 {
    font-size: 1.8em;
    color: white;
}

.landing-header nav {
    display: flex;
    gap: 10px;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 80px 0;
}

.hero-content h2 {
    font-size: 3.5em;
    line-height: 1.2;
    margin-bottom: 20px;
    color: white;
}

.hero-content p {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-chat-mockup {
    background: #1e293b;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 420px;
    margin: 0 auto;
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.mockup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.mockup-header span:nth-child(2) {
    color: #f1f5f9;
    font-weight: 600;
    flex: 1;
}

.mockup-status {
    color: var(--success) !important;
    font-size: 0.85em;
}

.mockup-messages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 260px;
}

.mockup-msg {
    padding: 10px 16px;
    border-radius: 16px;
    max-width: 75%;
    font-size: 0.95em;
    animation: fadeInUp 0.5s;
}

.mockup-msg.left {
    background: #334155;
    color: #f1f5f9;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.mockup-msg.right {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.mockup-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #0f172a;
    border-top: 1px solid #334155;
}

.mockup-input span:first-child {
    color: #64748b;
    font-size: 0.9em;
}

.mockup-icons {
    color: #94a3b8 !important;
    font-size: 1.1em;
    letter-spacing: 4px;
}

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

.features {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin: 40px 0;
}

.features h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 60px;
    color: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: white;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.8);
}

.landing-footer {
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 80px;
}

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

.footer-logo h3 {
    color: white;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 2.5em;
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s;
    background: white;
    color: #333;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.auth-footer p {
    color: #666;
}

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

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar.compact {
    width: 80px;
}

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

.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-avatar {
    position: relative;
    width: 50px;
    height: 50px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
}

.avatar-placeholder.small {
    width: 35px;
    height: 35px;
    font-size: 0.9em;
}

.avatar-placeholder.large {
    width: 100px;
    height: 100px;
    font-size: 2em;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.status-online {
    background: var(--success);
}

.status-offline {
    background: var(--text-muted);
}

.user-details h3 {
    font-size: 1.1em;
    margin-bottom: 2px;
}

.user-status {
    font-size: 0.85em;
    color: var(--text-secondary);
}

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

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background 0.3s;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-hover);
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.search-box {
    padding: 15px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.conversation-list,
.contact-list {
    padding: 10px;
}

.conversation-item,
.contact-item,
.device-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    align-items: center;
}

.conversation-item:hover,
.contact-item:hover {
    background: var(--bg-hover);
}

.conversation-item.active {
    background: var(--bg-hover);
}

.conversation-avatar,
.contact-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.conversation-avatar img,
.contact-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.conversation-info,
.contact-info {
    flex: 1;
    min-width: 0;
}

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

.conversation-header h4,
.contact-info h4 {
    font-size: 1em;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-header .time {
    font-size: 0.75em;
    color: var(--text-secondary);
}

.conversation-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-preview p {
    font-size: 0.85em;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.unread-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
}

.contact-info p {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 20px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-content {
    text-align: center;
}

.welcome-content h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.welcome-content p {
    color: var(--text-secondary);
}

.chat-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-avatar {
    position: relative;
    width: 45px;
    height: 45px;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chat-info h3 {
    font-size: 1.1em;
    margin-bottom: 2px;
}

.chat-members,
.chat-status {
    font-size: 0.85em;
    color: var(--text-secondary);
}

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

.messages-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 70%;
}

.message.own {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    flex: 1;
}

.message-sender {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message:not(.own) .message-bubble {
    background: var(--bg-card);
    border-bottom-left-radius: 4px;
}

.message.own .message-bubble {
    background: var(--primary);
    border-bottom-right-radius: 4px;
}

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

.message-image {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
}

.message-document {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
}

.doc-icon {
    font-size: 1.5em;
}

.message-document a {
    color: inherit;
    text-decoration: none;
}

.message-document a:hover {
    text-decoration: underline;
}

/* Caption-Eingabe vor dem Upload */
.caption-input-wrap {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    align-items: center;
}

.caption-input-wrap input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.caption-input-wrap input:focus {
    border-color: #667eea;
}

.caption-input-wrap button {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.caption-input-wrap .cancel-btn {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Custom Video-Player */
.video-player {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    margin-bottom: 4px;
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #1a1a2e;
}

.vid-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.vid-btn:active {
    opacity: 0.6;
}

.vid-progress-wrap {
    flex: 1;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vid-progress-bg {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.vid-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.vid-time {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 36px;
}

/* Upload-Fortschrittsanzeige */
.upload-progress {
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 10px;
    margin-bottom: 8px;
}

.upload-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.15s ease;
}

.message-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

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

.read-status {
    font-size: 0.75em;
    color: var(--success);
    margin-left: 5px;
}

.edited-label {
    font-size: 0.7em;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 5px;
}

.message-edit,
.message-edit,
.message-delete {
    background: transparent;
    border: none;
    font-size: 1em;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    margin-left: 5px;
}

.message:hover .message-edit,
.message:hover .message-delete {
    opacity: 1;
}

.typing-indicator {
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.chat-input {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input textarea {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    max-height: 150px;
    font-family: inherit;
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.send-btn {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
}

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

.back-btn {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

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

.profile-page .sidebar {
    width: 250px;
}

.profile-nav {
    padding: 10px;
}

.profile-nav .nav-item {
    display: block;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.profile-nav .nav-item:hover {
    background: var(--bg-hover);
}

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

.profile-container {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.profile-section {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.profile-section h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
}

.profile-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
}

.profile-form {
    max-width: 500px;
}

.avatar-upload {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.current-avatar {
    width: 100px;
    height: 100px;
}

.current-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.qr-section {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.qr-container {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    margin: 20px 0;
}

.qr-expiry {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.devices-list {
    margin-top: 30px;
}

.device-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.device-icon {
    font-size: 2em;
    width: 50px;
}

.device-info h4 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

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

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.security-info h4 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

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

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: white;
}

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

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

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2em;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

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

.modal-body {
    padding: 20px;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.search-result-item .user-info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.user-email {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.member-select-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.member-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.3s;
}

.member-select-item:hover {
    background: var(--bg-hover);
}

.member-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.member-select-item span {
    flex: 1;
}

.group-members-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.group-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.member-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.member-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.member-role {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.voice-recording-ui {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--radius);
}

/* Admin Styles */
.admin-page .sidebar {
    width: 250px;
}

.admin-nav {
    padding: 10px;
}

.admin-nav .nav-item {
    display: block;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    margin-bottom: 5px;
}

.admin-nav .nav-item:hover {
    background: var(--bg-hover);
}

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

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: var(--bg-main);
}

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

.admin-header h1 {
    font-size: 2em;
    margin: 0;
}

.admin-stats,
.admin-user {
    display: flex;
    gap: 15px;
    align-items: center;
}

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

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-icon {
    font-size: 3em;
}

.stat-info h3 {
    font-size: 2em;
    margin-bottom: 5px;
}

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

.admin-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.admin-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

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

.activity-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: var(--radius-sm);
}

.activity-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.activity-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

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

.admin-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
}

.admin-table tr:hover {
    background: var(--bg-hover);
}

.table-avatar,
.table-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.table-avatar-placeholder {
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-secondary {
    background: var(--text-muted);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

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

.search-form {
    display: flex;
    gap: 10px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.pagination-info {
    color: var(--text-secondary);
}

.logs-container {
    max-height: 600px;
    overflow-y: auto;
}

.log-entry {
    padding: 15px;
    border-left: 4px solid;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.log-info {
    border-left-color: var(--info);
}

.log-warning {
    border-left-color: var(--warning);
}

.log-error {
    border-left-color: var(--danger);
}

.log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.log-level {
    font-weight: 600;
}

.log-time {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.log-message {
    margin-bottom: 8px;
}

.log-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    display: flex;
    gap: 15px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.log-stat {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.settings-form .admin-section {
    margin-bottom: 30px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.setting-info h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

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

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: 0.4s;
    border-radius: 34px;
}

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

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

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

.recording-indicator {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

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

#recording-time {
    font-weight: 600;
    color: var(--danger);
    font-size: 1.1em;
}

/* Admin Styles */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--bg-card);
    padding: 20px;
    border-right: 1px solid var(--border);
}

.admin-logo {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--primary);
}

.admin-nav-link {
    display: block;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.admin-nav-link.active {
    background: var(--primary);
    color: white;
}

.admin-main {
    flex: 1;
    padding: 40px;
    background: var(--bg-main);
}

.admin-main h1 {
    font-size: 2em;
    margin-bottom: 30px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.admin-stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-icon {
    font-size: 3em;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 5px;
}

.stat-sub {
    color: var(--success);
    font-size: 0.9em;
    margin-top: 5px;
}

.admin-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.admin-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Download Page Styles */
.download-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

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

.download-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.download-header p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.download-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning);
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.warning-icon {
    font-size: 2.5em;
}

.warning-content h3 {
    margin-bottom: 10px;
    color: var(--warning);
}

.download-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.download-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
}

.download-card.disabled {
    opacity: 0.6;
}

.download-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.download-card h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.download-details {
    margin: 25px 0;
    text-align: left;
}

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

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

.detail-value {
    font-weight: 600;
}

.download-note {
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.coming-soon {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.coming-soon p {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.installation-guide {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 40px;
}

.installation-guide h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-step {
    display: flex;
    gap: 20px;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
}

.step-content h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.step-content strong {
    color: var(--text-primary);
}

.faq-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 40px;
}

.faq-section h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
}

.faq-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

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

.faq-item h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--primary);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item ul {
    margin-top: 10px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.faq-item li {
    margin-bottom: 5px;
}

.support-box {
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    color: white;
}

.support-box h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.support-box p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ===== Legal Pages ===== */
.legal-page {
    background: var(--bg-primary);
    color: #1a1a1a;
    min-height: 100vh;
    padding: 40px 20px 60px;
}

.legal-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 50px 45px 60px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.legal-nav {
    margin-bottom: 40px;
}

.legal-page .back-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: color 0.2s;
}

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

.legal-page h1 {
    font-size: 2.4em;
    color: #111111;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.legal-page h2 {
    font-size: 1.5em;
    color: #1a1a1a;
    margin-top: 36px;
    margin-bottom: 12px;
}

.legal-page h3 {
    font-size: 1.15em;
    color: #333333;
    margin-top: 24px;
    margin-bottom: 8px;
}

.legal-page p {
    color: #333333;
    line-height: 1.8;
    margin-bottom: 16px;
}

.legal-page ul {
    margin: 10px 0 16px 24px;
    color: #333333;
    line-height: 2;
}

.legal-page ul li {
    margin-bottom: 4px;
}

.nav-item-admin {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #f59e0b !important;
}

.nav-item-admin:hover {
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, 0.1);
}

.legal-date {
    margin-top: 50px;
    color: #888888 !important;
    font-size: 0.9em;
    font-style: italic;
}

/* ===== Chat Action Buttons (Dashboard Sidebar) ===== */
.chat-action-buttons {
    display: flex;
    gap: 8px;
    padding: 0 15px 10px;
}

.chat-action-buttons .btn-half {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 12px;
}

/* ===== Attach Menu ===== */
.attach-menu-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.attach-menu-btn:hover {
    background: var(--bg-hover);
}

/* ===== Emoji Picker ===== */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 50;
    display: flex;
    flex-direction: column;
    max-height: 380px;
}

.emoji-picker-header {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px 8px;
    flex-shrink: 0;
}

.emoji-picker-header input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
}

.emoji-picker-header input:focus {
    outline: none;
    border-color: var(--primary);
}

.emoji-picker-header .icon-btn {
    font-size: 16px;
    color: var(--text-secondary);
    padding: 4px 8px;
}

.emoji-categories {
    display: flex;
    gap: 4px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
}

.emoji-cat-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.emoji-cat-btn:hover {
    background: var(--bg-hover);
}

.emoji-cat-btn.active {
    background: var(--bg-hover);
    box-shadow: 0 0 0 2px var(--primary);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    padding: 10px 10px;
    overflow-y: auto;
    flex: 1;
}

.emoji-btn-item {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
    line-height: 1.2;
    text-align: center;
}

.emoji-btn-item:hover {
    background: var(--bg-hover);
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
    }
    
    .hero-chat-mockup {
        display: none;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-page .sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .dashboard-page .app-container {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    /* Chat-Layout auf Mobile */
    .chat-page .app-container {
        overflow: hidden;
        height: 100%;
        flex-direction: row;
    }

    .chat-page .sidebar,
    .chat-page .sidebar.compact {
        display: none !important;
    }

    .chat-page .chat-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        background: var(--bg-primary);
        z-index: 100;
        overflow: hidden;
    }

    .chat-page .chat-header {
        flex-shrink: 0;
        background: var(--bg-card);
        z-index: 10;
        padding: 12px 16px;
    }

    .chat-page .messages-container {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        padding: 12px 14px;
    }

    .chat-page .typing-indicator {
        flex-shrink: 0;
        padding: 0 14px;
    }

    .chat-page .chat-input {
        flex-shrink: 0;
        background: var(--bg-card);
        z-index: 10;
        padding: 10px 12px;
        border-top: 1px solid var(--border);
    }

    .chat-page .emoji-picker {
        bottom: 65px;
        left: 0;
        right: 0;
        max-height: 45vh;
    }
}