/* Modal enhancements for Find Random Opponent and Notifications */

/* Find Random Modal */
#findRandomModal .password-content.find-random-content {
  width: min(900px, 96%);
  background: linear-gradient(180deg,#0c1420 0%, #0b1116 100%);
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 20px 60px rgba(3,6,12,0.75);
  padding: 22px;
  border-radius: 14px;
}

#findRandomModal .password-content.find-random-content h2 { color: #fff; font-size:1.25rem; margin:0; }

#findRandomModal #froSearchInput {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
#findRandomModal #froSearchInput:focus { box-shadow: 0 6px 18px rgba(47,110,255,0.12); transform: translateY(-1px); }

#findRandomModal .fro-tab {
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  border:1px solid rgba(255,255,255,0.03);
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
}
#findRandomModal .fro-tab.fro-tab-active {
  background: linear-gradient(180deg,#1b2b3a,#14202a);
  color:var(--text);
  border-color: rgba(110,168,254,0.14);
  box-shadow: 0 8px 22px rgba(20,30,60,0.45);
}

#froList {
  background: transparent !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.04) !important;
  padding:8px !important;
  color: var(--text) !important;
}
#froList .live-loading { color: var(--muted); display:flex; gap:8px; align-items:center; padding:12px; }
#froList .live-dot { width:8px;height:8px;border-radius:999px;background:#0b8457;display:inline-block;margin-right:6px; }

#froList .fro-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.02);
  margin-bottom: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  overflow: hidden;
}
#froList .fro-user-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(9,18,30,0.6);
  border-color: rgba(110,168,254,0.08);
}

