* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f1f5f9;
    color: #111827;
}

.chat-layout {
    width: 100%;
    height: 100vh;
    display: flex;
}


/*
|--------------------------------------------------------------------------
| ÃœYE LÄ°STESÄ°
|--------------------------------------------------------------------------
*/

.members {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
}

.members-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.members-header h2 {
    margin: 0;
    font-size: 20px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.member-item:hover {
    background: #f8fafc;
}

.member-item.active {
    background: #e0f2fe;
}

.member-avatar,
.header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-weight: bold;
}

.member-avatar img,
.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info {
    min-width: 0;
}

.member-info strong {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-info span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}


/*
|--------------------------------------------------------------------------
| CHAT
|--------------------------------------------------------------------------
*/

.chat-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.chat-header {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
}

.header-user h1 {
    margin: 0;
    font-size: 17px;
}

.header-user span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}


/*
|--------------------------------------------------------------------------
| MESAJLAR
|--------------------------------------------------------------------------
*/

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    width: fit-content;
    max-width: 70%;
    padding: 10px 13px;
    margin-bottom: 10px;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.message.mine {
    margin-left: auto;
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.other {
    margin-right: auto;
    background: white;
    border-bottom-left-radius: 4px;
}

.message-username {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    opacity: .8;
}

.message-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.message-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.message-time {
    font-size: 10px;
    opacity: .65;
}

.seen-status {
    font-size: 13px;
    color: rgba(255, 255, 255, .8);
}

.seen-status.seen {
    color: #7dd3fc;
}


/*
|--------------------------------------------------------------------------
| FORM
|--------------------------------------------------------------------------
*/

.message-form {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.message-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

.message-form input:focus {
    border-color: #2563eb;
}

.message-form button {
    border: 0;
    border-radius: 10px;
    padding: 0 20px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

.message-form button:hover {
    background: #1d4ed8;
}

.message-form button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    color: #64748b;
    padding: 30px;
}


/*
|--------------------------------------------------------------------------
| MOBÄ°L
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {

    .members {
        width: 75px;
    }

    .members-header h2 {
        font-size: 0;
    }

    .members-header h2::after {
        content: "ðŸ’¬";
        font-size: 24px;
    }

    .member-item {
        justify-content: center;
        padding: 12px 5px;
    }

    .member-info {
        display: none;
    }

    .message {
        max-width: 85%;
    }

}
/*
|--------------------------------------------------------------------------
| QUIZ / LİDERLİK TABLOSU
|--------------------------------------------------------------------------
*/

.quiz-sidebar {
    width: 250px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.quiz-header {
    padding: 18px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );
    color: white;
}

.quiz-header h2 {
    margin: 0;
    font-size: 18px;
}

.quiz-my-score {
    margin-top: 8px;
    font-size: 13px;
    opacity: .9;
}

.quiz-my-score strong {
    font-size: 18px;
}

.quiz-ranking {
    padding: 12px;
}

.quiz-ranking-title {
    font-size: 13px;
    font-weight: bold;
    color: #64748b;
    margin: 4px 6px 10px;
}

.quiz-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    margin-bottom: 5px;
    border-radius: 10px;
    background: #f8fafc;
}

.quiz-player.me {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.quiz-rank {
    width: 25px;
    text-align: center;
    font-weight: bold;
    color: #64748b;
    flex-shrink: 0;
}

.quiz-player:first-child .quiz-rank {
    color: #f59e0b;
}

.quiz-player:nth-child(2) .quiz-rank {
    color: #64748b;
}

.quiz-player:nth-child(3) .quiz-rank {
    color: #b45309;
}

.quiz-player-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-player-score {
    font-size: 12px;
    font-weight: bold;
    color: #2563eb;
    white-space: nowrap;
}

.quiz-empty {
    text-align: center;
    color: #94a3b8;
    padding: 20px 5px;
    font-size: 13px;
}


/*
|--------------------------------------------------------------------------
| MOBİL
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .quiz-sidebar {
        width: 210px;
    }

}

@media (max-width: 700px) {

    .quiz-sidebar {
        display: none;
    }

}
/*
|--------------------------------------------------------------------------
| QUIZ TIMER
|--------------------------------------------------------------------------
*/

.quiz-timer {
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    transition: .2s;
}

.quiz-timer.warning {
    background: #f59e0b;
    color: white;
}

.quiz-timer.danger {
    background: #dc2626;
    color: white;
    animation: quizPulse .8s infinite;
}

@keyframes quizPulse {

    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }

}
.member-status {
    display: flex !important;
    align-items: center;
    gap: 5px;
    color: #16a34a !important;
    font-size: 12px;
    margin-top: 4px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}
/* =========================================================
   ÖZEL SOHBET
========================================================= */

/* Kullanıcı listesinde tıklanabilir görünüm */
.member-item {
    cursor: pointer;
    transition: background-color 0.2s ease,
                transform 0.15s ease;
}

.member-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.member-item:active {
    transform: scale(0.99);
}


/* Aktif özel sohbet */
.member-item.active {
    background-color: rgba(80, 140, 255, 0.15);
}


/* Genel sohbet aktif olduğunda da aynı görünüm */
.member-item[data-chat-type="general"].active {
    background-color: rgba(80, 140, 255, 0.15);
}


/* Üye avatarı */
.member-avatar {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Online durum */
.member-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #8f98a8;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #35d06f;
    display: inline-block;
    box-shadow: 0 0 6px rgba(53, 208, 111, 0.6);
}


/* Chat header avatar */
.header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Mesaj yoksa gösterilen alan */
.messages .loading {
    text-align: center;
    padding: 30px 15px;
    color: #8f98a8;
}


/* Özel sohbet mesaj formu */
.message-form {
    display: flex;
    gap: 10px;
}

.message-form input {
    flex: 1;
}


/* Mobil */
@media (max-width: 768px) {

    .member-item {
        padding: 10px;
    }

    .member-info strong {
        font-size: 14px;
    }

    .member-status {
        font-size: 11px;
    }

    .header-avatar {
        width: 40px;
        height: 40px;
    }

}
/* =========================================================
   MODERN CHAT TASARIMI
   ========================================================= */

body {
    background: #eef2f7;
}

/* ANA CHAT */
.chat-layout {
    height: 100vh;
    background: #eef2f7;
}

/* SOL ÜYE PANELİ */
.members {
    width: 290px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
}

.members-header {
    padding: 22px 20px;
    background: #ffffff;
}

.members-header h2 {
    font-size: 19px;
    color: #0f172a;
}

/* ÜYE */
.member-item {
    margin: 4px 8px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    transition: all .2s ease;
}

.member-item:hover {
    background: #f1f5f9;
    transform: none;
}

.member-item.active {
    background: #eff6ff;
    box-shadow: inset 3px 0 0 #2563eb;
}

.member-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.member-info strong {
    color: #0f172a;
    font-size: 14px;
}

.member-info span {
    color: #64748b;
}

/* =========================================================
   CHAT ALANI
   ========================================================= */

.chat-container {
    background: #f1f5f9;
}

/* CHAT HEADER */
.chat-header {
    height: 76px;
    padding: 0 24px;
    background: rgba(255,255,255,.95);
    border-bottom: 1px solid #e2e8f0;
}

.header-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    box-shadow: 0 4px 12px rgba(37,99,235,.18);
}

