/* ============================================
   SahinOS — Chat Rooms (mIRC Style)
   ============================================ */

.cr-app {
    width: 100%; height: 100%;
    background: #0d0d1a;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: #c8c8dc;
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}

.cr-screen {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    position: absolute; top: 0; left: 0;
}

/* ── Giriş Ekranı ── */
.cr-login {
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #16213e 100%);
}

.cr-login-box {
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
    padding: 40px 50px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.cr-logo {
    font-size: 22px; font-weight: 700;
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74,222,128,0.3);
}

.cr-login-subtitle {
    font-size: 11px; color: #666;
    margin-bottom: 8px;
}

/* ── Genel Elemanlar ── */
.cr-input {
    background: #111122; border: 1px solid #2a2a4a;
    color: #e0e0f0; padding: 10px 14px;
    border-radius: 8px; font-size: 13px;
    font-family: inherit; width: 220px;
    outline: none; transition: border-color 0.2s;
}
.cr-input:focus { border-color: #4ade80; }

.cr-btn {
    padding: 8px 18px; border: none;
    border-radius: 8px; cursor: pointer;
    font-family: inherit; font-size: 13px;
    font-weight: 600; transition: all 0.2s;
}

.cr-btn-primary {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #0d1a0d;
}
.cr-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(74,222,128,0.3); }

.cr-btn-sm {
    padding: 5px 12px; font-size: 11px;
    background: rgba(255,255,255,0.08); color: #aab;
    border: 1px solid rgba(255,255,255,0.1);
}
.cr-btn-sm:hover { background: rgba(255,255,255,0.15); }

.cr-btn-send {
    background: #4ade80; color: #0d1a0d;
    padding: 8px 16px;
}
.cr-btn-send:hover { background: #22c55e; }

/* ── Lobi ── */
.cr-lobby { background: #0d0d1a; }

.cr-lobby-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cr-lobby-title { font-size: 14px; font-weight: 600; color: #4ade80; }
.cr-lobby-user { font-size: 12px; color: #888; }

.cr-lobby-body {
    display: flex; flex: 1; overflow: hidden;
}

.cr-lobby-rooms {
    flex: 1; padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto;
}

.cr-lobby-online {
    width: 180px; padding: 12px;
    border-left: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
}

.cr-room-card {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    cursor: pointer; transition: all 0.2s;
}
.cr-room-card:hover {
    background: rgba(74,222,128,0.08);
    border-color: rgba(74,222,128,0.3);
    transform: translateX(4px);
}

.cr-room-icon { font-size: 20px; }
.cr-room-label { flex: 1; font-size: 14px; font-weight: 500; }
.cr-room-users { font-size: 12px; color: #888; }

.cr-panel-title {
    font-size: 11px; font-weight: 600;
    color: #888; text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px; margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cr-online-total { font-size: 12px; color: #4ade80; margin-top: 4px; }

/* ── Sohbet Odası ── */
.cr-chat { background: #0d0d1a; }

.cr-chat-header {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cr-room-name { font-size: 14px; font-weight: 600; color: #4ade80; flex: 1; }
.cr-room-count { font-size: 12px; color: #888; }

.cr-chat-body {
    display: flex; flex: 1; overflow: hidden;
}

.cr-users-panel {
    width: 150px; padding: 10px;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    flex-shrink: 0;
}

.cr-user-item {
    font-size: 12px; padding: 3px 0;
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
}

.cr-messages-panel {
    flex: 1; display: flex; flex-direction: column;
    min-width: 0;
}

.cr-messages {
    flex: 1; overflow-y: auto;
    padding: 10px 12px;
    display: flex; flex-direction: column;
    gap: 2px;
}

.cr-msg {
    font-size: 13px; line-height: 1.5;
    padding: 2px 0; word-wrap: break-word;
}

.cr-msg-system {
    color: #666; font-style: italic;
    font-size: 11px; padding: 4px 0;
}

.cr-msg-sys-text { color: #888; }

.cr-msg-time {
    color: #555; font-size: 11px;
    margin-right: 6px;
}

.cr-msg-nick {
    font-weight: 700; font-size: 13px;
}

.cr-msg-text { color: #ddd; }

.cr-msg-img {
    margin-top: 4px;
}
.cr-msg-img img {
    max-width: 250px; max-height: 200px;
    border-radius: 6px; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: max-width 0.3s, max-height 0.3s;
}
.cr-msg-img img.cr-img-full {
    max-width: 100%; max-height: 500px;
}

/* ── Mesaj Giriş Barı ── */
.cr-input-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.cr-msg-input {
    flex: 1; width: auto;
}

.cr-img-btn {
    cursor: pointer; font-size: 18px;
    padding: 4px 8px; border-radius: 6px;
    transition: background 0.2s;
}
.cr-img-btn:hover { background: rgba(255,255,255,0.08); }

.cr-img-preview {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.04);
}

.cr-img-preview img {
    height: 40px; border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

.cr-img-remove {
    background: rgba(239,68,68,0.2); border: none;
    color: #ef4444; cursor: pointer;
    width: 24px; height: 24px; border-radius: 50%;
    font-size: 12px; display: flex;
    align-items: center; justify-content: center;
}
.cr-img-remove:hover { background: rgba(239,68,68,0.4); }

/* ── Scrollbar ── */
.cr-messages::-webkit-scrollbar,
.cr-users-panel::-webkit-scrollbar,
.cr-lobby-rooms::-webkit-scrollbar,
.cr-lobby-online::-webkit-scrollbar {
    width: 4px;
}
.cr-messages::-webkit-scrollbar-thumb,
.cr-users-panel::-webkit-scrollbar-thumb,
.cr-lobby-rooms::-webkit-scrollbar-thumb,
.cr-lobby-online::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ── Responsive / Mobil ── */
@media (max-width: 600px) {
    .cr-users-panel { display: none; }
    .cr-lobby-online { display: none; }
    .cr-lobby-rooms { padding: 8px; }
    .cr-room-card { padding: 12px 14px; }
    .cr-login-box { padding: 30px 24px; width: 85%; }
    .cr-input { width: 100%; box-sizing: border-box; }
    .cr-msg-input { font-size: 16px !important; }
}
