/* =============================================================================
   DATEI: /assets/css/style.css
   ============================================================================= */
/* iOS Viewport Fix */
:root {
    --viewport-height: 100vh;
}

@supports (-webkit-touch-callout: none) {
    :root {
        --viewport-height: -webkit-fill-available;
    }
}

html,
body {
    height: var(--viewport-height);
    overflow: hidden;
}


:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.screen {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ==================== INSTALL SCREEN ==================== */
.install-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.install-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    animation: pulse-bg 10s ease-in-out infinite;
}

@keyframes pulse-bg {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.install-hero {
    text-align: center;
    z-index: 1;
    margin-bottom: 50px;
}

@media (max-width: 850px) {
    .install-hero {
        margin-bottom: 25px;
    }
}

.logo-animated {
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(16, 185, 129, 0.4));
    margin-bottom: 30px;
}

.logo-animated svg {
    width: 120px;
    height: 120px;
}

@media (max-width: 850px) {
    .logo-animated svg {
        width: 80px;
        height: 80px;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.install-title {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -2px;
}

@media (max-width: 850px) {
    .install-title {
        font-size: 36px;
    }
}

.install-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

@media (max-width: 850px) {
    .install-subtitle {
        font-size: 14px;
    }
}

.install-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    max-width: 800px;
    z-index: 1;
}

@media (max-width: 850px) {
    .install-features {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
}

.feature-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 850px) {
    .feature-card {
        padding: 15px 12px;
        border-radius: 12px;
    }
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.2);
}

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

