/* =========================================================
   RESET + GENEL
========================================================= */
*{
    box-sizing:border-box;
}

html, body{
    height:100%;
}

body{
    margin:0;
    padding:0;
    font-family: Arial, sans-serif;
    color:#fff;
    display:flex;
    flex-direction:column;
    height:100vh;

    /* Tema yoksa fallback */
    background-color:#0b1220;

    /* Tema gelirse düzgün gözüksün */
    background-size:cover;
    background-position:center;
    background-attachment:fixed;

    /* body scroll tamamen kapalı */
    overflow: hidden !important;
}

/* =========================================================
   HEADER (CAM GÖRÜNÜM)
========================================================= */
header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 10px;
    height:50px;
    line-height:50px;

    /* CAM EFEKTİ */
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-bottom:1px solid rgba(255,255,255,0.08);
    box-shadow:0 4px 20px rgba(0,0,0,0.2);

    color:#fff;
    flex-shrink:0;
}


header button{
    padding:6px 12px;
    border:none;
    border-radius:6px;
    background:#06b6d4;

    /* ✅ BUTON YAZISI BEYAZ (Tema / Banlılar / Giriş) */
    color:#fff !important;

    cursor:pointer;
    font-weight:800;
}

.headerBtns{
    display:flex;
    align-items:center;
    gap:8px;
}

/* =========================================================
   CONTAINER (TEMA BURADA)
   -> chat + userPanel aynı temayı görür
========================================================= */
/* ANA CONTAINER (TEMA BURAYA BASILIYOR) */
/* CONTAINER full ekran, footer/radio olmadan */
.container{
    display:flex;
    flex-direction:row;
    width:100%;
    height: calc(100vh - 50px); /* sadece header yüksekliği çıkarıldı */
    overflow:hidden;

    /* Tema veya default background */
    background-position: center center !important;
    background-repeat:no-repeat;
    background-size: 100% 100%;
    background-color:#0b0f14;

    gap:12px;
    padding:10px;
}


/* =========================================================
   CHAT AREA
========================================================= */
#chatArea{
    flex:1;
    display:flex;
    flex-direction:column-reverse;
    min-width:0;

    /* container içinde full yükseklik */
    height: 100% !important;

    /* chatArea taşmasın */
    overflow: hidden !important;

    background: transparent !important;

    /* ✅ chat sağdan biraz daralsın */
    padding-right:6px;
}

/* Mesajların aktığı alan */
#chatBox{
    flex:1;
    overflow-y:auto !important;
    overflow-x:hidden !important; /* ✅ yatay scroll asla çıkmasın */
    padding:10px;

    background: transparent !important;
    border:none !important;

    margin-bottom:8px;
}

/* Mesaj satırı (baloncuk kesinlikle yok) */
.msg{
    margin-bottom:6px;
    padding:0 !important;
    background: transparent !important;
    border:none !important;
    border-radius:0 !important;
    box-shadow:none !important;

    /* ✅ uzun mesajda kırılma düzgün olsun */
    max-width:100% !important;
}

/* mesaj metinleri */
.msg strong,
.msg span{
    text-shadow: 0 1px 2px rgba(0,0,0,0.75);
}

/* ✅ UZUN MESAJLARDA SCROLL ÇIKMASIN / ALT SATIRA KIRILSIN */
.msg span{
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* =========================================================
   COMPOSER (MESAJ YAZMA ALANI)
========================================================= */
#composer{
    display:flex;
    gap:6px;
    margin-bottom:8px;
    align-items:center;
    padding:8px;

    flex-shrink:0;

    border-radius:12px;

    background: rgba(0,0,0,0.14) !important;
    border: 1px solid rgba(255,255,255,0.08);

    /* blur kapalı */
    backdrop-filter: none !important;
}

#msgInput{
    flex: 1 1 auto;
    padding: 8px 10px;
    border-radius:10px;
    outline:none;

    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    color:#fff;
}

#msgInput::placeholder{
    color: rgba(255,255,255,0.65);
}

#chatTools{
    display:flex;
    gap:6px;
    margin-left:4px;
    flex-shrink:0;
}

#chatTools button,
#chatTools input[type=color]{
    padding:6px 8px;
    cursor:pointer;
    border:none;
    border-radius:10px;

    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.08);
    color:#fff;
}

#chatTools button.active{
    background: rgba(255,255,255,0.18);
}

#sendBtn{
    margin-left:4px;
    padding:8px 12px;
    border:none;
    cursor:pointer;
    border-radius:10px;
    font-weight:900;
    background:#06b6d4;

    /* Gönder yazısı beyaz */
    color:#fff !important;
}

