/**
 * Chat Sidebar Styles - Unten links positioniert
 */

/* Datums-Trenner für Chat-Nachrichten */
.chat-date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    gap: 15px;
}

.chat-date-separator-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.chat-date-separator-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    text-transform: capitalize;
    white-space: nowrap;
    padding: 0 10px;
}

.chat-sidebar {
    position: fixed;
    bottom: 50px;
    left: 0;
    width: 450px;
    height: 550px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color, #4a9eff);
    border-radius: 0 8px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    animation: slideInLeft 0.3s ease;
    margin-left: 0;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.chat-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.chat-sidebar-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--primary-color, #4a9eff);
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-sidebar-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-sidebar-maximize,
.chat-sidebar-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-sidebar-maximize:hover,
.chat-sidebar-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.chat-sidebar.maximized {
    width: calc(100vw - 40px) !important;
    height: calc(100vh - 100px) !important;
    left: 20px !important;
    bottom: 20px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.chat-sidebar.maximized .chat-sidebar-maximize {
    display: none;
}

.chat-sidebar-restore {
    display: none;
}

.chat-sidebar.maximized .chat-sidebar-restore {
    display: flex !important;
}

.chat-sidebar-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.chat-sidebar-left {
    width: 180px;
    background: rgba(0, 0, 0, 0.4);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.chat-sidebar-left.hidden {
    width: 30px;
    min-width: 30px;
    overflow: visible;
    flex-shrink: 0;
}

.chat-sidebar-left.hidden .chat-sidebar-content {
    display: none;
}

.chat-sidebar-left.hidden::after {
    content: 'Channels';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    width: 100px;
    text-align: center;
    margin-left: -35px;
}

.chat-sidebar-left.hidden:hover::after {
    color: rgba(255, 255, 255, 0.8);
}

.chat-sidebar-right {
    width: 180px;
    background: rgba(0, 0, 0, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.chat-sidebar-right.hidden {
    width: 30px;
    min-width: 30px;
    overflow: visible;
    flex-shrink: 0;
}

.chat-sidebar-right.hidden .chat-sidebar-content {
    display: none;
}

.chat-sidebar-right.hidden::after {
    content: 'Online';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: center;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    width: 100px;
    text-align: center;
    margin-right: -35px;
}

.chat-sidebar-right.hidden:hover::after {
    color: rgba(255, 255, 255, 0.8);
}

.chat-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-section {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

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

.chat-sidebar-section-header.clickable,
.chat-sidebar-section-title.clickable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.chat-sidebar-section-header.clickable:hover,
.chat-sidebar-section-title.clickable:hover {
    color: rgba(255, 255, 255, 0.9);
}

.chat-sidebar-toggle-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 10px;
    transition: transform 0.2s;
    color: rgba(255, 255, 255, 0.5);
}

.chat-sidebar-section-header.collapsed .chat-sidebar-toggle-icon,
.chat-sidebar-section-title.collapsed .chat-sidebar-toggle-icon {
    transform: rotate(-90deg);
}

.chat-sidebar-add-btn {
    background: var(--primary-color, #4a9eff);
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-sidebar-add-btn:hover {
    background: #3a8eef;
    transform: scale(1.1);
}

.chat-sidebar-channel-item {
    position: relative;
    padding: 6px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 3px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: 300;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-channel-name {
    flex: 1;
}

.chat-sidebar-channel-actions {
    display: none;
    gap: 4px;
    align-items: center;
}

.chat-sidebar-channel-item:hover .chat-sidebar-channel-actions {
    display: flex;
}

.chat-sidebar-channel-edit,
.chat-sidebar-channel-delete {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    transition: color 0.2s;
}

.chat-sidebar-channel-edit:hover {
    color: var(--primary-color, #4a9eff);
}

.chat-sidebar-channel-delete:hover {
    color: rgba(211, 47, 47, 0.8);
}

.chat-sidebar-user-online-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.6);
    animation: pulse 2s infinite;
}

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

.chat-sidebar-section-title {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-sidebar-channel-list,
.chat-sidebar-user-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.chat-sidebar-channel-list.hidden,
.chat-sidebar-user-list.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.chat-sidebar-channel-item {
    position: relative;
    padding: 6px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 3px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: 300;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-channel-name {
    flex: 1;
}

.chat-sidebar-channel-actions {
    display: none;
    gap: 4px;
    align-items: center;
}

.chat-sidebar-channel-item:hover .chat-sidebar-channel-actions {
    display: flex;
}

.chat-sidebar-channel-edit,
.chat-sidebar-channel-delete {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    transition: color 0.2s;
}

.chat-sidebar-channel-edit:hover {
    color: var(--primary-color, #4a9eff);
}

.chat-sidebar-channel-delete:hover {
    color: rgba(211, 47, 47, 0.8);
}

.chat-sidebar-channel-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.chat-sidebar-channel-item.active {
    background: rgba(74, 158, 255, 0.15);
    color: var(--primary-color, #4a9eff);
    border-left-color: var(--primary-color, #4a9eff);
}

.chat-sidebar-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: 300;
}

.chat-sidebar-user-item.current-user {
    background: rgba(74, 158, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.chat-sidebar-user-item.current-user .chat-sidebar-user-name {
    font-weight: 400;
}

.chat-sidebar-user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-sidebar-user-avatar,
.chat-sidebar-user-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-sidebar-user-avatar {
    object-fit: cover;
}

.chat-sidebar-user-avatar-placeholder {
    background: var(--primary-color, #4a9eff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 400;
}

.chat-sidebar-user-name {
    font-weight: 300;
}

.chat-sidebar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: flex 0.3s ease;
    box-sizing: border-box;
}

.chat-sidebar-main-header {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.chat-sidebar-channel-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--primary-color, #4a9eff);
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-sidebar-messages-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-scroll-to-bottom-btn {
    position: absolute;
    bottom: 10px; /* Direkt über dem Input-Bereich, als Overlay */
    right: 15px; /* Konsistent mit Chat-Padding */
    pointer-events: auto; /* Button ist klickbar */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 1000; /* Hoher z-index damit Button über Content liegt */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.chat-scroll-to-bottom-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-scroll-to-bottom-btn:active {
    transform: translateY(0);
}

.chat-scroll-to-bottom-btn span {
    display: block;
    line-height: 1;
}

.chat-sidebar-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chat-sidebar-message:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.chat-system-message {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--primary-color, #4a9eff);
    padding: 8px 12px;
    margin: 8px 0;
    opacity: 0;
    animation: fadeInSystemMessage 0.5s ease-in forwards;
    justify-content: center;
}

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

.chat-system-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: 300;
}

.chat-system-message-icon {
    font-size: 14px;
}

.chat-system-message-text {
    flex: 1;
    text-align: center;
    font-style: italic;
}

.chat-system-message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

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

.chat-sidebar-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.chat-sidebar-message-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color, #4a9eff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    flex-shrink: 0;
}

.chat-sidebar-message-content {
    flex: 1;
}

.chat-sidebar-message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-sidebar-message-sender {
    font-size: 12px;
    font-weight: 400;
    color: var(--primary-color, #4a9eff);
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-sidebar-message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-sidebar-message-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    word-wrap: break-word;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: 300;
}

.chat-sidebar-message-attachment {
    margin-top: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-sidebar-message-attachment a {
    color: var(--primary-color, #4a9eff);
    text-decoration: none;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-sidebar-message-attachment a:hover {
    text-decoration: underline;
}

/* Edit/Delete Buttons */
.chat-message-actions {
    display: none;
    gap: 4px;
    margin-left: auto;
}

.chat-sidebar-message:hover .chat-message-actions {
    display: flex;
}

.chat-message-edit-btn,
.chat-message-delete-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    transition: color 0.2s;
    line-height: 1;
}

.chat-message-edit-btn:hover {
    color: var(--primary-color, #4a9eff);
}

.chat-message-delete-btn:hover {
    color: rgba(211, 47, 47, 0.8);
}

.chat-message-edited {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    margin-left: 4px;
}

/* Verbesserte Datei-Anzeige */
.chat-attachment-image img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-attachment-image img:hover {
    transform: scale(1.02);
}

.chat-attachment-info {
    margin-top: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.chat-attachment-info a {
    color: var(--primary-color, #4a9eff);
    text-decoration: none;
}

.chat-attachment-info a:hover {
    text-decoration: underline;
}

.chat-attachment-audio audio {
    width: 100%;
    max-width: 400px;
    height: 32px;
    margin-top: 4px;
}

.chat-attachment-video video {
    max-width: 400px;
    max-height: 300px;
    border-radius: 4px;
}

/* Attachment Preview */
.chat-attachment-preview {
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 8px;
    overflow: hidden;
}

.chat-attachment-preview img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 0 auto;
}

.chat-attachment-preview img:hover {
    transform: scale(1.02);
}

.chat-attachment-preview video {
    display: block;
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    cursor: pointer;
}

.chat-attachment-preview iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 4px;
    background: #fff;
}

/* PDF Controls */
.chat-pdf-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 4px 4px;
    margin-top: -4px;
}

.chat-pdf-btn {
    background: var(--primary-color, #4a9eff);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    min-width: 36px;
}

.chat-pdf-btn:hover {
    background: var(--primary-color-hover, #3a8eef);
}

.chat-attachment-save {
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.8);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background 0.2s;
    margin-left: 8px;
}

.chat-attachment-save:hover {
    background: rgba(76, 175, 80, 1);
}

.chat-pdf-page-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    min-width: 80px;
    text-align: center;
}

/* Chat Preview Modal */
.chat-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.chat-preview-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid var(--primary-color, #4a9eff);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.chat-preview-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.chat-preview-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    transition: color 0.2s;
}

.chat-preview-modal-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.chat-preview-modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-preview-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.chat-preview-modal-body video {
    max-width: 100%;
    max-height: 100%;
}

.chat-preview-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Bild-Modal */
.chat-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.chat-image-modal button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-image-modal button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-sidebar-input-area {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    box-sizing: border-box;
}

.chat-sidebar-input-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0;
    transition: all 0.2s;
}

.chat-sidebar-input-wrapper:focus-within {
    border-color: var(--primary-color, #4a9eff);
    background: rgba(255, 255, 255, 0.08);
}

.chat-sidebar-attach-btn {
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.chat-sidebar-attach-btn:hover {
    color: var(--primary-color, #4a9eff);
}

.chat-sidebar-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px; /* Mindestens 16px um iOS-Zoom zu verhindern */
    font-weight: 300;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    outline: none;
}

.chat-sidebar-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    min-width: fit-content;
}

.chat-selected-files {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    max-height: 150px;
    overflow-y: auto;
}

.chat-selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.chat-selected-file-item:last-child {
    margin-bottom: 0;
}

.chat-selected-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-selected-file-size {
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

.chat-selected-file-remove {
    margin-left: 8px;
    background: transparent;
    border: none;
    color: rgba(244, 67, 54, 0.8);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    transition: color 0.2s;
}

.chat-selected-file-remove:hover {
    color: #f44336;
}

.chat-upload-progress {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-upload-progress-item {
    margin-bottom: 8px;
}

.chat-upload-progress-item:last-child {
    margin-bottom: 0;
}

.chat-upload-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.chat-upload-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.chat-upload-progress-bar-fill {
    height: 100%;
    background: var(--primary-color, #4a9eff);
    transition: width 0.3s;
    border-radius: 2px;
}

.chat-sidebar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 300;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
    white-space: nowrap;
}

.chat-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color, #4a9eff);
    color: rgba(255, 255, 255, 0.9);
}

.chat-sidebar-btn-send {
    background: var(--primary-color, #4a9eff);
    border-color: var(--primary-color, #4a9eff);
    color: #fff;
}

.chat-sidebar-btn-send:hover {
    background: #3a8eef;
    border-color: #3a8eef;
}

.chat-sidebar-btn-upload {
    cursor: pointer;
}

/* Scrollbar Styling */
.chat-sidebar-content::-webkit-scrollbar,
.chat-sidebar-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-sidebar-content::-webkit-scrollbar-track,
.chat-sidebar-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.chat-sidebar-content::-webkit-scrollbar-thumb,
.chat-sidebar-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-sidebar-content::-webkit-scrollbar-thumb:hover,
.chat-sidebar-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Benutzerdefinierter Audio-Player (für Chat) - Corporate Design */
.custom-audio-player {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 4px;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.audio-player-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.audio-player-icon {
    font-size: 12px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
}

.audio-player-info {
    flex: 1;
    min-width: 0;
}

.audio-player-name {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    word-break: break-word;
    line-height: 1.3;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.audio-player-size {
    display: block;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
    font-weight: 300;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.audio-player-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.audio-player-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color, #4a9eff);
    color: var(--primary-color, #4a9eff);
}

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

.audio-player-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.audio-player-progress-bar {
    width: 100%;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-player-progress {
    height: 100%;
    background: var(--primary-color, #4a9eff);
    border-radius: 1px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-player-time {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 300;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.audio-player-current {
    font-weight: 300;
}

.audio-player-separator {
    color: rgba(255, 255, 255, 0.25);
}

.audio-player-duration {
    color: rgba(255, 255, 255, 0.35);
}

/* Fullpage Chat Styles */
.chat-fullpage-messages-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-fullpage-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Fullpage Messages verwenden die gleichen Styles wie Sidebar Messages */
.chat-fullpage-messages .chat-sidebar-message {
    padding: 12px 15px;
    margin-bottom: 10px;
}

/* Responsive - Mobile & Tablet */
@media (max-width: 1024px) {
    .chat-sidebar {
        width: 100%;
        height: 100vh;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .chat-sidebar.maximized {
        width: 100% !important;
        height: 100vh !important;
        left: 0 !important;
        bottom: 0 !important;
        border-radius: 0;
    }
    
    .chat-sidebar-left,
    .chat-sidebar-right {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 10;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .chat-sidebar-left {
        left: 0;
        width: 70% !important;
        max-width: 300px;
    }
    
    .chat-sidebar-right {
        right: 0;
        width: 70% !important;
        max-width: 300px;
    }
    
    .chat-sidebar-left.hidden,
    .chat-sidebar-right.hidden {
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden;
    }
    
    .chat-sidebar-main {
        width: 100%;
    }
}

/* iPhone & kleine Mobile Geräte */
@media (max-width: 480px) {
    .chat-sidebar {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height für Mobile */
    }
    
    .chat-sidebar-header {
        padding: 10px 12px;
    }
    
    .chat-sidebar-title {
        font-size: 13px;
    }
    
    .chat-sidebar-left,
    .chat-sidebar-right {
        width: 85% !important;
        max-width: 280px;
    }
    
    .chat-sidebar-input-area {
        padding: 8px 12px;
    }
    
    .chat-sidebar-input {
        font-size: 16px; /* Verhindert iOS-Zoom */
        padding: 10px 12px;
    }
    
    .chat-sidebar-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* iPad & Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .chat-sidebar {
        height: 85vh;
        height: 85dvh;
    }
    
    .chat-sidebar-left,
    .chat-sidebar-right {
        width: 250px !important;
    }
}

/* Sehr kleine Geräte */
@media (max-width: 360px) {
    .chat-sidebar-left,
    .chat-sidebar-right {
        width: 90% !important;
        max-width: 260px;
    }
    
    .chat-sidebar-header-actions {
        gap: 4px;
    }
    
    .chat-sidebar-maximize,
    .chat-sidebar-close {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
}

/* Landscape Mode auf Mobile */
@media (max-width: 1024px) and (orientation: landscape) {
    .chat-sidebar {
        height: 100vh;
        height: 100dvh;
    }
    
    .chat-sidebar-left,
    .chat-sidebar-right {
        width: 200px !important;
    }
}