@media (max-width: 850px) {
    .feature-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

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

@media (max-width: 850px) {
    .feature-card h3 {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .feature-card p {
        font-size: 12px;
    }
}

.install-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    z-index: 1;
}

.btn-install,
.btn-skip {
    padding: 18px 40px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 850px) {

    .btn-install,
    .btn-skip {
        padding: 14px 30px;
        font-size: 16px;
    }
}

.btn-install {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.btn-install:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.btn-skip {
    background: rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-skip:hover {
    background: var(--bg-tertiary);
    transform: translateY(-3px);
}

.install-info {
    margin-top: 30px;
    text-align: center;
    z-index: 1;
}

.info-text {
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ==================== AUTH SCREEN ==================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    overflow-y: auto;
}

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

.logo-small {
    filter: drop-shadow(0 10px 20px rgba(16, 185, 129, 0.3));
    margin-bottom: 20px;
}

.auth-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

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

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(30, 41, 59, 0.5);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 12px 30px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.auth-tab {
    display: none;
    width: 100%;
    max-width: 480px;
}

.auth-tab.active {
    display: block;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px var(--shadow);
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.card-description.warning {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid var(--warning);
}

.success-animation {
    text-align: center;
    margin-bottom: 30px;
}

@media (max-width: 850px) {
    .success-animation {
        margin-bottom: 15px;
    }
}

.checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.token-container {
    background: var(--bg-tertiary);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.token-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    animation: shimmer 2s infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

.token-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary-light);
    word-break: break-all;
    line-height: 1.6;
    user-select: all;
    position: relative;
    z-index: 1;
}

.token-container.small {
    padding: 15px;
}

.token-container.small .token-value {
    font-size: 12px;
}

.btn-icon-only {
    padding: 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--primary);
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.btn-icon-only:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.success-message {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    margin-bottom: 25px;
}

.input-modern {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-modern::placeholder {
    color: var(--text-tertiary);
}

.input-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
    padding-left: 4px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.btn-icon {
    font-size: 20px;
}

/* ==================== MAIN SCREEN ==================== */
.main-layout {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

.sidebar {
    width: 380px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.user-info {
    flex: 1;
}

.username {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-status {
    font-size: 13px;
    color: var(--success);
}

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

.icon-button {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button svg {
    color: white;
}

.icon-button:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.sidebar-search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
}

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

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

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.welcome-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.welcome-icon {
    font-size: 120px;
    opacity: 0.3;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

.welcome-view h2 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 15px;
}

.welcome-view p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

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

.settings-group:last-child {
    border-bottom: none;
}

.settings-group h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-family: inherit;
}

/* ==================== GROUP STYLES ==================== */
.contact-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

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

.contact-checkbox,
.add-member-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.group-member-item {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== PENDING REQUESTS ==================== */
.pending-section {
    padding: 20px;
    background: rgba(16, 185, 129, 0.05);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.request-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.request-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 700;
}

.request-info {
    flex: 1;
}

.request-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.request-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.request-actions {
    display: flex;
    gap: 10px;
}

.request-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.request-accept {
    background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
    color: white;
}

.request-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.request-reject {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.request-reject:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
}

/* ==================== RESPONSIVE ==================== */
.mobile-back-button {
    display: none;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 10px 20px;
    transition: all 0.3s;
}

.mobile-back-button:hover {
    background: var(--bg-secondary);
    transform: translateX(-5px);
}

.chat-back-btn {
    border: none;
    height: 30px;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-back-btn:hover {
    background: rgba(51, 65, 85, 0.5);
}

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



/* =============================================================================
   Media Embeds & Links CSS - Füge dies zu deiner style.css hinzu
   ============================================================================= */

/* Anklickbare Links in Nachrichten */
.message-link {
    color: #60a5fa;
    text-decoration: none;
    word-break: break-all;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
}

.message-link:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

/* Base Media Embed Container */
.media-embed {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.media-embed iframe {
    display: block;
    background: transparent;
}

/* YouTube Embed */
.youtube-embed {
    background: transparent;
}

.youtube-embed iframe {
    width: 100%;
    height: 280px;
    border: none;
    display: block;
    background: #000;
}

@media (max-width: 850px) {
    .youtube-embed iframe {
        height: 200px;
    }
}

/* Twitter/X Embed mit FxEmbed */
.twitter-embed {
    max-width: 550px;
    background: transparent;
}

.twitter-embed iframe {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
    background: transparent;
}

/* Bluesky Embed mit FxEmbed */
.bluesky-embed {
    max-width: 550px;
    background: transparent;
}

.bluesky-embed iframe {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
    background: transparent;
}

/* Reddit Embed */
.reddit-embed {
    max-width: 650px;
    background: transparent;
}

.reddit-embed iframe {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
    background: transparent;
}

/* Instagram Embed */
.instagram-embed {
    max-width: 550px;
    background: transparent;
}

.instagram-embed iframe {
    width: 100%;
    min-height: 650px;
    border: none;
    display: block;
    background: transparent;
}

/* TikTok Embed */
.tiktok-embed {
    max-width: 550px;
    background: transparent;
}

.tiktok-embed iframe {
    width: 100%;
    min-height: 750px;
    border: none;
    display: block;
    background: transparent;
}

/* Spotify Embed */
.spotify-embed iframe {
    width: 100%;
    height: 152px;
    border: none;
    display: block;
}

.spotify-embed.album iframe,
.spotify-embed.playlist iframe {
    height: 352px;
}

/* Vimeo Embed */
.vimeo-embed iframe {
    width: 100%;
    height: 280px;
    border: none;
    display: block;
}

@media (max-width: 850px) {
    .vimeo-embed iframe {
        height: 200px;
    }
}

/* Twitch Embed */
.twitch-embed iframe {
    width: 100%;
    height: 280px;
    border: none;
    display: block;
}

@media (max-width: 850px) {
    .twitch-embed iframe {
        height: 200px;
    }
}

/* SoundCloud Embed */
.soundcloud-embed iframe {
    width: 100%;
    height: 166px;
    border: none;
    display: block;
}

/* Loading State für Embeds - DEAKTIVIERT */
/* .media-embed::before wurde entfernt - siehe oben */

/* Responsive Embeds */
@media (max-width: 850px) {
    .media-embed {
        margin-top: 8px;
    }

    .twitter-embed,
    .instagram-embed,
    .tiktok-embed {
        max-width: 100%;
    }
}

/* Embed Error State */
.media-embed-error {
    padding: 20px;
    text-align: center;
    color: var(--danger);
    font-size: 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    margin-top: 12px;
}

/* Link Preview (Optional - für zukünftige Erweiterungen) */
.link-preview {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.link-preview-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
}

.link-preview-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.link-preview-domain {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* Play Button Overlay für Video-Embeds */
.video-embed-overlay {
    position: relative;
    cursor: pointer;
}

.video-embed-overlay::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: all 0.3s;
    pointer-events: none;
}

.video-embed-overlay:hover::after {
    background: var(--primary);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Smooth Loading Animation */
@keyframes embed-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-embed {
    animation: embed-fade-in 0.3s ease;
}

/* Dark Mode Optimierung für Embeds */
.media-embed iframe {
    color-scheme: dark;
}

/* Sicherheitshinweis für externe Inhalte */
.embed-disclaimer {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

/* Hover-Effekte für interaktive Embeds */
.media-embed:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Aspect Ratio Container für responsive Videos */
.embed-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.embed-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Compact Mode für kleinere Embeds */
.media-embed.compact iframe {
    height: 180px;
}

@media (max-width: 850px) {
    .media-embed.compact iframe {
        height: 140px;
    }
}

/* Multi-Link Handling */
.message-links-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* Error Boundary für fehlgeschlagene Embeds */
.embed-error {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px dashed var(--danger);
    border-radius: 12px;
    text-align: center;
    color: var(--danger);
    font-size: 13px;
}

.embed-error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Thumbnail für lazy-loaded Videos */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.video-thumbnail:hover::before {
    background: rgba(0, 0, 0, 0.5);
}

.video-thumbnail-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(16, 185, 129, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    transition: all 0.3s;
    z-index: 2;
}

.video-thumbnail:hover .video-thumbnail-play {
    transform: translate(-50%, -50%) scale(1.15);
    background: var(--primary);
}

/* Skeleton Loader für Embeds während des Ladens */
.embed-skeleton {
    width: 100%;
    height: 280px;
    background: linear-gradient(90deg,
            rgba(51, 65, 85, 0.5) 0%,
            rgba(71, 85, 105, 0.5) 50%,
            rgba(51, 65, 85, 0.5) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 12px;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* Badge für Embed-Typ */
.embed-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

/* Accessibility: Focus States */
.message-link:focus,
.media-embed:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .media-embed {
        page-break-inside: avoid;
    }

    .message-link {
        color: #000;
        text-decoration: underline;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .message-link {
        border-bottom-width: 2px;
    }

    .media-embed {
        border: 2px solid var(--primary);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .media-embed,
    .message-link,
    .video-thumbnail-play,
    .embed-skeleton {
        animation: none;
        transition: none;
    }

    .media-embed:hover {
        transform: none;
    }
}










/* =============================================================================
   NEUE SETTINGS STYLES 
   ============================================================================= */

/* Settings Modal Fullscreen (unter 850px) */
.settings-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    /* Initiale Opacity für Fade-In */
    opacity: 0;
    animation: modalFadeIn 0.3s ease forwards;
}

@media (min-width: 851px) {
    .settings-fullscreen {
        max-width: 600px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Modal Fade In Animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Settings Header */
.settings-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    /* Header Animation */
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDownFade 0.4s ease 0.1s forwards;
}

.settings-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.settings-header .modal-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

/* Settings Content */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 40px;
    /* Initial Hidden für staggered Animation */
    opacity: 0;
    animation: fadeInContent 0.5s ease 0.2s forwards;
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Loading State für Settings */
.settings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.settings-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.settings-loading-text {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Settings Sections - Staggered Animation */
.settings-section {
    margin-bottom: 25px;
    /* Initial State */
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeSection 0.5s ease forwards;
}

.settings-section:last-child {
    margin-bottom: 0;
}

/* Staggered Delays für jede Section */
.settings-section:nth-child(1) {
    animation-delay: 0.3s;
}

.settings-section:nth-child(2) {
    animation-delay: 0.4s;
}

.settings-section:nth-child(3) {
    animation-delay: 0.5s;
}

.settings-section:nth-child(4) {
    animation-delay: 0.6s;
}

.settings-section:nth-child(5) {
    animation-delay: 0.7s;
}

/* Profile Section */
.profile-section {
    margin-bottom: 30px;
}

.profile-display {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.profile-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.profile-display:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.profile-display:hover::before {
    transform: translateX(100%);
}

.profile-display:active {
    transform: translateY(0);
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    position: relative;
    z-index: 1;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}

.profile-display:hover .profile-avatar {
    transform: scale(1.05);
}

.profile-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-hint {
    font-size: 14px;
    color: var(--primary-light);
    font-weight: 500;
}

.profile-arrow {
    color: var(--primary);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.profile-display:hover .profile-arrow {
    transform: translateX(5px);
}

/* Settings Item */
.settings-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.settings-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.3s;
}

.settings-item:hover .settings-item-icon {
    transform: scale(1.1);
    background: rgba(16, 185, 129, 0.25);
}

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

.settings-item-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-item-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.settings-toggle {
    flex-shrink: 0;
}

.toggle-switch {
    width: 56px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 100px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch.active {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-slider {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

/* Section Header */
.settings-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 4px;
}

.settings-section-header svg {
    color: var(--primary);
    transition: transform 0.3s;
}

.settings-section:hover .settings-section-header svg {
    transform: scale(1.1);
}

.settings-section-header span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Account Info Box */
.account-info-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
}

.account-info-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}

.account-info-item:hover {
    padding-left: 5px;
}

.account-info-item:first-child {
    padding-top: 0;
}

.account-info-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.account-info-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-info-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Token Box */
.token-box {
    background: rgba(16, 185, 129, 0.05);
    border-radius: 12px;
    padding: 15px !important;
    margin-top: 15px;
}

.token-display-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.token-display-box:hover {
    border-color: var(--primary);
}

.token-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary-light);
    word-break: break-all;
    line-height: 1.5;
    user-select: all;
    transition: all 0.3s;
}

/* Token Visibility Animation */
.token-text.revealing {
    animation: revealToken 0.5s ease;
}

@keyframes revealToken {
    0% {
        opacity: 0;
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        filter: blur(0);
    }
}

.token-text.hiding {
    animation: hideToken 0.3s ease;
}

@keyframes hideToken {
    0% {
        opacity: 1;
        filter: blur(0);
    }

    100% {
        opacity: 0;
        filter: blur(5px);
    }
}

.token-action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.token-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

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

.token-warning {
    font-size: 12px;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

/* Danger Button Outline */
.btn-danger-outline {
    width: 100%;
    padding: 16px 24px;
    border: 2px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

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

/* Logout Button */
.btn-logout {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.btn-logout:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

/* Settings Footer */
.settings-footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
    text-align: center;
    opacity: 0;
    animation: fadeInFooter 0.5s ease 0.8s forwards;
}

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

.copyright {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== ANIMATIONS ==================== */

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInContent {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpFadeSection {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInFooter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

/* Success Toast */
.toast-success {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    z-index: 100000;
    animation: toastIn 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 850px) {
    .settings-content {
        padding: 15px;
    }

    .profile-name {
        font-size: 20px;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .settings-fullscreen,
    .settings-header,
    .settings-content,
    .settings-section,
    .settings-footer,
    .token-text,
    .profile-avatar,
    .settings-item-icon {
        animation: none !important;
    }

    .settings-section {
        opacity: 1;
        transform: none;
    }

    .settings-header,
    .settings-content,
    .settings-footer {
        opacity: 1;
        transform: none;
    }
}












/* =============================================================================
   CONTACT PROFILE & DISAPPEARING MESSAGES STYLES
   ============================================================================= */

/* Contact Profile Modal Fullscreen */
.contact-profile-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 851px) {
    .contact-profile-fullscreen {
        max-width: 600px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Contact Profile Header */
.contact-profile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-profile-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Contact Profile Content */
.contact-profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 40px;
}

.contact-profile-content::-webkit-scrollbar {
    width: 6px;
}

.contact-profile-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Contact Profile Section */
.contact-profile-section {
    margin-bottom: 25px;
}

/* Profile Hero Section */
.profile-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.contact-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    position: relative;
    z-index: 1;
    background-size: cover;
    background-position: center;
}

.contact-profile-name {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.contact-profile-status {
    font-size: 16px;
    color: var(--success);
    font-weight: 600;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.contact-profile-status::before {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Contact Profile Section Header */
.contact-profile-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 4px;
}

.contact-profile-section-header svg {
    color: var(--primary);
}

.contact-profile-section-header span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Disappearing Info Box */
.disappearing-info-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.disappearing-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.disappearing-text {
    flex: 1;
}

.disappearing-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.disappearing-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Disappearing Options */
.disappearing-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.disappearing-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.disappearing-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateX(5px);
}

.disappearing-option.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

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

.option-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.option-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.option-check {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.disappearing-option.active .option-check {
    background: var(--primary);
    border-color: var(--primary);
}

.disappearing-option .option-check svg {
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s;
}

.disappearing-option.active .option-check svg {
    opacity: 1;
    transform: scale(1);
}

.option-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.3s;
}

.disappearing-option:hover .option-arrow {
    transform: translateX(5px);
}

/* Custom Time Picker */
.custom-time-picker {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 25px;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.custom-time-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.close-custom-time {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-custom-time:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.time-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.time-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-input-wrapper label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.time-input {
    width: 80px;
    height: 60px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    font-family: inherit;
    transition: all 0.3s;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.time-input-separator {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 20px;
}

.custom-time-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.time-preset {
    padding: 10px 18px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--primary);
    border-radius: 10px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.time-preset:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Contact Action Button */
.contact-action-btn {
    width: 100%;
    padding: 16px 24px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.contact-action-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.contact-action-btn.danger {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

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

/* System Message in Chat */
.system-message {
    text-align: center;
    padding: 8px 16px;
    margin: 12px auto;
    max-width: 85%;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;

    /* Automatischer Zeilenumbruch */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;

    /* Flexbox für Icon + Text */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.system-message-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* Responsive für kleinere Bildschirme */
@media (max-width: 850px) {
    .system-message {
        max-width: 90%;
        padding: 6px 12px;
        font-size: 11px;
        margin: 10px auto;
    }

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

/* Für sehr kleine Bildschirme */
@media (max-width: 480px) {
    .system-message {
        max-width: 95%;
        padding: 6px 10px;
        font-size: 10px;
    }
}

/* Dark Mode Anpassung */
@media (prefers-color-scheme: dark) {
    .system-message {
        background: rgba(245, 158, 11, 0.08);
        border-color: rgba(245, 158, 11, 0.25);
    }
}



/* Clickable Profile Elements */
.chat-profile-clickable {
    cursor: pointer;
    transition: all 0.3s;
}

.chat-profile-clickable:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 850px) {
    .contact-profile-content {
        padding: 15px;
    }

    .profile-hero {
        padding: 30px 15px;
    }

    .contact-profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 48px;
    }

    .contact-profile-name {
        font-size: 28px;
    }

    .time-input {
        width: 70px;
        height: 50px;
        font-size: 24px;
    }
}



















@media (max-width: 850px) {
    .main-layout {
        overflow: hidden;
    }

    .sidebar {
        width: 100%;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 10;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(0);
        border-right: none;
    }

    .sidebar.mobile-hidden {
        transform: translateX(-100%);
        pointer-events: none;
    }

    .chat-area {
        width: 100%;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 20;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--bg-primary);
    }

    .chat-area.mobile-chat-hidden {
        transform: translateX(100%);
        pointer-events: none;
    }

    .chat-area.mobile-visible {
        transform: translateX(0);
        pointer-events: all;
    }

    .chat-back-btn {
        display: flex !important;
    }

    .install-features {
        grid-template-columns: 1fr;
    }

    .install-title {
        font-size: 42px;
    }

    .auth-title {
        font-size: 36px;
    }

    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 40px);
    }
}

@media (min-width: 851px) {
    .chat-back-btn {
        display: none !important;
    }

    .sidebar {
        width: 380px;
        position: relative;
        z-index: 1;
    }

    .chat-area {
        flex: 1;
        position: relative;
        z-index: 1;
        transform: none !important;
    }

    .chat-area.mobile-chat-hidden,
    .chat-area.mobile-visible {
        transform: none !important;
        pointer-events: all !important;
    }

    .sidebar.mobile-hidden {
        transform: none !important;
        pointer-events: all !important;
    }
}

















/* ==================== GLOBALE SCROLLBAR STYLES ==================== */

/* Für Webkit Browser (Chrome, Safari, Edge, Opera) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.6) 0%, rgba(5, 150, 105, 0.6) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* Für Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.6) rgba(15, 23, 42, 0.3);
}

/* ==================== SPEZIFISCHE BEREICHE ==================== */

/* Chat List Scrollbar */
.chat-list::-webkit-scrollbar {
    width: 6px;
}

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

.chat-list::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.4);
    border-radius: 10px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* Messages Container Scrollbar */
#messages-container::-webkit-scrollbar {
    width: 6px;
}

#messages-container::-webkit-scrollbar-track {
    background: transparent;
}

#messages-container::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 10px;
}

#messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.8);
}

/* Settings & Modal Scrollbars */
.settings-content::-webkit-scrollbar,
.contact-profile-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track,
.contact-profile-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 10px;
}

.settings-content::-webkit-scrollbar-thumb,
.contact-profile-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.5) 0%, rgba(5, 150, 105, 0.5) 100%);
    border-radius: 10px;
}

.settings-content::-webkit-scrollbar-thumb:hover,
.contact-profile-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8) 0%, rgba(5, 150, 105, 0.8) 100%);
}

/* Group Members Selection Scrollbars */
#group-members-selection::-webkit-scrollbar,
#add-members-selection::-webkit-scrollbar {
    width: 6px;
}

#group-members-selection::-webkit-scrollbar-track,
#add-members-selection::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 10px;
}

#group-members-selection::-webkit-scrollbar-thumb,
#add-members-selection::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.6);
    border-radius: 10px;
}

#group-members-selection::-webkit-scrollbar-thumb:hover,
#add-members-selection::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.9);
}

/* Auth Screen Scrollbar */
.auth-wrapper::-webkit-scrollbar {
    width: 6px;
}

.auth-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.auth-wrapper::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.4);
    border-radius: 10px;
}

.auth-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* ==================== CORNER FIX ==================== */

/* Scrollbar Corner (wenn horizontal + vertikal) */
::-webkit-scrollbar-corner {
    background: transparent;
}

/* ==================== HOVER ANIMATION ==================== */

/* Smooth Transitions */
* {
    scroll-behavior: smooth;
}

/* Scrollbar erscheint bei Hover (optional) */
.chat-list,
#messages-container,
.settings-content,
.contact-profile-content {
    overflow-y: auto;
    overflow-x: hidden;
}

/* ==================== MOBILE OPTIMIERUNG ==================== */

@media (max-width: 850px) {

    /* Dünnere Scrollbars auf Mobile */
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    .chat-list::-webkit-scrollbar,
    #messages-container::-webkit-scrollbar,
    .settings-content::-webkit-scrollbar,
    .contact-profile-content::-webkit-scrollbar {
        width: 4px;
    }
}

/* ==================== DARK MODE OPTIMIERUNG ==================== */

@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: rgba(15, 23, 42, 0.5);
    }

    ::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.7) 0%, rgba(5, 150, 105, 0.7) 100%);
    }
}

