* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body, html {
    height: 100%;
   
}

/* Giriş ve Kayıt Sayfaları */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
}
.auth-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.auth-box h2 { margin-bottom: 20px; color: #243447; }
.auth-box input, .admin-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}
.auth-box button, .admin-container button {
    width: 100%;
    padding: 12px;
    background: #517da2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}
.error { color: #e11d48; margin-bottom: 15px; font-size: 14px;}

/* Ana Uygulama Düzeni */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Sol Sidebar */
.sidebar {
    width: 25%;
    min-width: 300px;
    background: #fff;
    border-right: 1px solid #e6e6e6;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 15px;
    background: #517da2;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.room-list {
    flex: 1;
    overflow-y: auto;
}
.room-item {
    display: flex;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
    align-items: center;
}
.room-item:hover { background: #f4f4f5; }
.avatar {
    width: 45px;
    height: 45px;
    background: #74a2cc;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-right: 12px;
}
.room-info { display: flex; flex-direction: column; }
.room-name { font-weight: 600; color: #222; }
.room-sub { font-size: 12px; color: #888; margin-top: 3px; }
.sidebar-footer { padding: 10px; display: flex; gap: 10px; border-top: 1px solid #eee; }
.btn-logout, .btn-admin {
    flex: 1; text-align: center; text-decoration: none; padding: 8px; font-size: 13px; border-radius: 4px;
}
.btn-logout { background: #ef4444; color: white; }
.btn-admin { background: #10b981; color: white; }

/* Sağ Sohbet Alanı */
.chat-area {
    width: 75%;
    background: #f4f4f5;
    position: relative;
}
.welcome-screen {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background: #f1f5f9;
}
.welcome-msg {
    padding: 7px 15px;
    background: rgba(0,0,0,0.05);
    border-radius: 15px;
    color: #64748b;
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.chat-header {
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
}
.back-btn {
    display: none;
    margin-right: 15px;
    background: none;
    border: none;
    font-size: 16px;
    color: #517da2;
    cursor: pointer;
}
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Klasik telegram deseni */
}

/* Mesaj Balonları */
.message-wrapper {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-end;
    gap: 10px;
}
.message-wrapper.me { justify-content: flex-end; }
.message-wrapper.other { justify-content: flex-start; }

.msg-bubble {
    max-width: 60%;
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.me .msg-bubble { background: #e2f7cb; color: #000; border-bottom-right-radius: 2px; }
.other .msg-bubble { background: #fff; color: #000; border-bottom-left-radius: 2px; }

.msg-user { font-weight: bold; color: #3a75a7; font-size: 13px; cursor: pointer; display: block; margin-bottom: 3px; }
.msg-text { font-size: 14px; word-break: break-word; }
.msg-time { font-size: 10px; color: #7f8c8d; float: right; margin-top: 5px; margin-left: 10px; }

.block-btn {
    background: none; border: none; font-size: 11px; cursor: pointer; padding: 2px 5px; border-radius: 4px;
}
.block-btn.block { color: #ef4444; }
.block-btn.unblock { color: #10b981; }

/* Mesaj Giriş Alanı */
.chat-input-area { padding: 15px; background: #fff; border-top: 1px solid #e6e6e6; }
#messageForm { display: flex; gap: 10px; }
#messageInput { flex: 1; padding: 12px; border: 1px solid #dbdbdb; border-radius: 20px; outline: none; font-size: 14px; }
.send-btn { background: #517da2; color: white; border: none; padding: 0 20px; border-radius: 20px; cursor: pointer; font-weight: bold;}

/* MOBIL UYUMLULUK KRİTİK AYARLAR */
@media (max-width: 768px) {
    .sidebar { width: 100%; }
    .chat-area { width: 100%; display: none; }
    .back-btn { display: block; }
    .msg-bubble { max-width: 80%; }
}

.admin-container { max-width: 500px; margin: 50px auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);}
.success { color: #10b981; margin-bottom: 15px;}