/* --- TEMA DEĞİŞKENLERİ --- */
:root {
    --bg-color: #eef1f5;
    --panel-bg: #ffffff;
    --primary-cyan: #0097a7;
    --primary-light: #e0f2f1;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --msg-received-bg: #ffffff;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
    --panel-bg-rgb: 255, 255, 255;
}

.logo-blend {
    mix-blend-mode: multiply;
    filter: contrast(1.1);
}

body.dark-mode .logo-blend {
    mix-blend-mode: initial;
    filter: brightness(0.9) drop-shadow(0 0 5px rgba(0, 188, 212, 0.3));
    background-color: white;
    /* Keep white bg in dark mode but make it a nice circle */
    border-radius: 50%;
    padding: 2px;
}

/* --- YÜKLEME (LOADING) VE SKELETON ANİMASYONLARI --- */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation: shimmer 2.5s linear infinite forwards;
}

body.dark-mode .skeleton {
    background: #2a2a2a;
    background-image: linear-gradient(to right, #2a2a2a 0%, #3a3a3a 20%, #2a2a2a 40%, #2a2a2a 100%);
}

.skeleton-avatar { width: 45px; height: 45px; border-radius: 50%; flex-shrink: 0; }
.skeleton-name { width: 120px; height: 14px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-code { width: 60px; height: 10px; border-radius: 4px; }
.skeleton-bubble { width: 200px; height: 40px; border-radius: var(--border-radius-md); }
.skeleton-bubble-sent { align-self: flex-end; width: 150px; }

.loading-blur {
    filter: blur(8px);
    pointer-events: none;
    transition: filter 0.4s ease;
}

.loading-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(var(--panel-bg-rgb), 0.7);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    transition: opacity 0.4s ease;
    opacity: 0;
}

.loading-overlay.show {
    display: flex;
    opacity: 1;
}

.loading-brand-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -1px;
    animation: pulseFade 2s infinite ease-in-out;
}

.loading-brand-text span {
    color: var(--primary-cyan);
}

.loading-spinner-dots {
    display: flex;
    gap: 4px;
    font-size: 1.5rem;
    color: var(--primary-cyan);
    font-weight: bold;
}

.loading-spinner-dots span {
    animation: dotJump 1.4s infinite ease-in-out both;
}

.loading-spinner-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-spinner-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulseFade {
    0%, 100% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
}

@keyframes dotJump {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

#sidebarLoadingOverlay {
    align-items: flex-start;
    justify-content: flex-start;
}

/* Karanlık Tema (Dark Mode) Renkleri */
body.dark-mode {
    --bg-color: #121212;
    --panel-bg: #1e1e1e;
    --primary-cyan: #00bcd4;
    --primary-light: #2a3b4c;
    --text-dark: #f0f0f0;
    --text-muted: #a0aab2;
    --border-color: #333333;
    --msg-received-bg: #2c2c2c;
    --panel-bg-rgb: 30, 30, 30;
}

/* --- GENEL AYARLAR --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background 0.25s, color 0.25s, border-color 0.25s, opacity 0.25s;
    /* Smooth globally */
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: background-color 0.3s ease;
    overflow: hidden;
}

.app-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    background: var(--panel-bg);
    border-radius: 0;
    display: flex;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* --- SERVER SİDEBAR (DISCORD TARZI) --- */
.server-sidebar {
    width: 72px;
    background-color: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 10px;
    position: relative;
    transition: width 0.3s ease;
    border-right: 1px solid var(--border-color);
    z-index: 50; /* Z-index artırıldı ki diğer panellerin altında kalmasın */
}

body.dark-mode .server-sidebar {
    background-color: #1a1b1e;
    border-right: 1px solid #111;
}

.server-sidebar.collapsed {
    width: 0;
    padding: 0;
    border-right: none;
    /* overflow: hidden; */ /* Kaldırıldı ki buton görünsün */
}

.server-sidebar.collapsed > *:not(.server-toggle-btn) {
    display: none;
}

.server-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--panel-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-mode .server-item {
    background-color: #313338;
}

.server-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.server-initials {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.server-item:hover {
    border-radius: 16px;
    background-color: var(--primary-cyan);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 151, 167, 0.4);
}

