/* =========================================================
   VITO — Temel Tasarım (Açık tema, mor-mavi aksanlı)
   Bu dosya, verdiğin HTML ile birebir uyumludur.
   ========================================================= */

/* ---- Tema değişkenleri ---- */
:root {
    --bg: #f6f8fc;
    --panel: #ffffff;
    --panel-2: #f2f5fb;
    --panel-3: #eef2f9;

    --text: #1e2533;
    --muted: #66738c;

    --brand: #6b7cff;
    --brand-2: #5a69f4;
    --brand-3: #95a1ff;

    --accent: #16b97a;
    --danger: #ea5a5a;

    --border: #e4e9f2;
    --chip: #eef2ff;

    --radius: 14px;
    --shadow: 0 6px 20px rgba(17, 34, 68, .08);

    --font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ---- Reset ---- */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none
}

img {
    max-width: 100%;
    display: block
}

.gizle {
    display: none !important
}

/* =========================================================
   ÜST BAR
   ========================================================= */
.header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header__container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--brand)
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 18px
}

.header__nav-menu {
    display: flex;
    align-items: center;
    gap: 14px
}

.header__nav-main,
.header__nav-config {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 8px
}

.header__nav-main a {
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.header__nav-main a.active {
    background: var(--chip)
}

.header__nav-config > li {
    position: relative
}

.header__nav-config .sub-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 36px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 260px;
    box-shadow: var(--shadow);
}

.header__nav-config li:hover .sub-menu {
    display: block
}

.header__nav-user {
    position: relative
}

.header__nav-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
}

.header__nav-user:hover .sub-menu {
    display: block;
    position: absolute;
    right: 0;
    top: 36px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 220px;
    box-shadow: var(--shadow);
}

/* Bildirim listesi */
#notification-list {
    max-height: 260px;
    overflow: auto;
    margin: 0;
    padding: 0
}

#notification-list li {
    list-style: none;
    padding: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-bottom: 1px dashed var(--border)
}

#notification-count {
    margin-right: 4px
}

#notification-count:empty::after {
    content: ""
}

/* =========================================================
   GİRİŞ EKRANI
   ========================================================= */
.login-body {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 56px);
    padding: 16px;
}

.login {
    width: min(520px, 92vw);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.login__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px
}

.login__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--brand)
}

.login__title {
    margin: 10px 0 14px
}

.login__form-item {
    display: grid;
    gap: 6px;
    margin: 10px 0
}