.fro-left { display:flex; align-items:center; gap:12px; min-width:0; }
.fro-handle-name { font-weight:800; color: var(--text); font-size:1rem; display:flex; align-items:center; gap:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fro-sub { color: var(--muted); font-size:0.9rem; display:flex; gap:8px; align-items:center; }
.fro-rating-combined { display:inline-flex; align-items:center; gap:6px; }
.fro-rating-cur { color: var(--text); font-weight:700; font-size:0.92rem; }
.fro-rating-sep { color: var(--text); }
.fro-rating-max { color: var(--text); font-weight:700; font-size:0.92rem; }
.fro-lastseen { color: var(--muted); font-size:0.88rem; margin-left:6px; }
.fro-lastseen[title] { cursor: help; }
.fro-rating-cur { color: var(--muted); font-weight:700; font-size:0.92rem; }
.fro-rating-sep { color: var(--muted); }
.fro-active-dot { width:10px; height:10px; border-radius:999px; background:#32d583; display:inline-block; box-shadow: 0 0 0 4px rgba(50,213,131,0.06); }

.fro-right { display:flex; align-items:center; gap:8px; flex-shrink:0; min-width:88px; justify-content:flex-end; }
.fro-invite-btn, .fro-select-btn { display:inline-flex; padding:6px 12px; border-radius:10px; border:none; background: linear-gradient(180deg,#79afff,#5a94ef); color:#071325; font-weight:800; cursor:pointer; transition: opacity 160ms ease, transform 120ms ease, box-shadow 120ms ease; opacity:0; visibility:hidden; pointer-events:none; }
.fro-user-row:hover .fro-invite-btn, .fro-user-row:hover .fro-select-btn { opacity:1; visibility:visible; pointer-events:auto; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37,99,235,0.12); }

/* Highlighted / picked row (manual pick or auto pick) */
#froList .fro-user-row.fro-picked {
  border-color: rgba(110,168,254,0.18);
  box-shadow: 0 18px 36px rgba(20,30,60,0.6);
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(110,168,254,0.02), rgba(255,255,255,0.01));
}

/* Live Pairing UI inside the froList */
#froList .fro-live-center { display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:220px;padding:18px;gap:12px;color:var(--muted); }
#froList .fro-pair-btn { padding:12px 18px;border-radius:12px;background: linear-gradient(180deg,#79afff,#5a94ef); color:#071325; font-weight:800; border:none; cursor:pointer; }
#froList .fro-live-status {
  color: var(--text);
  font-size: 0.95rem;
  text-align: center;
  position: -webkit-sticky;
  position: sticky;
  top: 8px; /* align with froList padding */
  z-index: 6;
  width: calc(100% - 16px);
  margin: 0 auto;
  padding: 6px 8px;
  background: linear-gradient(180deg,#071325,#08121a);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(3,6,12,0.6);
}
#froList .fro-vs { display:flex;gap:18px;align-items:center;justify-content:center; }
#froList .fro-vs .player { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); padding:10px 14px; border-radius:10px; border:1px solid rgba(255,255,255,0.02); min-width:120px; text-align:center; }
#froList .fro-vs .player .name { font-weight:800; color:var(--text); }
#froList .fro-vs .player .meta { color:var(--muted); font-size:0.9rem; }

#findRandomModal input[type="number"] { background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.04); color:var(--text); padding:6px 8px; border-radius:8px; width:84px; }
#findRandomModal #froIncludeAllBtn { background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.03); color:var(--muted); padding:6px 10px; border-radius:8px; }

#findRandomModal .primary-btn { padding:10px 16px; border-radius:12px; box-shadow: 0 12px 30px rgba(46,185,132,0.14); }
#findRandomModal .cancel-btn { background: transparent; border:1px solid rgba(255,255,255,0.04); color:var(--muted); padding:8px 12px; border-radius:10px; }

/* When buttons are visually dimmed/disabled inside the Find Random modal,
   show a not-allowed cursor and slightly reduce opacity for clarity. */
#findRandomModal button:disabled,
#findRandomModal .primary-btn:disabled,
#findRandomModal .fro-pair-btn:disabled,
#findRandomModal .cancel-btn:disabled,
#findRandomModal .nav-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Notifications modal styles moved to /css/notifications.css */

@media (max-width:640px){
  #findRandomModal .password-content.find-random-content { padding:12px; }
  #findRandomModal #froSearchInput{ width:140px; }
  #froList .fro-user-row { padding:10px; }
}

/* Negotiation problems preview and chat styles */
#froProblemsPreview table { width:100%; border-collapse:collapse; }
#froProblemsPreview td { padding:6px 8px; }
#froProblemsPreview tr td { border-color: transparent; }

#froChatContainer { background: linear-gradient(180deg,#071325,#08121a); display:flex; flex-direction:column; gap:6px; padding:8px; border-radius:6px; overflow:auto; }
.fro-chat-msg { max-width:78%; padding:8px 10px; border-radius:12px; box-sizing:border-box; word-break:break-word; font-size:13px; }
.fro-chat-msg.sent { align-self:flex-end; background: linear-gradient(180deg,#79afff,#5a94ef); color:#071325; text-align:right; }
.fro-chat-msg.recv { align-self:flex-start; background: rgba(255,255,255,0.02); color:var(--text); text-align:left; }
.fro-chat-msg div { line-height:1.25; }
.fro-chat-msg > div:last-child { font-size:11px; color:var(--muted); margin-top:6px; }

/* Report button shown when hovering a chat message */
.fro-chat-msg { position: relative; }
.fro-report-btn {
  position: absolute;
  right: 8px;
  top: 6px;
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(180deg,#ff7b7b,#ff4d4d);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  border: none;
  box-shadow: 0 6px 16px rgba(255,80,80,0.18);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
  cursor: pointer;
  z-index: 3;
}
.fro-chat-msg:hover .fro-report-btn { opacity: 1; transform: translateY(0); }

/* Report modal (modern, accessible redesign) */
.fro-report-modal {
  --modal-gap: 12px;
  --modal-padding: 20px;
  --modal-radius: 14px;
  --modal-shadow: 0 20px 60px rgba(3,6,12,0.75);
  --card-bg: linear-gradient(180deg,#071325,#08121a);
  position: fixed !important;
  z-index: 2147483670 !important;
  inset: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(10,12,14,0.36); /* soft overlay */
  padding: 20px; /* breathing room on small viewports */
  overflow: auto; /* allow scrolling when content is larger than viewport */
  -webkit-font-smoothing: antialiased;
}

.fro-report-modal .fro-report-card {
  width: min(720px, 92%);
  max-width: 920px;
  max-height: calc(100vh - 64px);
  overflow: auto; /* ensure the card itself scrolls rather than the whole page */
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.04);
  padding: var(--modal-padding);
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  box-sizing: border-box;
  margin: auto;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.fro-report-modal .fro-report-card h3 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 1.125rem; /* slightly larger */
  font-weight: 800;
  line-height: 1.15;
}

.fro-report-modal .fro-report-card header { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px }

.fro-report-modal .fro-report-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 12px;
}

.fro-report-modal .fro-report-meta > strong { display:block; color: var(--muted); font-weight:700; margin-bottom:6px; font-size:0.92rem }
.fro-report-modal .fro-report-meta > div { color: var(--ink); font-weight:600 }

.fro-report-modal .fro-report-row { margin-bottom: 12px; }
.fro-report-modal .fro-report-row strong { display:block; color: var(--muted); font-weight:700; margin-bottom:8px; font-size:0.95rem }
.fro-report-modal .fro-report-message,
.fro-report-modal .fro-report-details {
  background: rgba(255,255,255,0.02);
  padding: 12px;
  border-radius: 10px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.04);
}

.fro-report-modal label { display:block; color: var(--muted); margin-bottom:8px }

.fro-report-modal textarea { width:100%; min-height:96px; border-radius:8px; background: rgba(255,255,255,0.02); color:var(--text); border:1px solid rgba(255,255,255,0.04); padding:10px; font-size:15px; line-height:1.4; resize:vertical }

.fro-report-modal select, .fro-report-modal input[type='text'], .fro-report-modal input[type='number'] { background: rgba(255,255,255,0.02); color:var(--text); border:1px solid rgba(255,255,255,0.04); padding:8px 10px; border-radius:8px }

.fro-report-modal .fro-report-card input[type="checkbox"] { width:18px; height:18px; margin-right:8px; accent-color: var(--accent); vertical-align:middle }

.fro-report-modal .fro-report-row label { display:flex; align-items:center; gap:10px; cursor:pointer; color:var(--muted) }

.fro-report-modal .fro-report-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:12px }

.fro-report-modal .fro-edit-propose-btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(16,24,20,0.06);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(19,111,77,0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 120ms ease;
}

.fro-report-modal .fro-edit-propose-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(19,111,77,0.12) }
.fro-report-modal .fro-edit-propose-btn:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 28%, white); outline-offset: 2px }