.server-item:hover .server-initials,
.server-item:hover i {
    color: white;
}

.server-item:hover img {
    border-radius: 16px;
}

.server-item.active {
    border-radius: 16px;
    background-color: var(--primary-cyan);
}

.server-item.active img {
    border-radius: 16px;
}

.server-item.owned-server {
    background-color: var(--primary-cyan);
    color: white;
}
.server-item.owned-server:hover {
    border-radius: 16px;
}

.server-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 40px;
    background-color: var(--primary-cyan);
    border-radius: 0 4px 4px 0;
}

.server-item:hover::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 20px;
    background-color: var(--primary-cyan);
    border-radius: 0 4px 4px 0;
}

.server-separator {
    width: 32px;
    height: 2px;
    background-color: var(--border-color);
    border-radius: 2px;
    margin: 4px 0;
    flex-shrink: 0;
}

.server-add {
    color: #2ed573;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.server-add:hover {
    background-color: #2ed573;
    color: white;
    box-shadow: 0 4px 12px rgba(46, 213, 115, 0.4);
}

.server-toggle-btn {
    position: absolute;
    bottom: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    right: -15px;
    z-index: 11;
}

.server-toggle-btn:hover {
    background-color: var(--primary-cyan);
    color: white;
    border-color: var(--primary-cyan);
}

.server-sidebar.collapsed .server-toggle-btn {
    right: -25px; /* Değiştirildi */
    transform: rotate(180deg);
}

/* --- SUNUCU ÜYELERİ SİDEBAR --- */
.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.member-item:hover {
    background: var(--bg-color);
}

.member-item .avatar {
    width: 32px;
    height: 32px;
    margin-right: 0;
    font-size: 0.9rem;
}

.member-item .name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.member-item.offline {
    opacity: 0.6;
}

/* --- SOL SİDEBAR --- */
.sidebar {
    width: 350px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 25px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    margin: 0 20px 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    color: var(--text-dark);
}

.contact-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 5px;
}

.contact-item:hover {
    background: var(--bg-color);
}

.contact-item.active {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-cyan);
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-light);
    color: var(--primary-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.contact-info h4 {
    margin-bottom: 3px;
    font-weight: 600;
}

.contact-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- SAĞ SOHBET ALANI --- */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-color);
}

.chat-header {
    padding: 20px 30px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-chat-info {
    display: flex;
    align-items: center;
}

.status {
    color: var(--primary-cyan);
    font-size: 0.85rem;
    font-weight: 500;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--primary-cyan);
}

/* Mesajlar */
.messages-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 65%;
    display: flex;
    flex-direction: column;
}

.received {
    align-self: flex-start;
}

.sent {
    align-self: flex-end;
}

.msg-bubble {
    padding: 15px 20px;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.received .msg-bubble {
    background: var(--msg-received-bg);
    color: var(--text-dark);
    border-radius: var(--border-radius-md) var(--border-radius-md) var(--border-radius-md) 0;
}

.sent .msg-bubble {
    background: var(--primary-cyan);
    color: white;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 var(--border-radius-md);
}

.msg-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    align-self: flex-end;
}

/* Alt Bar (Mesaj Yazma) */
.chat-footer {
    padding: 20px 30px;
    background: var(--panel-bg);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    flex: 1;
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    padding: 5px 20px;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    outline: none;
    color: var(--text-dark);
}

.send-btn {
    background: var(--primary-cyan);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 172, 193, 0.3);
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

