/* #FunnyPaki Modern Mibbit WebIRC Complete Stylesheet */

:root {
  --header-bg: #0e6231;
  --header-text: #ffffff;
  --tab-bg: #0b4f27;
  --tab-active-bg: #15803d;
  --viewport-bg: #ffffff;
  --sidebar-bg: #f8fafc;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-green: #15803d;
  --accent-green-hover: #166534;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
  font-size: 14px;
  background-color: #FAF0D7;
  color: #1e293b;
  overflow: hidden;
  overscroll-behavior: none !important;
  overscroll-behavior-y: none !important;
}


.pakichat-app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* --- HEADER BAR (Deep Green #0e6231) --- */
.pakichat-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 10px;
  flex-shrink: 0;
}

.header-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.pakichat-tabs {
  display: flex;
  list-style: none;
  gap: 4px;
}

.pakichat-tab {
  background-color: var(--tab-bg);
  color: #d1fae5;
  padding: 5px 12px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.15s ease;
}

.pakichat-tab:hover {
  background-color: #116e38;
}

.pakichat-tab.active {
  background-color: var(--tab-active-bg);
  color: #ffffff;
}

.tab-label {
  pointer-events: none;
}

.tab-close {
  font-size: 14px;
  line-height: 1;
  color: #a7f3d0;
  border-radius: 50%;
  padding: 0 3px;
  cursor: pointer;
}

.tab-close:hover {
  color: #ffffff;
  background-color: rgba(255,255,255,0.25);
}

.unread-count {
  background-color: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
}