.fro-report-modal .cancel-btn { background: transparent; border: 1px solid rgba(16,24,20,0.04); padding: 10px 14px; border-radius: 10px; color: var(--muted); cursor: pointer }
.fro-report-modal .cancel-btn:hover { background: rgba(16,24,20,0.02); color: var(--ink) }
.fro-report-modal .cancel-btn:focus-visible { outline: 3px solid rgba(0,0,0,0.06); outline-offset: 2px }

.fro-report-modal .nav-btn { background: transparent; border: none; color: var(--muted); font-size: 16px; padding: 6px; border-radius: 8px; cursor: pointer }
.fro-report-modal .nav-btn:hover { background: rgba(16,24,20,0.02); color: var(--ink) }

/* Focus styles for inputs */
.fro-report-modal input:focus, .fro-report-modal textarea:focus, .fro-report-modal select:focus { box-shadow: 0 0 0 4px rgba(100,150,255,0.09); border-color: rgba(100,150,255,0.6); outline: none }

/* Hide preview remove buttons until the user hovers a problem row */
#froProblemsPreview .preview-remove {
  background: transparent;
  color: var(--danger, #ff7d7d);
  border: 1px solid rgba(255,255,255,0.03);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, transform 120ms ease;
}

#froProblemsPreview tr:hover .preview-remove {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-2px);
}

#froProblemsPreview .preview-remove:disabled { opacity: 0.45; cursor: not-allowed; }

/* Searching animation (typing-like dots) */
.fro-search-anim { display:flex; gap:8px; align-items:center; justify-content:center; margin-bottom:6px; }
.fro-search-magnifier-wrap { width:120px; height:44px; display:flex; align-items:center; justify-content:center; overflow:visible; }
.fro-search-magnifier { width:44px; height:44px; color: #79afff; display:block; transform-origin:center; animation: froMagnifyMove 12000ms infinite ease-in-out; }
.fro-search-magnifier circle { filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45)); }