/* ==================== SCROLLBAR GLOW EFFEKT (optional) ==================== */

/* Leuchtender Effekt beim Scrollen */
@keyframes scrollbar-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    }
}

::-webkit-scrollbar-thumb:active {
    animation: scrollbar-glow 0.5s ease-in-out;
}











/* =============================================================================
   CHAT LIST STYLES
   ============================================================================= */

/* Chat Item - Neue Struktur */
.chat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0;
    /* Entferne altes margin */
    position: relative;

    /* NEU: Trennlinie unten */
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

/* Letzter Chat braucht keinen Strich */
.chat-item:last-child {
    border-bottom: none;
}

/* Bei Hover wird Trennlinie heller */
.chat-item:hover {
    background: var(--bg-tertiary);
    border-bottom-color: rgba(51, 65, 85, 0.7);
}

/* Bei Hover wird auch die Linie vom nächsten Element angepasst */
.chat-item:hover+.chat-item {
    border-top-color: transparent;
}

/* Unread Chat Highlight - MIT angepasster Border */
.chat-item-unread {
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

.chat-item-unread:hover {
    background: rgba(16, 185, 129, 0.12);
    border-bottom-color: rgba(16, 185, 129, 0.4);
}

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

/* Unread Chat Highlight */
.chat-item-unread {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.chat-item-unread:hover {
    background: rgba(16, 185, 129, 0.12);
}

/* Chat Avatar */
.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    flex-shrink: 0;
}

/* Chat Content Container */
.chat-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Chat Header - Name + Time */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.chat-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
    margin-left: auto;
}