/* =========================================================
   EMOJI PANEL
========================================================= */
#emojiPanel{
    display:flex;
    flex-wrap:wrap;
    gap:4px;
    padding:8px;
    border-radius:12px;

    flex-shrink:0;

    background: rgba(0,0,0,0.14) !important;
    border: 1px solid rgba(255,255,255,0.08);

    /* blur kapalı */
    backdrop-filter: none !important;

    /* ✅ Emoji açılınca tema kırpılmasın */
    max-height: 160px;
    overflow-y:auto;
}

#emojiPanel.hidden{
    display:none;
}

.emojiBtn{
    margin:2px;
    cursor:pointer;

    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.08);

    color:#fff;
    font-size:16px;
    border-radius:10px;
    padding:6px 8px;
}

/* =========================================================
   USER PANEL
========================================================= */
#userPanel{
    width:250px;
    overflow-y:auto !important;
    padding:0;

    height: 100% !important;

    background: rgba(0,0,0,0.12) !important;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius:14px;

    /* blur kapalı */
    backdrop-filter: none !important;
}

/* Online başlık ayrı şerit */
#userPanel h2{
    margin:0;
    padding:10px 10px;
    font-size:14px;
    font-weight:900;

    background: rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(255,255,255,0.08);

    position: sticky;
    top:0;
    z-index:2;
}

/* Online satır (baloncuk yok, FLAT) */
/* Online satır: düz liste gibi */
.user{
    display:flex;
    flex-direction:row;      /* F + nick yan yana */
    align-items:center;
    gap:6px;

    padding:4px 10px;        /* daha flat */
    cursor: default;

    background: transparent !important;
    border-radius:0 !important;
    margin:0 !important;
    box-shadow:none !important;

    border-bottom: none;     /* kutu hissi kalksın */
}

/* nick satırı */
.user strong,
.user span{
    text-shadow: 0 1px 2px rgba(0,0,0,0.85);
}

/* strong artık tek satır */
.user strong{
    display:inline-flex;
    align-items:center;
    gap:6px;
    line-height:1.2;
    font-size:14px;
}

/* F BADGE */
.fBadge{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    width:18px;
    height:18px;

    border-radius:5px;
    background:#06b6d4;
    color:#ffffff !important;

    font-weight:900;
    font-size:12px;
    line-height:1;

    flex-shrink:0; /* F küçülmesin */
}

/* =========================================================
   MOD MENU
========================================================= */
.user-menu{
    margin-top:8px;
    width:100%;

    display:flex;
    flex-direction:column;
    align-items:flex-start;

    gap:6px;

    background: transparent !important;
    border:none !important;
    padding:0 !important;
}

.user-menu.hidden{
    display:none !important;
}

.user-menu button{
    width:100%;
    padding:7px 10px;

    font-size:12px;
    font-weight:800;

    cursor:pointer;
    border:none;
    border-radius:10px;

    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    color:#fff;

    text-align:left;
}

/* =========================================================
   CLEAR CHAT BUTTON (CHAT TOOLS İÇİNDE)
========================================================= */
#clearChatBtn{
    cursor:pointer;
    padding:6px 10px;
    border:none;
    border-radius:10px;

    background: rgba(255,255,255,0.12);
    color:#fff !important;

    font-size:14px;
    font-weight:800;
}

#clearChatBtn:hover{
    background: rgba(255,255,255,0.18);
}

/* =========================================================
   LOGIN POPUP
========================================================= */
#loginOverlay{
    display:none;
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

#loginPopup{
    background: #0b1220;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    max-width: 90%;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

#loginPopup.show{
    opacity: 1;
    transform: scale(1);
}

#loginPopup input{
    padding:10px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,0.10);
    background: transparent;
    color:#fff;
    outline:none;
}

#loginPopup button{
    padding:10px;
    border:none;
    border-radius:10px;
    background:#06b6d4;
    color:#fff !important;
    cursor:pointer;
    font-weight:900;
}

#loginPopup a{
    color:#06b6d4 !important;
    text-decoration:none;
    font-size:13px;
}

#loginError{
    color:#ff4d4d;
    font-size:13px;
}

/* =========================================================
   RADIO BAR
========================================================= */
#radioBar{
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:space-between;

    background:#0b1220;
    color:#fff;

    padding:8px 12px;

    position:fixed;
    bottom:0;
    left:0;
    right:0;

    z-index:1000;
    height:60px;
}

#radioBar .controls{
    display:flex;
    align-items:center;
    gap:6px;
}