.btn-add-tab {
  background: transparent;
  border: none;
  color: #a7f3d0;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

.header-right-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nick-display {
  font-weight: 700;
  color: #ffffff;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.badge-owner { background-color: #ef4444; color: white; }
.badge-admin { background-color: #8b5cf6; color: white; }
.badge-reg { background-color: #10b981; color: white; }
.badge-guest { background-color: #64748b; color: white; }

.btn {
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid transparent;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 11px;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-outline-white {
  background: transparent;
  border-color: rgba(255,255,255,0.3);
  color: white;
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.15);
}

.btn-outline {
  background: white;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f1f5f9;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
}

.btn-success {
  background-color: #10b981;
  color: white;
}

.btn-primary {
  background-color: var(--accent-green);
  color: white;
}

/* --- MAIN WORKSPACE SPLIT --- */
.pakichat-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.pakichat-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--viewport-bg);
  border-right: 1px solid var(--border-color);
}

/* Topic Header Bar */
.chat-topic-bar {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topic-info h2 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-badge {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.topic-text {
  font-size: 12px;
  color: #475569;
  display: block;
}

.window-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Theme Dropdown Selector Control */
.theme-select-dropdown {
  background: white;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: bold;
  font-size: 11px;
  cursor: pointer;
  outline: none;
}

.theme-select-dropdown:hover {
  background: #f1f5f9;
}

/* ☕ Theme: Vintage Java Theme (Exact Screenshot Column Separators & Typography) */
body.theme-vintage .avatar-badge { display: none !important; }
body.theme-vintage .arrow-sep { display: none !important; }
body.theme-vintage .u-sticker { display: inline-block !important; }

body.theme-vintage .chat-logs-viewport {
  background-color: #FAF2DA !important;
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif !important;
}

body.theme-vintage .chat-line {
  background-color: #FAF2DA !important;
  border-bottom: 1.5px solid #3b4cb8 !important;
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif !important;
  align-items: stretch !important;
  padding: 0 !important;
}

body.theme-vintage .time-col {
  display: flex !important;
  background-color: #009bee !important;
  color: #001e38 !important;
  padding: 4px 6px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  width: 60px !important;
  text-align: center !important;
  border-right: 1.5px solid #3b4cb8 !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0 !important;
}

body.theme-vintage .nick-col {
  display: flex !important;
  background-color: #FAF2DA !important;
  border-right: 1.5px solid #3b4cb8 !important;
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  padding: 4px 8px !important;
  flex-shrink: 0 !important;
  min-width: 110px !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

body.theme-vintage .msg-col {
  display: block !important;
  background-color: #FAF2DA !important;
  color: #400000 !important;
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  padding: 4px 8px !important;
  line-height: 1.35 !important;
}

body.theme-vintage .sys-msg {
  background-color: #FAF2DA !important;
  color: #7c2d12 !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  font-style: italic !important;
  border-top: 1.5px solid #3b4cb8 !important;
  border-bottom: 1.5px solid #3b4cb8 !important;
  margin: 0 !important;
  font-size: 13px !important;
}

/* 💻 Theme: Classic mIRC Theme (Screenshot Match) */
body.theme-classic .time-col { display: none !important; }
body.theme-classic .u-sticker { display: none !important; }
body.theme-classic .avatar-badge {
  display: flex !important;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  flex-shrink: 0;
}
body.theme-classic .arrow-sep {
  display: inline-block !important;
  color: #94a3b8;
  margin: 0 6px;
}

body.theme-classic .chat-logs-viewport {
  background-color: #ffffff !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
}

body.theme-classic .chat-line {
  background-color: #ffffff !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-weight: 500 !important;
  align-items: center !important;
  padding: 4px 8px !important;
}

body.theme-classic .nick-col {
  background-color: #ffffff !important;
  border-right: none !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  min-width: auto !important;
  padding: 0 !important;
}

body.theme-classic .msg-col {
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-weight: 400 !important;
  padding: 0 !important;
}

body.theme-classic .sys-msg {
  background-color: #f8fafc !important;
  color: #0284c7 !important;
  border-top: none !important;
  border-bottom: none !important;
}

body.theme-classic .pakichat-userlist-panel {
  background-color: #f8fafc !important;
  border-left: 1px solid #e2e8f0 !important;
}

body.theme-classic .userlist-header {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}

body.theme-classic .rank-group-title {
  background-color: #000000 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  padding: 8px 6px 4px 6px !important;
  text-transform: uppercase !important;
  letter-spacing: normal !important;
}

/* 🌙 Theme: Dark Mode Theme */
body.theme-dark .time-col { display: none !important; }
body.theme-dark .u-sticker { display: none !important; }
body.theme-dark .avatar-badge {
  display: flex !important;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  flex-shrink: 0;
}
body.theme-dark .arrow-sep {
  display: inline-block !important;
  color: #64748b;
  margin: 0 6px;
}

body.theme-dark .chat-logs-viewport {
  background-color: #0f172a !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
}

body.theme-dark .chat-line {
  background-color: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-weight: 500 !important;
  align-items: center !important;
  padding: 4px 8px !important;
}

body.theme-dark .nick-col {
  background-color: #0f172a !important;
  border-right: none !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  min-width: auto !important;
  padding: 0 !important;
}

body.theme-dark .msg-col {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-weight: 400 !important;
  padding: 0 !important;
}

body.theme-dark .sys-msg {
  background-color: #1e293b !important;
  color: #38bdf8 !important;
  border-top: none !important;
  border-bottom: none !important;
}

body.theme-dark .pakichat-userlist-panel {
  background-color: #1e293b !important;
  border-left: 1px solid #334155 !important;
}

body.theme-dark .userlist-header,
body.theme-dark .rank-group-title {
  background-color: #0f172a !important;
  color: #22c55e !important;
}

body.theme-dark .u-nick {
  color: #e2e8f0 !important;
}

/* Chat Logs Viewport (Exact Soft Cream Background #FAF2DA) */
.chat-logs-viewport {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: #FAF2DA;
}

.chat-window {
  display: none;
  flex-direction: column;
  gap: 0;
}

.chat-window.active {
  display: flex;
}

/* Screenshot Row Layout: [22:54 (Cyan)] | [Nick :] | [Message Text] with single solid indigo line */
.chat-line {
  display: flex;
  align-items: stretch;
  padding: 0;
  border-bottom: 1.5px solid #3b4cb8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  background-color: #FAF2DA;
}

.time-col {
  background-color: #009bee;
  color: #001e38;
  padding: 3px 6px;
  font-weight: 700;
  font-size: 13px;
  width: 60px;
  text-align: center;
  border-right: 1px solid #7c83c3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nick-col {
  font-weight: 700;
  font-size: 14px;
  padding: 3px 8px;
  flex-shrink: 0;
  min-width: 105px;
  text-align: right;
  border-right: 1px solid #7c83c3;
  background-color: #FAF2DA;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
}

.nick-col:hover {
  text-decoration: underline;
}

.msg-col {
  color: #400000;
  flex: 1;
  padding: 3px 8px;
  word-break: break-word;
  line-height: 1.35;
  font-weight: 700;
  font-size: 14px;
  background-color: #FAF2DA;
}

/* PROMINENT EMOJI SIZING */
.msg-col .emoji-char {
  font-size: 1.25em;
  vertical-align: -0.12em;
  display: inline-block;
  line-height: 1;
  margin: 0 1px;
}

/* System Message Line (Matching Screenshot given-voice lines) */
.sys-msg {
  color: #7c2d12;
  font-weight: 700;
  padding: 4px 10px;
  font-style: italic;
  background-color: #FAF2DA;
  border-top: 1.5px solid #3b4cb8;
  border-bottom: 1.5px solid #3b4cb8;
  margin: 0;
  font-size: 13px;
}

.sys-msg.error { color: #dc2626; }
.sys-msg.warning { color: #d97706; }
.sys-msg.success { color: #16a34a; }
.sys-msg.join { color: #16a34a; }
.sys-msg.part { color: #ea580c; }
.sys-msg.kick { color: #dc2626; }

/* Formatting & Input Box */
.pakichat-input-container {
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.formatting-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-bottom: 1px solid #edf2f7;
}

.btn-fmt {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.btn-fmt:hover {
  background: #f1f5f9;
}

.btn-fmt.active {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.input-line {
  display: flex;
  padding: 8px 10px;
  gap: 8px;
}

.input-line input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

.input-line input:focus {
  border-color: var(--accent-green);
}

.btn-send-green {
  background-color: var(--accent-green);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-send-green:hover {
  background-color: var(--accent-green-hover);
}

/* --- RIGHT SIDEBAR (CLASSIC PEACH USER LIST WITH BLACK RANK BARS) --- */
.pakichat-userlist-panel {
  width: 200px;
  background-color: #FDE3C4;
  border-left: 2px solid #7c83c3;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.userlist-header {
  padding: 6px 10px;
  background-color: #000000;
  color: #86efac;
  border-bottom: 1px solid #FAF0D7;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  text-transform: uppercase;
}

.user-list-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

/* Black Rank Header Bar with Bright Light Green Text (Owner, Admin, Op, Voice) */
.rank-group-title {
  font-size: 14px;
  font-weight: 700;
  background-color: #000000;
  color: #86efac;
  text-align: center;
  padding: 3px 6px;
  margin: 4px 0 2px 0;
  border-radius: 2px;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.user-list {
  list-style: none;
  margin-bottom: 4px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px dotted #e5c099;
}

.user-item:hover {
  background-color: #fbcfe8;
}

.u-icon {
  font-size: 13px;
}

.u-nick {
  font-weight: 700;
  font-size: 14px;
  color: #4c1d95;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.u-sticker {
  font-size: 14px;
  margin-left: 2px;
}

/* --- BOTTOM SKY-BLUE CHANNEL STATUS BAR --- */
.bottom-status-bar {
  background-color: #00a2e8;
  color: #ffffff;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #0077b6;
  flex-shrink: 0;
}

.bottom-channels {
  display: flex;
  gap: 6px;
}

.bottom-channels span {
  color: #ffffff;
  cursor: pointer;
  user-select: none;
}

.bottom-channels span:hover {
  text-decoration: underline;
}

.bottom-help {
  color: #ffffff;
  cursor: pointer;
  user-select: none;
}

.bottom-help:hover {
  text-decoration: underline;
}

/* EMOJI PICKER POPUP */
.emoji-picker {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 260px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 100;
}

.emoji-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 6px;
}

.emoji-close {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  font-size: 20px;
  cursor: pointer;
  text-align: center;
}

.emoji-grid span:hover {
  transform: scale(1.2);
}

/* CONTEXT MENU */
.context-menu {
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  border-radius: 8px;
  width: 195px;
  z-index: 1000;
  padding: 4px 0;
  font-size: 12px;
}

.context-header {
  padding: 6px 10px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  background-color: #f8fafc;
}

.context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.context-menu li {
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.context-menu li:hover {
  background-color: #f1f5f9;
  color: var(--accent-green);
}

.context-menu li.separator {
  height: 1px;
  background-color: var(--border-color);
  margin: 3px 0;
  padding: 0;
}

.context-menu li.danger:hover {
  background-color: #fee2e2 !important;
  color: #dc2626 !important;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-dialog {
  background: white;
  width: 440px;
  max-width: 90%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-dialog.modal-lg {
  width: 780px;
}

.modal-header {
  background-color: var(--header-bg);
  color: white;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 14px;
  max-height: 75vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.tab-group, .admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
}

.tab-btn, .adm-tab {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active, .adm-tab.active {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.admin-panel-sec {
  display: none;
}

.admin-panel-sec.active {
  display: block;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}

.data-table th, .data-table td {
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  text-align: left;
}

.data-table th {
  background-color: #f8fafc;
  font-weight: 700;
}

.full-width {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* --- FRONT LOGIN OVERLAY (Exact Match to User Screenshot) --- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #eaf0f6;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-card {
  background: #ffffff;
  width: 90%;
  max-width: 440px;
  padding: 40px 36px 44px 36px;
  border-radius: 16px;
  border: 1.5px solid #13793c;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-title {
  font-size: 32px;
  font-weight: 800;
  color: #000000;
  margin: 0 0 12px 0;
  letter-spacing: -0.5px;
  text-align: center;
}

.login-title-bar {
  width: 55px;
  height: 4.5px;
  background-color: #0e6231;
  border-radius: 3px;
  margin-bottom: 32px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  width: 100%;
}

.login-field label {
  font-size: 14px;
  font-weight: 600;
  color: #555555;
}

.login-field input {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  border: 1.5px solid #13793c;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: #222222;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-field input::placeholder {
  color: #999999;
}

.login-field input:focus {
  border-color: #0e6231;
  box-shadow: 0 0 0 3px rgba(14, 98, 49, 0.15);
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 44px;
}

.toggle-eye-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 19px;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.toggle-eye-btn:hover {
  opacity: 1;
}

.login-connect-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background-color: #0e6231;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.2s, transform 0.1s;
}

.login-connect-btn:hover {
  background-color: #0b4e27;
}

.login-connect-btn:active {
  transform: scale(0.99);
}

.login-connect-btn.connecting {
  background-color: #083c1d;
  opacity: 0.9;
  cursor: wait;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner-icon {
  display: inline-block;
  animation: spinPulse 1s infinite ease-in-out;
}

@keyframes spinPulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.7; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 0.7; }
}

/* --- TEXT & BACKGROUND COLOR PICKER MODAL --- */
.color-picker-modal {
  position: absolute;
  bottom: 85px;
  left: 20px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  width: 320px;
  z-index: 1000;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: fadeIn 0.2s ease-in-out;
}

.color-picker-header {
  background-color: var(--header-bg);
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
}

.color-picker-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.color-picker-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.color-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  box-shadow: 0 0 0 3px #15803d, 0 0 0 4px #ffffff;
}

.color-preview-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-preview-box {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
  background-color: #ffffff;
  color: #000000;
  word-break: break-word;
}

.color-picker-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-color-apply {
  flex: 1;
  padding: 8px;
  background-color: var(--accent-green);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-color-apply:hover {
  background-color: var(--accent-green-hover);
}

.btn-color-clear {
  flex: 1;
  padding: 8px;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-color-clear:hover {
  background-color: #e2e8f0;
}

.msg-text-colored {
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* --- LOGIN ALERT BANNER (KICK / BAN / KILL NOTICES) --- */
.login-alert-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  animation: fadeIn 0.3s ease-in-out;
}

.login-alert-banner.kick {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.login-alert-banner.ban {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.login-alert-banner.kill {
  background-color: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* --- ADAPTIVE MOBILE UI & THEME ENGINE --- */
.mobile-only { display: none !important; }

@media (max-width: 768px) {
  .mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }

  html, body {
    height: 100dvh;
    min-height: -webkit-fill-available;
    overflow: hidden;
  }

  .pakichat-app-container {
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .pakichat-header {
    height: 48px;
    padding: 0 10px;
    background-color: #0e6231;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .header-tabs {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .header-tabs::-webkit-scrollbar { display: none; }

  .header-right-tools {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .nick-display {
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .badge-guest, .badge-reg, .badge-admin, .badge-owner {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Chat Workspace */
  .pakichat-workspace {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
  }

  .pakichat-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
  }

  .chat-topic-bar {
    padding: 6px 10px;
    font-size: 12px;
    background: #f8fafc;
  }

  .topic-info h2 {
    font-size: 13px;
  }

  .topic-text {
    font-size: 11px;
  }

  .window-actions .btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Floating Bottom Input Dock */
  .pakichat-input-dock {
    padding: 8px 10px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
  }

  .input-toolbar {
    margin-bottom: 6px;
    gap: 6px;
  }

  .input-toolbar .tool-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .input-line {
    gap: 6px;
  }

  #chat-input {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .btn-send-green {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
  }

  /* Mobile User List Slide-Over Drawer */
  .user-list-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2400;
    transition: opacity 0.3s ease;
  }

  .pakichat-userlist-panel {
    position: fixed;
    top: 0;
    right: -280px;
    bottom: 0;
    width: 260px;
    background: #ffffff;
    z-index: 2500;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }

  .pakichat-userlist-panel.mobile-drawer-open {
    right: 0;
  }

  .userlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #0e6231;
    color: white;
  }

  .btn-close-drawer {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
  }

  .emoji-picker, .color-picker-modal {
    width: 92%;
    left: 4%;
    right: 4%;
    bottom: 70px;
    height: 320px;
    max-height: 55vh;
  }

}

/* --- EMOJI PICKER & INLINE CHAT EMOJI ENGINE --- */
.chat-emoji {
  max-height: 28px;
  max-width: 28px;
  vertical-align: middle;
  display: inline-block;
  margin: 0 2px;
  object-fit: contain;
}

.emoji-picker {
  position: absolute;
  bottom: 50px;
  left: 10px;
  width: 380px;
  max-width: 92vw;
  height: 290px;
  background: #ffffff;
  border: 1.5px solid #0e6231;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.emoji-picker.hidden {
  display: none !important;
}

.emoji-header {
  background: #0e6231;
  color: #ffffff;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.emoji-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

#emoji-grid-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.emoji-grid-scrollable {
  flex: 1;
  min-height: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  overflow-y: auto;
  background: #FAF2DA;
}

.emoji-grid-scrollable::-webkit-scrollbar {
  width: 8px;
}
.emoji-grid-scrollable::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.emoji-grid-scrollable::-webkit-scrollbar-thumb {
  background: #0e6231;
  border-radius: 4px;
}
.emoji-grid-scrollable::-webkit-scrollbar-thumb:hover {
  background: #15803d;
}

.emoji-picker-item {
  width: 32px;
  height: 32px;
  object-fit: contain;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.emoji-picker-item:hover {
  transform: scale(1.3);
  background-color: #e2e8f0;
}

/* --- PRO MENTION / NICK HIGHLIGHTING ENGINE --- */
.chat-line.mention-highlight,
.msg-line.mention-highlight {
  background-color: rgba(245, 158, 11, 0.15) !important;
  border-left: 4px solid #f59e0b !important;
  transition: background-color 0.3s ease, border-left 0.3s ease;
}

.chat-line.mention-highlight .avatar-badge,
.msg-line.mention-highlight .msg-nick {
  animation: mention-pulse 1.4s infinite alternate ease-in-out !important;
}

@keyframes mention-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 4px #f59e0b;
  }
  100% {
    transform: scale(1.12);
    box-shadow: 0 0 12px #f59e0b, 0 0 18px rgba(245, 158, 11, 0.6);
  }
}