@keyframes froMagnifyMove {
  0% { transform: translateX(-32px) rotate(-10deg); }
  25% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(32px) rotate(10deg); }
  75% { transform: translateX(0) rotate(0deg); }
  100% { transform: translateX(-32px) rotate(-10deg); }
}

/* Problems summary table on the left (compact single-line rows) */
.fro-problems-summary-table {
  width: auto; /* don't stretch to full width */
  border-collapse: collapse;
  margin: 0 auto; /* center the table */
  display: inline-table;
  font-size: 14px;
}
.fro-problems-summary-table td {
  padding: 4px 6px; /* tighter horizontal spacing */
  font-size: 14px;
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.12;
}
.fro-problems-summary-table tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.fro-problems-summary-table tr:last-child { border-bottom: none; }
.fro-problems-summary-table .fps-left {
  width: 150px;
  padding-right: 4px;
  text-align: left;
  color: var(--text);
  font-weight: 600;
  border-right: 1px solid rgba(255,255,255,0.03); /* vertical separator */
  padding-left: 8px;
}
.fro-problems-summary-table .fps-points {
  width: 64px;
  text-align: center;
  padding: 0 6px;
  color: var(--muted);
  border-right: 1px solid rgba(255,255,255,0.03); /* vertical separator */
}
.fro-problems-summary-table .fps-rating {
  width: 64px;
  text-align: right;
  color: var(--muted);
  padding-right: 6px;
}

/* Edit config modal for modifying problems and duration */
.fro-edit-modal {
  position: fixed;
  z-index: 2147483647 !important; /* force on top of other modals */
  left: 0; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3,6,12,0.64); /* darker overlay for stronger emphasis */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.fro-edit-modal .fro-edit-content {
  position: relative; z-index: 2147483648 !important;
  width: min(640px, 92%);
  max-height: 78vh;
  overflow: auto;
  background: linear-gradient(180deg,#112633,#0f1a20); /* slightly brighter content */
  border: 1px solid rgba(255,255,255,0.06);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(8,16,28,0.45);
}
.fro-edit-modal .fro-edit-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.fro-edit-modal .fro-edit-header h3 { margin:0; color:var(--text); }
.fro-edit-modal .fro-edit-close { background:transparent; border:none; color:var(--muted); font-size:18px; cursor:pointer; }
.fro-edit-modal .fro-edit-body { color:var(--text); }
.fro-edit-modal .fro-edit-actions { display:flex; gap:8px; justify-content:center; margin-top:12px; }
.fro-edit-modal #froEditProposeBtn {
  background: linear-gradient(180deg,#34d399,#10b981);
  color: #072a18;
  border: 1px solid rgba(16,185,129,0.12);
  box-shadow: 0 10px 30px rgba(16,185,129,0.08);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.fro-edit-modal #froEditProposeBtn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(16,185,129,0.14); }
.fro-edit-modal #froEditProposeBtn:active { transform: translateY(0); }
.fro-edit-modal #froEditProposeBtn:disabled { opacity: 0.6; cursor: not-allowed; }
.fro-edit-modal input[type="number"] { background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.04); color:var(--text); padding:6px 8px; border-radius:8px; }
.fro-edit-modal .fro-edit-problems { margin-top:12px; max-height:44vh; overflow:auto; }

/* Style selects in the Find Random / Edit Config UI to match number inputs */
.fro-edit-modal select.preview-rating,
#findRandomModal select.preview-rating,
#froProblemsPreview select.preview-rating {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
  width: 84px;
  text-align: right;
}

/* Ensure option list uses dark theme and visible text in dropdown panels */
.fro-edit-modal select.preview-rating option,
#findRandomModal select.preview-rating option,
#froProblemsPreview select.preview-rating option {
  background: #0b2433 !important;
  color: var(--text) !important;
}
.fro-edit-modal select.preview-rating option:hover,
#findRandomModal select.preview-rating option:hover,
#froProblemsPreview select.preview-rating option:hover {
  background: rgba(110,168,254,0.12) !important;
  color: var(--text) !important;
}
.fro-edit-modal select.preview-rating option:checked,
#findRandomModal select.preview-rating option:checked,
#froProblemsPreview select.preview-rating option:checked {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text) !important;
}