.chat-item-unread .chat-time {
    color: var(--primary);
    font-weight: 600;
}

/* Chat Preview Line - Message + Badge */
.chat-preview-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-last-message {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.chat-item-unread .chat-last-message {
    color: var(--text-primary);
    font-weight: 500;
}

/* Unread Badge */
.chat-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
    }
}

/* No Chats Message */
.no-chats-message {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .chat-item {
        padding: 12px;
        gap: 12px;
    }

    .chat-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

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

    .chat-time {
        font-size: 11px;
    }

    .chat-last-message {
        font-size: 13px;
    }

    .chat-unread-badge {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Smooth Transitions */
.chat-item,
.chat-unread-badge,
.chat-time {
    transition: all 0.3s ease;
}

/* Active State */
.chat-item:active {
    transform: scale(0.98);
}

/* Focus State für Accessibility */
.chat-item:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Sliding Animation für neue Chats */
@keyframes slide-in-chat {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-item {
    animation: slide-in-chat 0.3s ease;
}









/* Neuer Chat erscheint */
.chat-item-new {
    animation: chatSlideIn 0.3s ease;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Chat wird entfernt */
.chat-item-remove {
    animation: chatSlideOut 0.3s ease forwards;
}

@keyframes chatSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 100px;
        margin-bottom: 8px;
    }

    to {
        opacity: 0;
        transform: translateX(-20px);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Badge verschwindet smooth */
.badge-fade-out {
    animation: badgeFadeOut 0.3s ease forwards;
}

@keyframes badgeFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Unread Status Change - Smooth Transition */
.chat-item {
    transition: background 0.3s ease, border 0.3s ease;
}

.chat-item-unread {
    animation: unreadPulse 2s ease-in-out infinite;
}

@keyframes unreadPulse {

    0%,
    100% {
        background: rgba(16, 185, 129, 0.08);
    }

    50% {
        background: rgba(16, 185, 129, 0.12);
    }
}

/* Content Updates - Smooth */
.chat-last-message,
.chat-time,
.chat-name {
    transition: color 0.2s ease;
}

/* Badge Count Change Animation */
.chat-unread-badge {
    animation: badge-pulse 2s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.chat-unread-badge:active {
    transform: scale(0.9);
}

/* Initial Load Animation - Staggered */
.chat-item {
    animation: chatSlideIn 0.3s ease both;
}

/* Hover bleibt smooth */
.chat-item:hover {
    transform: translateX(2px);
    transition: all 0.2s ease;
}

/* Loading State (optional) */
.chat-list-loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes chat-list-fade {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .chat-item-new,
    .chat-item-remove,
    .badge-fade-out,
    .chat-item {
        animation: none !important;
    }

    .chat-item,
    .chat-last-message,
    .chat-time,
    .chat-unread-badge {
        transition: none !important;
    }
}






/* =============================================================================
   CHAT SEARCH STYLES
   ============================================================================= */

/* Search Results Header */
.search-results-header {
    padding: 15px 20px;
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.search-results-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.search-clear-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-clear-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

/* Search Highlight */
.search-highlight {
    background: rgba(245, 158, 11, 0.3);
    color: var(--warning);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Search Match Badge */
.search-match-badge {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    flex-shrink: 0;
}

/* No Results */
.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.no-results-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 20px;
}

.no-results-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.no-results-text {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 300px;
    line-height: 1.5;
}

/* Search Input Enhancement */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-input:not(:placeholder-shown) {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

/* Profile Image Transition */
.chat-avatar {
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chat-avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(16, 185, 129, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.chat-avatar:hover::after {
    opacity: 1;
}

/* Loading State für Avatar */
.chat-avatar.loading {
    animation: avatarPulse 1.5s ease-in-out infinite;
}

@keyframes avatarPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .search-results-header {
        padding: 12px 15px;
        border-radius: 8px;
    }

    .search-results-count {
        font-size: 13px;
    }

    .search-match-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .no-results-icon {
        font-size: 48px;
    }

    .no-results-title {
        font-size: 18px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .search-results-header,
    .search-no-results,
    .chat-avatar {
        animation: none !important;
    }
}










/* =============================================================================
   REQUESTS BADGE & MODAL STYLES
   ============================================================================= */

/* Requests Badge - unten in Sidebar */
.requests-badge {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-top: 2px solid rgba(16, 185, 129, 0.3);
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.3s ease;
    z-index: 5;
}

.requests-badge:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
    transform: translateY(-2px);
    box-shadow: 0 -4px 20px rgba(16, 185, 129, 0.2);
}

.requests-badge:active {
    transform: translateY(0);
}

.requests-badge-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.requests-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: pulse-icon 2s ease-in-out infinite;
}

.requests-badge-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke: white;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.requests-badge-text {
    flex: 1;
    min-width: 0;
}

.requests-badge-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.requests-badge-count {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.requests-badge-arrow {
    color: var(--primary);
    flex-shrink: 0;
    transition: transform 0.3s;
}

.requests-badge:hover .requests-badge-arrow {
    transform: translateX(5px);
}

/* Requests Fullscreen Modal */
.requests-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 851px) {
    .requests-fullscreen {
        max-width: 650px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Requests Header */
.requests-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.requests-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Requests Content */
.requests-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 40px;
}

.requests-content::-webkit-scrollbar {
    width: 6px;
}

.requests-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Request Item - Enhanced */
.request-item-modal {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInRequest 0.3s ease both;
}

.request-item-modal:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes slideInRequest {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.request-item-modal:nth-child(1) {
    animation-delay: 0.05s;
}

.request-item-modal:nth-child(2) {
    animation-delay: 0.1s;
}

.request-item-modal:nth-child(3) {
    animation-delay: 0.15s;
}

.request-item-modal:nth-child(4) {
    animation-delay: 0.2s;
}

.request-item-modal:nth-child(5) {
    animation-delay: 0.25s;
}

.request-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.request-item-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.request-item-avatar span,
.request-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    font-weight: 700;
    color: white;
}

/* Wenn Hintergrundbild vorhanden, verstecke Text */
.request-item-avatar[style*="background-image"] span,
.request-avatar[style*="background-image"] {
    font-size: 0;
}



.request-item-info {
    flex: 1;
    min-width: 0;
}

.request-item-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.request-item-username {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.request-item-date {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.request-item-date svg {
    width: 14px;
    height: 14px;
}

.request-item-actions {
    display: flex;
    gap: 10px;
}

.request-btn-accept,
.request-btn-reject {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.request-btn-accept {
    background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.request-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.request-btn-reject {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.request-btn-reject:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: translateY(-2px);
}

.request-btn-accept:active,
.request-btn-reject:active {
    transform: translateY(0);
}

/* No Requests Message */
.no-requests-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.no-requests-icon {
    font-size: 80px;
    opacity: 0.3;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.no-requests-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.no-requests-text {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.6;
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .requests-badge {
        padding: 12px 15px;
    }

    .requests-badge-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .requests-badge-title {
        font-size: 13px;
    }

    .requests-badge-count {
        font-size: 16px;
    }

    .requests-content {
        padding: 15px;
    }

    .request-item-modal {
        padding: 16px;
    }

    .request-item-avatar {
        width: 54px;
        height: 54px;
        font-size: 24px;
    }

    .request-item-name {
        font-size: 17px;
    }

    .request-btn-accept,
    .request-btn-reject {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .requests-badge,
    .request-item-modal,
    .requests-badge-icon,
    .no-requests-icon {
        animation: none !important;
    }

    .requests-badge:hover,
    .request-item-modal:hover,
    .request-btn-accept:hover,
    .request-btn-reject:hover {
        transform: none !important;
    }
}

#messages-container {
    scroll-behavior: auto !important;
}


/* =============================================================================
   SEND MESSAGE BUTTON
   ============================================================================= */

.send-message-btn {
    position: relative;
    overflow: hidden;
}

.send-message-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.send-message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.send-message-btn:hover::before {
    transform: translateX(100%);
}

.send-message-btn:active {
    transform: translateY(0) scale(0.95);
}

.send-message-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Animation beim Senden */
@keyframes sendPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.send-message-btn.sending {
    animation: sendPulse 0.3s ease;
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .send-message-btn {
        padding: 14px 20px;
    }

    .send-message-btn svg {
        width: 20px;
        height: 20px;
    }
}


/* =============================================================================
   ATTACHMENT BUTTON
   ============================================================================= */

.attachment-btn {
    position: relative;
    overflow: hidden;
}

.attachment-btn:hover {
    background: var(--bg-tertiary) !important;
    transform: scale(1.05);
}

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

.attachment-btn svg {
    transition: all 0.3s;
}

.attachment-btn:hover svg {
    transform: rotate(15deg);
}

/* Image Preview in Messages */
.message-image-preview {
    max-width: 300px !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    background: var(--bg-tertiary);
}

.message-image-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Stelle sicher dass Container nicht abschneidet */
.chat-item img,
.message-image-preview {
    max-width: 100%;
    height: auto;
    vertical-align: top;
    /* Entfernt Whitespace unter Bild */
}

/* Loading Spinner Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .attachment-btn {
        padding: 14px;
    }

    .attachment-btn svg {
        width: 20px;
        height: 20px;
    }

    .message-image-preview {
        max-width: 250px;
        max-height: 250px;
    }
}

/* =============================================================================
   IMAGE LIGHTBOX ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Image Preview Hover Effect */
.message-image-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Lightbox Mobile Optimization */
@media (max-width: 850px) {
    #image-lightbox button[style*="top: 20px"] {
        top: 10px !important;
        right: 10px !important;
        width: 44px !important;
        height: 44px !important;
    }

    #image-lightbox button[style*="bottom: 30px"] {
        bottom: 20px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    #image-lightbox img {
        max-width: 95% !important;
        max-height: 85vh !important;
    }
}


/* =============================================================================
   UPDATE NOTIFICATION & SCREEN
   ============================================================================= */

@keyframes slideUpNotification {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Update Notification Button Hover */
#update-notification button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Update Screen Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    #update-notification {
        bottom: 10px !important;
        padding: 14px 20px !important;
        flex-direction: column !important;
        text-align: center !important;
    }

    #update-notification button {
        width: 100%;
        margin-top: 10px;
    }
}

/* =============================================================================
   IMAGE SOURCE PICKER (Bottom Sheet)
   ============================================================================= */

.image-source-sheet {
    position: relative;
}

.image-source-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.source-option {
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.source-option:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.source-option:active {
    transform: translateX(3px) scale(0.98);
}

.source-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.source-content {
    flex: 1;
    text-align: left;
}

.source-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.source-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.3s;
}

.source-option:hover .source-arrow {
    transform: translateX(5px);
    color: var(--primary);
}

.cancel-btn:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Desktop Anpassung */
@media (min-width: 851px) {
    #image-source-picker {
        align-items: center;
        justify-content: center;
    }

    .image-source-sheet {
        border-radius: 24px !important;
        max-width: 450px;
        padding: 30px !important;
    }

    .image-source-sheet>div:first-child {
        display: none;
        /* Verstecke Handle auf Desktop */
    }
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .source-icon {
        width: 54px;
        height: 54px;
    }

    .source-icon svg {
        width: 28px;
        height: 28px;
    }

    .source-title {
        font-size: 17px;
    }

    .source-desc {
        font-size: 13px;
    }
}

/* Safe Area für iPhone mit Notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .image-source-sheet {
        padding-bottom: calc(30px + env(safe-area-inset-bottom)) !important;
    }
}




/* =============================================================================
   VERIFY CONTACT MODAL - SCHICKE VERSION
   ============================================================================= */

/* Verify Modal Fullscreen (unter 850px) */
.verify-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 851px) {
    .verify-fullscreen {
        max-width: 550px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Verify Header */
.verify-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.verify-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Verify Content */
.verify-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    padding-bottom: 40px;
}

.verify-content::-webkit-scrollbar {
    width: 6px;
}

.verify-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Profile Section */
.verify-profile-section {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}

.verify-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.verify-username {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

/* Info Box */
.verify-info-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.verify-info-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.verify-info-text {
    flex: 1;
}

.verify-info-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.verify-info-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Input Section */
.verify-input-section {
    margin-bottom: 30px;
}

.verify-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.verify-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.verify-input {
    flex: 1;
    padding: 16px 60px 16px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.verify-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.verify-input::placeholder {
    color: var(--text-tertiary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: normal;
}

.paste-token-btn {
    position: absolute;
    right: 8px;
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--primary);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paste-token-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

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

/* Actions */
.verify-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-verify-primary {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-verify-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-verify-primary:active {
    transform: translateY(-1px);
}

/* Animations */
@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .verify-content {
        padding: 20px 15px;
    }

    .verify-avatar {
        width: 90px;
        height: 90px;
        font-size: 42px;
    }

    .verify-username {
        font-size: 24px;
    }

    .verify-info-icon {
        font-size: 28px;
    }

    .btn-verify-primary {
        padding: 16px 24px;
    }
}



/* =============================================================================
   DATE SEPARATORS & PAGINATION STYLES 
   ============================================================================= */

/* Date Separator */
.date-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.date-separator::before,
.date-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.date-separator::before {
    left: 0;
}

.date-separator::after {
    right: 0;
}

.date-separator>div {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

/* No More Messages Indicator */
.no-more-messages {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
}

.no-more-messages>div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.no-more-messages>div:hover {
    background: rgba(30, 41, 59, 0.7);
}

/* Loading Older Messages */
#loading-older-messages {
    text-align: center;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 13px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Smooth Scroll for Messages Container */
#messages-container {
    scroll-behavior: auto;
    /* Wichtig für Pagination */
    overscroll-behavior: contain;
}

/* Animation für neue Datumstrennlinien */
.date-separator {
    animation: slideFadeIn 0.4s ease;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .date-separator {
        margin: 15px 0;
    }

    .date-separator>div {
        font-size: 11px;
        padding: 5px 12px;
    }

    .date-separator::before,
    .date-separator::after {
        width: 25%;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .date-separator,
    #loading-older-messages {
        animation: none;
    }
}





/* =============================================================================
   ADD CONTACT MODAL - FULLSCREEN STYLES
   ============================================================================= */

/* Add Contact Fullscreen Modal */
.add-contact-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 851px) {
    .add-contact-fullscreen {
        max-width: 550px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Add Contact Header */
.add-contact-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.add-contact-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Add Contact Content */
.add-contact-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    padding-bottom: 40px;
}

.add-contact-content::-webkit-scrollbar {
    width: 6px;
}

.add-contact-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Hero Section */
.add-contact-hero {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}

.add-contact-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.add-contact-hero h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.add-contact-hero p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Input Section */
.add-contact-input-section {
    margin-bottom: 25px;
}

.add-contact-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-contact-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.add-contact-input {
    flex: 1;
    padding: 16px 50px 16px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.add-contact-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.add-contact-input-wrapper .input-icon {
    position: absolute;
    right: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
    padding-left: 4px;
}

/* Info Box */
.add-contact-info-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    animation: slideDown 0.3s ease;
}

.info-box-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.info-box-text {
    flex: 1;
}

.info-box-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.info-box-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Token Display */
.token-display-section {
    margin-bottom: 25px;
    animation: slideDown 0.3s ease;
}

.token-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.token-display-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 2px solid var(--primary);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.token-display-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.token-display-box .token-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary-light);
    word-break: break-all;
    line-height: 1.6;
    user-select: all;
    position: relative;
    z-index: 1;
}

.token-copy-btn {
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--primary);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.token-copy-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

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

.token-warning {
    font-size: 12px;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

/* Actions */
.add-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-add-contact-primary {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-add-contact-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-add-contact-primary:active {
    transform: translateY(-1px);
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .add-contact-content {
        padding: 20px 15px;
    }

    .add-contact-icon {
        width: 80px;
        height: 80px;
    }

    .add-contact-icon svg {
        width: 60px;
        height: 60px;
    }

    .add-contact-hero h3 {
        font-size: 22px;
    }
}

/* =============================================================================
   CREATE GROUP MODAL - FULLSCREEN STYLES
   ============================================================================= */

/* Create Group Fullscreen Modal */
.create-group-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 851px) {
    .create-group-fullscreen {
        max-width: 650px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Create Group Header */
.create-group-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.create-group-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Create Group Content */
.create-group-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    padding-bottom: 40px;
}

.create-group-content::-webkit-scrollbar {
    width: 6px;
}

.create-group-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Hero Section */
.create-group-hero {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}

.create-group-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.create-group-hero h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.create-group-hero p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Group Input Section */
.create-group-input-section {
    margin-bottom: 30px;
}

.create-group-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.create-group-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.create-group-input {
    flex: 1;
    padding: 16px 50px 16px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.create-group-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.create-group-input-wrapper .input-icon {
    position: absolute;
    right: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Members Selection */
.create-group-members-section {
    margin-bottom: 30px;
}

.members-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 4px;
}

.members-section-header svg {
    color: var(--primary);
}

.members-section-header span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.members-selection-list {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
}

.members-selection-list::-webkit-scrollbar {
    width: 6px;
}

.members-selection-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Contact Select Item (wiederverwendet aus bestehenden Styles) */
.contact-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
}

.contact-select-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateX(5px);
}

.contact-select-item:last-child {
    margin-bottom: 0;
}

.contact-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Actions */
.create-group-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-create-group-primary {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-create-group-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-create-group-primary:active {
    transform: translateY(-1px);
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .create-group-content {
        padding: 20px 15px;
    }

    .create-group-icon {
        width: 80px;
        height: 80px;
    }

    .create-group-icon svg {
        width: 60px;
        height: 60px;
    }

    .create-group-hero h3 {
        font-size: 22px;
    }

    .members-selection-list {
        max-height: 300px;
    }
}

/* Animations */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}







/* =============================================================================
   GROUP PROFILE MODAL STYLES
   ============================================================================= */

/* Group Profile Fullscreen Modal */
.group-profile-fullscreen {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 851px) {
    .group-profile-fullscreen {
        max-width: 650px !important;
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
    }
}

/* Group Profile Header */
.group-profile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.group-profile-header h2 {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Group Profile Content */
.group-profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 40px;
}

.group-profile-content::-webkit-scrollbar {
    width: 6px;
}

.group-profile-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Group Profile Section */
.group-profile-section {
    margin-bottom: 25px;
}

/* Profile Hero */
.group-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    position: relative;
    z-index: 1;
    background-size: cover;
    background-position: center;
}

.group-profile-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Upload Group Image Button */
.upload-group-image-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 auto;
}

.upload-group-image-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* Group Profile Section Header */
.group-profile-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 4px;
}

.group-profile-section-header svg {
    color: var(--primary);
}

.group-profile-section-header span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Group Members List */
.group-members-list {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.group-members-list::-webkit-scrollbar {
    width: 6px;
}

.group-members-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.group-member-item-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s;
    animation: slideIn 0.3s ease both;
}

.group-member-item-profile:last-child {
    margin-bottom: 0;
}

.group-member-item-profile:hover {
    background: var(--bg-secondary);
    transform: translateX(3px);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    background-size: cover;
    background-position: center;
}

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

.member-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

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

.make-admin-btn,
.remove-member-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.make-admin-btn {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

.make-admin-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    transform: scale(1.1);
}

.remove-member-btn {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.remove-member-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* Mobile Optimierung */
@media (max-width: 850px) {
    .group-profile-content {
        padding: 15px;
    }

    .group-profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 48px;
    }

    .group-profile-name {
        font-size: 24px;
    }

    .upload-group-image-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .group-members-list {
        max-height: 300px;
    }

    .member-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .member-name {
        font-size: 15px;
    }

    .make-admin-btn,
    .remove-member-btn {
        width: 36px;
        height: 36px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .group-member-item-profile {
        animation: none !important;
    }

    .group-member-item-profile:hover,
    .make-admin-btn:hover,
    .remove-member-btn:hover,
    .upload-group-image-btn:hover {
        transform: none !important;
    }
}








/* =============================================================================
   PROFILE HERO SECTION FIX
   ============================================================================= */

.profile-hero {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.group-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    position: relative;
    z-index: 1;
    background-size: cover;
    background-position: center;
    border: 4px solid rgba(16, 185, 129, 0.2);
}

.group-profile-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.upload-group-image-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.upload-group-image-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.upload-group-image-btn:active {
    transform: translateY(0);
}

/* Mobile Optimierung für Profile Hero */
@media (max-width: 850px) {
    .profile-hero {
        padding: 25px 15px;
    }

    .group-profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 48px;
    }

    .group-profile-name {
        font-size: 24px;
    }

    .upload-group-image-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}








/* Chat Header Styles */
#chat-header-template {
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 2px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.chat-header-clickable {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chat-header-clickable:hover {
    background: rgba(16, 185, 129, 0.05);
}

.chat-header-avatar-img,
.chat-header-avatar-initial {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    border: 3px solid rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
    object-fit: cover;
}

.chat-header-avatar-img:hover,
.chat-header-avatar-initial:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.chat-header-avatar-initial {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    font-weight: 700;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    cursor: pointer;
}

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

@media (max-width: 850px) {
    #chat-header-template {
        padding: 15px;
    }

    .chat-header-avatar-img,
    .chat-header-avatar-initial {
        width: 45px;
        height: 45px;
    }

    .chat-header-info h3 {
        font-size: 18px;
    }
}


/* Chat Area darf Sidebar nicht überdecken auf Desktop */
@media (min-width: 851px) {
    .chat-area {
        position: relative !important;
        z-index: 1 !important;
    }

    .sidebar {
        position: relative !important;
        z-index: 2 !important;
    }

    .chat-area.mobile-chat-hidden {
        display: flex !important;
    }

    .chat-area.mobile-visible {
        position: relative !important;
        inset: unset !important;
    }
}

/* Mobile: Stelle sicher dass nur eins sichtbar ist */
@media (max-width: 850px) {
    .chat-area.mobile-chat-hidden {
        display: none !important;
    }

    .sidebar.mobile-hidden {
        display: none !important;
    }

    .chat-area.mobile-visible {
        display: flex !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 1000 !important;
    }
}

/* Verhindere Pointer-Events-Probleme */
.chat-item {
    pointer-events: auto !important;
    cursor: pointer !important;
}





/* Add Members Button */
.add-members-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.add-members-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

.add-members-btn svg {
    flex-shrink: 0;
}





/* ========================================
   CHAT AREA - MOBILE KEYBOARD FIX V2
   ======================================== */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
    height: 100vh;
    overflow: hidden;
}

/* Chat Header */
#active-chat-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 70px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

/* Messages Container */
#messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* ENTFERNE: scroll-behavior: auto !important; */
    scroll-behavior: auto;
    /* Auto für Pagination, wird per JS überschrieben */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    /* NEU: Fade-In beim Laden */
    opacity: 0;
    transition: opacity 0.3s ease;
}

#messages-container.loaded {
    opacity: 1;
}

/* Input Area */
.chat-input-area {
    padding: 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    /* NEU: Position relative damit Recording Bar richtig positioniert werden kann */
    position: relative;
    /* NEU: Transition für smooth hiding */
    transition: opacity 0.3s ease, pointer-events 0s linear 0.3s;
}

.chat-input-area.recording-active {
    opacity: 0.5;
    pointer-events: none;
}

/* ========================================
   MOBILE OPTIMIERUNG
   ======================================== */

@media (max-width: 850px) {

    /* Chat Area wird zur Fixed Container */
    .chat-area {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        display: grid;
        grid-template-rows: auto 1fr auto;
        height: 100vh !important;
        max-height: -webkit-fill-available;
    }

    /* Header - erste Grid Row */
    #active-chat-header {
        position: relative;
        grid-row: 1;
        padding-top: max(15px, env(safe-area-inset-top));
    }

    /* Messages - zweite Grid Row (flexible) */
    #messages-container {
        position: relative;
        grid-row: 2;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }

    /* Input - dritte Grid Row */
    .chat-input-area {
        position: relative;
        grid-row: 3;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    }

    /* Body fixieren wenn Chat offen */
    body.chat-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* Verhindere Zoom bei Input Focus */
    #message-input {
        font-size: 16px !important;
    }

    #message-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }
}

/* Desktop */
@media (min-width: 851px) {
    #active-chat-header {
        position: sticky;
        top: 0;
    }

    .chat-input-area {
        position: sticky;
        bottom: 0;
    }
}