/* --- EKLENTİ MENÜSÜ --- */
.attachment-menu {
    position: absolute;
    bottom: 80px;
    left: 30px;
    background: var(--panel-bg);
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.attachment-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.attach-item {
    background: transparent;
    border: none;
    padding: 10px 20px;
    text-align: left;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.attach-item:hover {
    background: var(--bg-color);
    color: var(--primary-cyan);
}

/* --- AYARLAR MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--panel-bg);
    width: 400px;
    border-radius: var(--border-radius-md);
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Switch (Toggle) Tasarımı */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-cyan);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* --- İSTEKLER VE ARKADAŞ EKLEME TABS --- */
.req-tabs-container {
    display: flex;
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.req-tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.3s, transform 0.2s;
    position: relative;
}

.req-tab:hover {
    color: var(--primary-cyan);
    transform: translateY(-2px);
}

.req-tab.active {
    color: var(--primary-cyan);
    font-weight: bold;
}

.tab-indicator {
    position: absolute;
    bottom: -2px;
    height: 3px;
    background: var(--primary-cyan);
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#addFriendArea,
#requestsViewArea {
    animation: fadeInSlideUp 0.4s ease forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.empty-state>i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 15px;
}

#myCodeDisplay {
    font-size: 0.8rem;
    background: var(--primary-light);
    color: var(--primary-cyan);
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    margin-left: 10px;
}

.request-box {
    background: var(--bg-color);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.request-btns {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.req-btn {
    flex: 1;
    padding: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
}

.req-accept {
    background: #2ed573;
}

.req-reject {
    background: #ff4757;
}

/* Profil ve Görüldü CSS */
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.msg-status {
    font-size: 0.7rem;
    margin-left: 5px;
    color: var(--text-muted);
}

.msg-status.read {
    color: #3498db;
}

/* Görüldü Mavi Tik */
.online-dot {
    width: 10px;
    height: 10px;
    background: #2ed573;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.offline-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-pic-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    margin: 0 auto 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

.profile-pic-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.profile-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.profile-input-group input,
.profile-input-group textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-dark);
}

.chat-header-clickable {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 8px;
    transition: 0.3s;
}

.chat-header-clickable:hover {
    background: var(--bg-color);
}

/* --- SES DURDURMA BUTONU --- */
.global-stop-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
}

.global-stop-btn.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.global-stop-btn:hover {
    background: #ff6b81;
    transform: translateX(-50%) translateY(-2px);
}

body.dark-mode .global-stop-btn {
    background: #c0392b;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}

body.dark-mode .global-stop-btn:hover {
    background: #e74c3c;
}

/* --- YENİ EKLENEN ANİMASYONLAR VE DİNAMİZM --- */
.contact-item:hover,
.icon-btn:hover,
.btn-fill:hover,
.btn-outline:hover,
.speed-btn:hover,
.send-btn:hover {
    transform: scale(1.05);
}

.icon-btn:active,
.btn-fill:active,
.send-btn:active {
    transform: scale(0.95) !important;
}

@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-item,
.message {
    animation: slideDownIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Badge (Okunmamış vs) */
.unread-badge {
    background: #ff4757;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: auto;
    animation: slideDownIn 0.3s ease-out forwards;
}

.bell-icon-wrapper {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: 0.3s;
}

.bell-icon-wrapper:hover {
    color: var(--primary-cyan);
    transform: scale(1.1);
}

.bell-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff4757;
    color: white;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

/* Sürükle Bırak Ekranı */
.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 151, 167, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.drag-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1.02);
}

.drag-overlay i {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: slideDownIn 0.5s infinite alternate;
}

/* Sesli Mesaj (Voice Message) WhatsApp Style */
.voice-msg-capsule {
    display: flex;
    align-items: center;
    background: var(--msg-received-bg);
    border-radius: 40px;
    padding: 5px 15px 5px 5px;
    gap: 10px;
    min-width: 250px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.sent .voice-msg-capsule {
    background: var(--primary-cyan);
    color: white;
}

.voice-msg-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.voice-canvas-container {
    flex: 1;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.voice-play-btn {
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    width: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sent .voice-play-btn {
    color: white;
}

.transcribe-btn {
    background: transparent;
    border: none;
    color: var(--primary-cyan);
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
}

.sent .transcribe-btn {
    color: rgba(255, 255, 255, 0.8);
}

.transcription-text {
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    display: none;
    font-style: italic;
}

.sent .transcription-text {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================
   WEBRTC: ARAMA MODALLARI VE TASARIM
========================================= */

/* Gelen Arama Modalı */
.incoming-call-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 9999;
    animation: slideDownIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.incoming-call-modal.active {
    display: flex;
}

.call-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 10px;
    overflow: hidden;
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#incomingCallName {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

#incomingCallType {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.call-actions {
    display: flex;
    gap: 15px;
}

.call-btn-accept,
.call-btn-reject {
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.call-btn-accept {
    background: #2ed573;
    box-shadow: 0 4px 10px rgba(46, 213, 115, 0.3);
}

.call-btn-reject {
    background: #ff4757;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3);
}

.call-btn-accept:hover,
.call-btn-reject:hover {
    transform: translateY(-2px);
}

/* Aktif Görüşme Ekranı */
.active-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: space-between;
}

.active-call-overlay.active {
    display: flex;
}

.remote-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
}

.local-video-wrapper {
    position: absolute;
    bottom: 100px;
    right: 30px;
    width: 150px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: #222;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Ayna efekti */
}

.call-info {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

#activeCallName {
    margin-bottom: 5px;
}

#callDuration {
    font-size: 1.2rem;
    font-family: monospace;
}

.call-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 2;
}