.header-user h1 {
    color: #0f172a;
    font-size: 17px;
}

.header-user span {
    color: #64748b;
}

/* =========================================================
   MESAJLAR
   ========================================================= */

.messages {
    padding: 24px;
}

/* MESAJ BALONU */
.message {
    position: relative;
    max-width: min(70%, 650px);
    padding: 11px 14px;
    margin-bottom: 12px;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(15,23,42,.06);
    animation: messageIn .18s ease-out;
}

.message.mine {
    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );
    border-bottom-right-radius: 5px;
}

.message.other {
    background: #ffffff;
    border-bottom-left-radius: 5px;
    border: 1px solid #e5e7eb;
}

/* KULLANICI ADI */
.message-username {
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.message.mine .message-username {
    color: rgba(255,255,255,.85);
}

/* MESAJ */
.message-text {
    font-size: 14px;
    line-height: 1.5;
}

/* ALT KISIM */
.message-bottom {
    margin-top: 6px;
    gap: 5px;
}

.message-time {
    font-size: 10px;
}

/* GÖRÜLDÜ */
.seen-status {
    font-size: 13px;
    font-weight: bold;
    color: rgba(255,255,255,.65);
}

.seen-status.seen {
    color: #7dd3fc;
}

/* =========================================================
   MESAJ FORMU
   ========================================================= */

.message-form {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.message-form input {
    height: 46px;
    padding: 0 16px;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    transition: .2s;
}

.message-form input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.message-form button {
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.message-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, .25);
}

.message-form button:active {
    transform: translateY(0);
}

.message-form button:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   QUIZ SIDEBAR
========================================================= */

.quiz-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
}

.quiz-header {
    padding: 20px;
    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );
    color: #ffffff;
}

.quiz-header h2 {
    margin: 0;
    font-size: 18px;
}

.quiz-timer {
    margin-top: 12px;
    padding: 9px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}

.quiz-timer.warning {
    background: #f59e0b;
}

.quiz-timer.danger {
    background: #dc2626;
    animation: quizPulse .8s infinite;
}

.quiz-my-score {
    margin-top: 10px;
    font-size: 13px;
}

.quiz-my-score strong {
    margin-left: 5px;
    font-size: 18px;
}

.quiz-ranking {
    padding: 14px;
}

.quiz-ranking-title {
    margin-bottom: 10px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.quiz-ranking-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: #f8fafc;
}

.quiz-rank {
    width: 25px;
    text-align: center;
    font-weight: 700;
    color: #64748b;
}

.quiz-player-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 600;
}

.quiz-player-score {
    color: #2563eb;
    font-size: 13px;
}

.quiz-empty {
    padding: 20px 5px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

@keyframes quizPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}


/* =========================================================
   MESAJ ANİMASYONU
========================================================= */

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   SCROLLBAR
========================================================= */

.members::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.quiz-sidebar::-webkit-scrollbar {
    width: 7px;
}

.members::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.quiz-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.members::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track,
.quiz-sidebar::-webkit-scrollbar-track {
    background: transparent;
}


/* =========================================================
   MOBİL
========================================================= */

@media (max-width: 900px) {

    .quiz-sidebar {
        width: 210px;
    }

    .members {
        width: 240px;
    }

}

@media (max-width: 700px) {

    .members {
        width: 70px;
    }

    .members-header {
        padding: 18px 10px;
        text-align: center;
    }

    .members-header h2 {
        font-size: 0;
    }

    .members-header h2::after {
        content: "💬";
        font-size: 24px;
    }

    .member-item {
        justify-content: center;
        margin: 4px;
        padding: 10px 5px;
    }

    .member-info {
        display: none;
    }

    .message {
        max-width: 85%;
    }

    .messages {
        padding: 14px;
    }

    .chat-header {
        padding: 0 14px;
    }

    .message-form {
        padding: 10px;
    }

    .message-form button {
        padding: 0 14px;
    }

    .quiz-sidebar {
        display: none;
    }

}