/* Welcome View */
.welcome-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}













/* =============================================================================
   ERGÄNZUNGEN FÜR style.css - Offline-Modus Styles
   Füge diese am Ende der style.css hinzu
   ============================================================================= */

/* ==================== OFFLINE INDICATOR ==================== */
#offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    z-index: 99998;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

/* ==================== MESSAGE STATUS INDICATORS ==================== */
.message-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-left: 6px;
    transition: all 0.3s ease;
}

.message-status svg {
    animation: none;
}

.message-status.sending svg {
    animation: spin 0.8s linear infinite;
}

.message-status.queued {
    color: #fbbf24 !important;
}

.message-status.sent {
    color: var(--success) !important;
}

.message-status.failed {
    color: var(--danger) !important;
    cursor: help;
}

/* ==================== OFFLINE DATA NOTICE ==================== */
.offline-data-notice {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease;
}

.offline-data-notice svg {
    flex-shrink: 0;
}

/* ==================== RETRY BUTTON ==================== */
.retry-button {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.retry-button:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.retry-button:active {
    transform: translateY(0);
}

/* ==================== SYNC INDICATOR ==================== */
.sync-indicator {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.sync-indicator svg {
    animation: spin 1s linear infinite;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== OFFLINE BADGE ON CHATS ==================== */
.chat-item.offline-cached {
    position: relative;
}

.chat-item.offline-cached::after {
    content: '📡';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    opacity: 0.5;
}

/* ==================== NO CONNECTION SCREEN ==================== */
.no-connection-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 40px;
    text-align: center;
}

.no-connection-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

.no-connection-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--text-tertiary);
}