.call-control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.call-control-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.call-control-btn.muted {
    background: rgba(255, 71, 87, 0.8);
}

.end-call-btn {
    background: #ff4757;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.5);
}

.end-call-btn:hover {
    background: #ff6b81;
}

.call-btn {
    color: var(--primary-cyan);
    font-size: 1.3rem;
}

/* --- MOBİL CİHAZ (RESPONSIVE) TASARIM --- */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .app-container {
        max-width: 100%;
        height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }

    /* Yan menü %100 kaplar (Sohbet Yokken) */
    .sidebar {
        width: 100%;
        border-right: none;
    }

    /* Chat Area mobilde %100 kaplayacak */
    .chat-area {
        width: 100%;
    }

    /* Mobil'de Sohbet seçili DEĞİLSE sağ ekranı GİZLE */
    body.mobile-view-sidebar .chat-area {
        display: none !important;
    }

    /* Mobil'de Sohbet seçiliyse sol menüyü GİZLE */
    body.mobile-view-chat .sidebar {
        display: none !important;
    }

    .chat-header {
        padding: 10px 15px;
    }

    .messages-container {
        padding: 15px;
    }

    .chat-footer-wrapper {
        padding: 0;
        border-top: 1px solid var(--border-color);
    }

    .chat-footer-inner {
        padding: 10px;
        gap: 5px;
    }

    #messageInput {
        padding: 10px 0;
        font-size: 1rem;
    }

    .message {
        max-width: 85%;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Mobilde Özel Geri Butonu Dizaynı */
    #backToSidebar {
        display: flex !important;
        background: transparent;
        border: none;
        color: var(--text-dark);
        font-size: 1.5rem;
        margin-right: 10px;
        cursor: pointer;
        padding-right: 10px;
        border-right: 1px solid var(--border-color);
    }
}

#backToSidebar {
    display: none;
    /* Masaüstünde Gizli */
}

/* =========================================
   CYA: WHATSAPP TARZI GRUPLANDIRMA & HOVER SAAT
   ========================================= */

.message {
    position: relative;
    margin-bottom: 2px;
    /* Gruplanmış mesajlar arası mesafe az */
}

.message.new-group {
    margin-top: 15px;
    /* Yeni grup başladığında mesafe artar */
}

.msg-bubble {
    position: relative;
    transition: background-color 0.3s ease;
}

/* Hover Saat */
.msg-hover-time {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.sent .msg-hover-time {
    right: 100%;
    margin-right: 10px;
}

.received .msg-hover-time {
    left: 100%;
    margin-left: 10px;
}

.message:hover .msg-hover-time {
    opacity: 1;
}

/* Okundu Animasyonu */
@keyframes readBubblePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
        background-color: #00acc1;
    }

    100% {
        transform: scale(1);
        background-color: #00838f;
    }

    /* Hafif koyu ton */
}

.message.sent.read-bubble .msg-bubble {
    background-color: #00838f !important;
    animation: readBubblePop 0.6s ease-out forwards;
}

/* Tarih Ayracı */
.date-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0;
    position: relative;
    width: 100%;
}

.date-separator span {
    background: var(--primary-light);
    color: var(--primary-cyan);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Server Sidebar Icon Fixes */
.server-item {
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.server-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.owned-server {
    overflow: hidden !important;
    padding: 0 !important;
}