#radioBar .controls button,
#radioBar .controls .mute{
    cursor:pointer;
    padding:6px 10px;
    border:none;
    border-radius:8px;
    background:#06b6d4;
    color:#fff !important;
    font-weight:900;
}

#radioBar .mute{
    font-size:18px;
}

/* =========================================================
   THEME RIGHT PANEL
========================================================= */
#themeSideOverlay{
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.35);
    z-index: 99998;
    display:none;
}

#themeSidePanel{
    position: fixed;
    top:0;
    right:-380px;
    width:380px;
    max-width: 92%;
    height:100%;
    background: rgba(10,16,28,0.95);
    backdrop-filter: blur(8px);
    z-index: 99999;
    transition: right 0.25s ease;
    border-left: 1px solid rgba(255,255,255,0.08);
    display:flex;
    flex-direction: column;

    color:#fff !important;
}

#themeSidePanel.open{
    right:0;
}

#themeSidePanel *{
    color:#fff !important;
}

.themeHeader{
    display:flex;
    justify-content: space-between;
    align-items:center;
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.themeTitle{
    font-weight: 900;
    font-size: 14px;
}

#themeSideClose{
    background: transparent;
    border:none;
    color:#fff !important;
    font-size: 16px;
    cursor:pointer;
}

.themeBody{
    padding: 12px;
    overflow-y:auto;
    flex:1;
}

.themeRow{
    display:flex;
    gap:6px;
}

#themeUrl{
    flex:1;
    padding: 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    color:#fff !important;
    outline:none;
}

#themeUrl::placeholder{
    color: rgba(255,255,255,0.65) !important;
}

#themeSaveBtn{
    padding: 8px 10px;
    border:none;
    border-radius: 10px;
    background:#06b6d4;
    color:#fff !important;
    font-weight:900;
    cursor:pointer;
}

#themeDefaultBtn{
    padding: 8px 10px;
    border:none;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    color:#fff !important;
    font-weight:900;
    cursor:pointer;
}

#themeMsg{
    margin-top: 8px;
    font-size: 13px;
    color:#ffcc66 !important;
}

.themeListTitle{
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight:900;
    opacity:0.9;
}

#themeList{
    display:flex;
    flex-direction: column;
    gap:8px;
}

.themeItem{
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 10px;
}

.themeThumb{
    width:100%;
    height:120px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255,255,255,0.06);
}

.themeActions{
    display:flex;
    gap:6px;
    margin-top: 8px;
}

.themeActions button{
    flex:1;
    padding: 7px 8px;
    border:none;
    border-radius: 10px;
    cursor:pointer;
    font-weight:900;
}

.btnActivate{
    background:#06b6d4;
    color:#fff !important;
}
.btnDefault{
    background:#06b6d4;
    color:#fff !important;
}
.btnDelete{
    background: rgba(255,80,80,0.9);
    color:#fff !important;
}

/* =========================================================
   BAN PANEL
========================================================= */
#banSideOverlay{
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.35);
    z-index: 99996;
    display:none;
}

#banSidePanel{
    position: fixed;
    top:0;
    right:-380px;
    width:380px;
    max-width: 92%;
    height:100%;
    background: rgba(10,16,28,0.95);
    backdrop-filter: blur(8px);
    z-index: 99997;
    transition: right 0.25s ease;
    border-left: 1px solid rgba(255,255,255,0.08);
    display:flex;
    flex-direction: column;

    color:#fff !important;
}

#banSidePanel.open{
    right:0;
}

#banSidePanel *{
    color:#fff !important;
}

.banHeader{
    display:flex;
    justify-content: space-between;
    align-items:center;
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.banTitle{
    font-weight: 900;
    font-size: 14px;
}

#banSideClose{
    background: transparent;
    border:none;
    color:#fff !important;
    font-size: 16px;
    cursor:pointer;
}

.banBody{
    padding: 12px;
    overflow-y:auto;
    flex:1;
}

#banList{
    display:flex;
    flex-direction: column;
    gap:8px;
}

.banItem{
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 10px;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap:10px;
}

.banNick{
    font-weight:900;
    font-size: 13px;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.banBtn{
    padding: 7px 10px;
    border:none;
    border-radius: 10px;
    cursor:pointer;
    font-weight:900;
    background:#06b6d4;
    color:#fff !important;
    font-size: 12px;
}

.banEmpty{
    opacity:.75;
    font-size:13px;
    color:#c9d3dd !important;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 768px){
    .container{
        flex-direction:column;
        gap:10px;
        padding:8px;
    }

    #userPanel{
        width:100%;
        height:200px !important;
    }

    #chatArea{
        height: calc(100vh - 50px - 60px - 210px) !important;
        padding-right:0;
    }
}