/* Ensure selects inside the report modal show dark dropdown panels */
.fro-report-modal select option {
  background: #071325 !important;
  color: var(--text) !important;
}
.fro-report-modal select option:hover {
  background: rgba(110,168,254,0.12) !important;
  color: var(--text) !important;
}
.fro-report-modal select option:checked {
  /* Keep the selected option using the blue highlight instead of a pale white flash */
  background: rgba(110,168,254,0.22) !important;
  color: #ffffff !important;
}

/* Try to ensure dropdown arrow and text remain visible */
.fro-edit-modal select.preview-rating,
#findRandomModal select.preview-rating,
#froProblemsPreview select.preview-rating {
  -webkit-appearance: menulist !important;
  appearance: menulist !important;
}

/* Compact layout for edit problems rows: three compact columns (Problem | Points | Rating)
   Converted to a flex-based row layout so all three columns sit side-by-side
   with an even gap between them and reduced horizontal spacing. */
.fro-edit-modal .fro-edit-problems table {
  border-collapse: collapse;
  margin: 0 auto;
  display: table; /* center reliably and shrink-to-fit */
  width: auto;
  max-width: calc(100% - 24px); /* prevent overflow inside modal */
  color: var(--text);
}
.fro-edit-modal .fro-edit-problems thead,
.fro-edit-modal .fro-edit-problems tbody { /* keep native table layout for header/body */ }
.fro-edit-modal .fro-edit-problems thead tr,
.fro-edit-modal .fro-edit-problems tbody tr {
  display: grid;
  grid-template-columns: auto 84px 120px; /* more room for multi-digit points */
  column-gap: 8px;
  align-items: center;
  width: auto;
  box-sizing: border-box;
  padding: 6px 0;
}
.fro-edit-modal .fro-edit-problems th,
.fro-edit-modal .fro-edit-problems td { display: block; padding: 6px 8px; box-sizing: border-box; vertical-align: middle; }
.fro-edit-modal .fro-edit-row { border-bottom: 1px solid rgba(255,255,255,0.02); }
.fro-edit-modal .fro-edit-label { text-align: left; color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fro-edit-modal .fro-edit-points { text-align: center; white-space: nowrap; }
.fro-edit-modal .fro-edit-rating { text-align: center; white-space: nowrap; }
.preview-points { width: 84px; min-width: 64px; text-align: center; }
.preview-rating { width: 104px; text-align: center; }
.preview-remove { min-width: 28px; height: 28px; border-radius: 8px; }

/* Responsive: stack on narrow screens */
@media (max-width:520px) {
  .fro-edit-modal .fro-edit-problems thead tr,
  .fro-edit-modal .fro-edit-problems tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 8px 0;
  }
  .fro-edit-modal .fro-edit-points,
  .fro-edit-modal .fro-edit-rating { text-align: left; }
  .fro-edit-modal .fro-edit-label { white-space: normal; }
}

/* Header alignment: center Points/Rating headers above their controls */
.fro-edit-modal .fro-edit-problems thead th { padding-bottom: 8px; color: var(--muted); font-weight:700; font-size:0.95rem; }
.fro-edit-modal .fro-edit-problems thead th.fro-edit-points,
.fro-edit-modal .fro-edit-problems thead th.fro-edit-rating { text-align: center; }
.fro-edit-modal .fro-edit-problems thead th.fro-edit-label { text-align: left; }

/* Chat input: custom placeholder span with bold background when input is empty */
.fro-chat-input-wrap { position: relative; }
.fro-chat-input-wrap .fro-chat-placeholder {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  transition: opacity 140ms ease, transform 120ms ease, visibility 140ms;
}
.fro-chat-input-wrap input:focus + .fro-chat-placeholder,
.fro-chat-input-wrap input:not(:placeholder-shown) + .fro-chat-placeholder {
  opacity: 0; visibility: hidden; transform: translateY(-50%) scale(0.98);
}