.login__form input {
    width: 100%;
    background: var(--panel-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
}

.login__form input:focus {
    border-color: var(--brand-3);
    box-shadow: 0 0 0 3px rgba(107, 124, 255, .16)
}

.login__error {
    color: var(--danger);
    display: block;
    margin-top: 6px
}

.btn {
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.btn--primary {
    background: var(--brand);
    color: #fff
}

.btn--secondary {
    background: #3a4661;
    color: #fff
}

.btn--danger {
    background: var(--danger);
    color: #fff
}

.login__footer {
    opacity: .65;
    margin-top: 8px
}

/* =========================================================
   APP KABUĞU & GRID
   ========================================================= */
.page__container {
    max-width: 1280px;
    margin: 12px auto;
    padding: 0 12px
}

.chat__container.rooms {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 300px 260px;
    /* Sol büyük sohbet + sağ 2 panel */
    align-items: start;
}

@media (max-width:1200px) {
    .chat__container.rooms {
        grid-template-columns: 1fr 280px 240px
    }
}

@media (max-width:1023px) {
    .chat__container.rooms {
        grid-template-columns: 1fr
    }
}

/* Paneller (sol ana / sağ 2 kutu) */
.chat__rooms,
.chat__personel,
.chat__users,
.chat__items {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* =========================================================
   SOL ANA PANEL (KANALLAR GÖRÜNÜMÜ)
   ========================================================= */
.chat__rooms {
    /* 3 çocuk: .chat__screen | .chat__users | .chat__items  → yan yana gelsin */
    display: grid;
    grid-template-columns: 1fr 300px 260px;
}

@media (max-width:1200px) {
    .chat__rooms {
        grid-template-columns: 1fr
    }
}

/* Başlık şeritleri */
.chat-title {
    padding: 12px 14px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
}

/* --- Chat ekranı (sol, geniş) --- */
.chat__screen {
    position: relative;
    height: calc(100vh - 140px)
}

.chat__screen-close {
    position: absolute;
    right: 8px;
    top: 8px;
    opacity: .6;
    cursor: pointer
}

.chat__screen-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Mesaj akışı alanı ids: #kmesaj ve #pmmesaj */
#kmesaj,
#pmmesaj {
    flex: 1;
    overflow: auto;
    min-height: 0;
    padding: 12px;
    background:
        radial-gradient(circle at 20px 20px, rgba(107, 124, 255, .06) 2px, transparent 3px),
        radial-gradient(circle at 60px 60px, rgba(107, 124, 255, .05) 2px, transparent 3px),
        var(--panel);
    background-size: 80px 80px, 80px 80px, auto;
}

/* “Henüz mesaj yok” kutuları */
.none-message {
    padding: 22px;
    text-align: center;
    opacity: .75
}

.none-message span:first-child {
    display: block;
    font-size: 28px;
    margin-bottom: 6px
}

/* Mesaj balon stili (genel) — istersen kaldırabilirsin */
.message {
    margin: 8px 0
}

.message__row {
    display: flex;
    gap: 8px
}

.message__text {
    flex: 1
}

.message__text-container {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px;
}

.message--sen .message__text-container {
    background: rgba(107, 124, 255, .08);
    border-color: rgba(107, 124, 255, .25);
}

/* --- Alt editör --- */
.chat__form {
    border-top: 1px solid var(--border);
    background: var(--panel);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.text-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.text-editor__button,
.text-editor__clear {
    cursor: pointer;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-2)
}

.text-editor__colors {
    position: relative
}

.text-editor__colors-main {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #000;
    border: 1px solid var(--border)
}

.text-editor__colors-wrapper {
    position: absolute;
    top: 28px;
    left: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(8, 16px);
    gap: 6px;
    padding: 8px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.text-editor__colors-wrapper span {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #0003;
}

.chat__form-container {
    display: flex;
    align-items: center;
    gap: 8px
}

.text-editor__input {
    flex: 1;
    min-height: 44px;
    background: var(--panel-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
}

.text-editor__input:focus {
    border-color: var(--brand-3);
    box-shadow: 0 0 0 3px rgba(107, 124, 255, .16)
}

.button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-2);
    color: var(--text)
}

.button--yolla {
    background: var(--brand);
    border-color: transparent;
    color: #fff
}

.button--yolla:hover {
    background: var(--brand-2)
}

/* --- Sağdaki iki panel (Kullanıcılar & Kanallar) --- */
.chat__users,
.chat__items {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column
}

.chat__users-container,
.chat__items-container {
    flex: 1;
    overflow: auto;
    min-height: 0
}

/* Kullanıcı satırı (doldurunca şık dursun) */
.user-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px dashed var(--border);
}

.user-item .badge {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-2);
    font-size: 12px
}

.user-item__text h5 {
    margin: 0 0 2px 0;
    font-size: 14px
}

.user-item__text span {
    font-size: 12px;
    color: var(--muted)
}

/* Sayı rozetleri */
.badge--count::after {
    content: attr(data-count);
    background: var(--danger);
    color: #fff;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 6px;
    font-size: 12px;
}

/* =========================================================
   ÖZELLER GÖRÜNÜMÜ
   (yapı: .chat__personel → solda PM ekranı, sağda “kullanıcılar” listesi)
   ========================================================= */
.chat__personel {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 320px;
    align-items: start;
}

@media (max-width:1023px) {
    .chat__personel {
        grid-template-columns: 1fr
    }
}

.chat__personel .chat__screen {
    height: calc(100vh - 140px)
}

.chat__personel .chat__items {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column
}

/* =========================================================
   MODAL (magnific-popup ile uyumlu, temel görünüm)
   ========================================================= */
.modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 520px;
    margin: 0 auto;
    overflow: hidden
}

.modal__header {
    padding: 12px 14px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--border);
    font-weight: 700
}

.modal__body {
    padding: 14px;
    display: grid;
    gap: 8px
}

.modal__footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end
}

/* =========================================================
   RESPONSIVE İYİLEŞTİRMELER
   ========================================================= */
@media (max-width:1023px) {
    .chat__rooms {
        grid-template-columns: 1fr
    }

    .chat__users,
    .chat__items {
        height: auto;
        max-height: none
    }

    #kmesaj,
    #pmmesaj {
        height: 50vh
    }

    /* mobilde yeterli görünür alan */
}