.no-connection-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.no-connection-text {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ==================== CACHED DATA BADGE ==================== */
.cached-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    margin-left: 8px;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==================== MOBILE ADJUSTMENTS ==================== */
@media (max-width: 850px) {
    #offline-indicator {
        font-size: 13px;
        padding: 10px;
    }

    .sync-indicator {
        bottom: 70px;
        right: 15px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .offline-data-notice {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ==================== DARK MODE ENHANCEMENTS ==================== */
@media (prefers-color-scheme: dark) {
    .offline-data-notice {
        background: rgba(251, 191, 36, 0.1);
    }

    .message-status.queued {
        filter: brightness(1.2);
    }
}





/* =============================================================================
   VOICE MESSAGES STYLES
   ============================================================================= */

/* ==================== VOICE RECORDING BAR ==================== */




.recording-indicator {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: recordingPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes recordingPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(1.3);
    }
}

.recording-waveform {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.waveform-bar {
    width: 3px;
    background: white;
    border-radius: 2px;
    animation: waveformBounce 0.8s ease-in-out infinite;
    opacity: 0.8;
}

.waveform-bar:nth-child(1) {
    animation-delay: 0s;
}

.waveform-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.waveform-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.waveform-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.waveform-bar:nth-child(5) {
    animation-delay: 0.4s;
}

.waveform-bar:nth-child(6) {
    animation-delay: 0.3s;
}

.waveform-bar:nth-child(7) {
    animation-delay: 0.2s;
}

.waveform-bar:nth-child(8) {
    animation-delay: 0.1s;
}

@keyframes waveformBounce {

    0%,
    100% {
        height: 8px;
    }

    50% {
        height: 32px;
    }
}

.recording-time {
    font-size: 18px;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
    min-width: 65px;
    text-align: right;
    flex-shrink: 0;
}

.recording-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.recording-cancel-btn,
.recording-send-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.recording-cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.recording-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(-90deg);
}

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

.recording-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* ==================== VOICE BUTTON (replaces send button when empty) ==================== */
.voice-record-btn {
    padding: 14px;
    background: rgba(51, 65, 85, 0.5);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.voice-record-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

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

.voice-record-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ==================== VOICE MESSAGE BUBBLE ==================== */
.voice-message-bubble {
    max-width: 300px;
    width: 300px;
    padding: 12px 16px;
    border-radius: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.voice-message-bubble.sent {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    align-self: flex-end;
}

.voice-message-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-play-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.voice-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

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

.voice-play-btn.playing {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.voice-waveform {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    position: relative;
    cursor: pointer;
}

.voice-waveform-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.2s;
    opacity: 0.4;
}

.voice-waveform-bar.active {
    opacity: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.voice-duration {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    min-width: 45px;
    text-align: right;
    flex-shrink: 0;
}

.voice-message-time {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 4px;
}

/* ==================== MOBILE OPTIMIZATION ==================== */
@media (max-width: 850px) {
    .voice-recording-bar {
        padding: 15px;
        gap: 12px;
    }

    .recording-waveform {
        height: 32px;
    }

    .recording-time {
        font-size: 16px;
        min-width: 55px;
    }

    .recording-cancel-btn,
    .recording-send-btn {
        width: 44px;
        height: 44px;
    }

    .voice-message-bubble {
        max-width: 280px;
        width: 280px;
    }

    .voice-play-btn {
        width: 36px;
        height: 36px;
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {

    .voice-recording-bar,
    .recording-indicator,
    .waveform-bar {
        animation: none !important;
    }
}


/* ==================== VOICE RECORDING BAR ==================== */
.voice-recording-bar {
    /* GEÄNDERT: Fixed positioning statt absolute */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 2px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 -4px 20px rgba(239, 68, 68, 0.3);
    animation: slideUpBar 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    /* Erhöht, damit es über allem liegt */
}

/* Mobile: Anpassung wenn innerhalb des Chat-Bereichs */
@media (max-width: 850px) {
    .voice-recording-bar {
        padding: 15px;
        gap: 12px;
        /* Stelle sicher dass es nicht durch Mobile-Navigation überdeckt wird */
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }
}

@keyframes slideUpBar {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownBar {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}