/* Disable the global focus ring for the in-modal chat input so it doesn't highlight while typing */
#findRandomModal .fro-chat-input-wrap input:focus,
#findRandomModal #froChatInput:focus {
  box-shadow: none !important;
  border-color: rgba(255,255,255,0.04) !important;
  outline: none !important;
  transform: none !important;
}

/* Generic preview remove show-on-hover to support multiple preview containers */
.preview-remove { transition: opacity 140ms ease, transform 120ms ease; opacity: 0; visibility: hidden; pointer-events: none; }
table tbody tr:hover .preview-remove { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(-2px); }
.preview-remove:disabled { opacity: 0.45; cursor: not-allowed; }

/* Floating chat bubble (fixed to viewport) */
.fro-chat-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg,#4b7be8,#2a5bd8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 40px rgba(10,30,70,0.5);
  /* subtle continuous glow (matches find-random pair button feel) */
  animation: froChatPulse 3.6s ease-in-out infinite;
  will-change: transform, box-shadow;
  cursor: pointer;
  z-index: 2147483655;
}
.fro-chat-bubble .fro-unread {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff5a5f;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  display: none;
}

/* Glow animation to draw attention when there are unread messages */
@keyframes froChatPulse {
  0% { box-shadow: 0 10px 30px rgba(75,123,232,0.10); transform: translateY(0) scale(1); }
  50% { box-shadow: 0 16px 40px rgba(75,123,232,0.14); transform: translateY(-1px) scale(1.01); }
  100% { box-shadow: 0 10px 30px rgba(75,123,232,0.10); transform: translateY(0) scale(1); }
}
@keyframes froChatGlow {
  0% { box-shadow: 0 12px 32px rgba(75,123,232,0.18); transform: translateY(0) scale(1); }
  50% { box-shadow: 0 22px 56px rgba(75,123,232,0.34); transform: translateY(-3px) scale(1.03); }
  100% { box-shadow: 0 12px 32px rgba(75,123,232,0.18); transform: translateY(0) scale(1); }
}
.fro-chat-bubble.fro-attention {
  animation: froChatGlow 1.6s ease-in-out infinite;
}
.fro-chat-bubble.fro-attention .fro-unread { display: inline-block; }

/* Floating chat panel */
.fro-chat-floating {
  position: fixed;
  right: 20px;
  bottom: 86px;
  width: 360px;
  height: 420px;
  max-width: calc(100% - 40px);
  border-radius: 12px;
  background: linear-gradient(180deg,#071325,#08121a);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 24px 80px rgba(3,6,12,0.6);
  display: none;
  flex-direction: column;
  z-index: 2147483654;
  overflow: hidden;
}
.fro-chat-floating .fro-chat-header {
  display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,0.03);
}
.fro-chat-floating .fro-chat-title { font-weight:800;color:var(--text); }
.fro-chat-floating .fro-chat-container { padding:8px; display:flex; flex-direction:column; gap:6px; overflow:auto; flex:1; }
.fro-chat-floating .fro-chat-input-area { display:flex; gap:6px; padding:10px; border-top:1px solid rgba(255,255,255,0.02); }
.fro-chat-floating .fro-chat-input-wrap input { width:100%; padding:6px 10px; background:#0b2433; color:var(--text); border:1px solid rgba(255,255,255,0.03); border-radius:8px; outline:none; }

/* keep focus ring override for floating input too */
#froChatFloat input:focus,
.fro-chat-input-wrap input:focus {
  box-shadow: none !important;
  border-color: rgba(255,255,255,0.04) !important;
  outline: none !important;
  transform: none !important;
}

/* Empty chat placeholder shown when there are no messages yet */
.fro-chat-empty,
#froChatContainer .fro-chat-empty {
  color: var(--muted);
  font-size: 20px !important;
  font-weight: 800 !important;
  text-align: center;
  padding: 12px 16px;
  width: 100%;
  height: 100%;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  flex: 1 1 auto;
  opacity: 0.45 !important;
  pointer-events: none;
  box-sizing: border-box;
}
