/* ── WORD SEARCH PAGE ─────────────────────────────────── */

/* Stats bar */
.word-search-stats-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.ws-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  padding: 4px 10px;
  background: var(--surface2);
  border-radius: 20px;
}

.ws-stat-pill strong {
  color: var(--text);
  font-weight: 700;
}

.ws-stat-pill svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.ws-stat-keyword {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(155, 109, 255, 0.1);
  border: 1px solid rgba(155, 109, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-left: auto;
}

/* Sidebar servers */
.word-search-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ws-sidebar-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 0 6px;
  margin-bottom: 4px;
}

.ws-server-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: all var(--t);
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.ws-server-item:hover {
  background: rgba(155, 109, 255, 0.06);
  border-color: rgba(155, 109, 255, 0.1);
}

.ws-server-item.active {
  background: rgba(155, 109, 255, 0.1);
  border-color: rgba(155, 109, 255, 0.2);
}

.ws-server-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
}

img.ws-server-icon {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
}

.ws-server-info {
  flex: 1;
  min-width: 0;
}

.ws-server-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-server-count {
  font-size: 11px;
  color: var(--text3);
}

.ws-server-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(155, 109, 255, 0.12);
  border-radius: 10px;
  padding: 2px 7px;
  min-width: 22px;
  text-align: center;
}

/* Results pane */
.ws-results-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ws-results-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(155, 109, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Day groups */
.ws-day-group {
  margin-bottom: 16px;
}

.ws-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
  padding: 5px 10px;
  background: var(--surface2);
  border-radius: var(--r-sm);
  display: inline-block;
}

/* Message card */
.ws-message-card {
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 6px;
  transition: border-color var(--t), background var(--t);
  position: relative;
}

.ws-message-card:hover {
  border-color: rgba(155, 109, 255, 0.25);
  background: rgba(155, 109, 255, 0.02);
}

.ws-message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ws-message-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ws-message-user {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ws-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text2);
  flex-shrink: 0;
  overflow: hidden;
}

img.ws-user-avatar {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.ws-username {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-user-id {
  font-size: 10.5px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
}

.ws-message-location {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ws-guild-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text2);
}

.ws-guild-icon-small {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: var(--text3);
  overflow: hidden;
  flex-shrink: 0;
}

img.ws-guild-icon-small {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.ws-channel-tag {
  font-size: 11px;
  color: var(--text3);
}

.ws-channel-tag::before {
  content: '# ';
  opacity: 0.5;
}

.ws-dot-sep {
  color: var(--border);
  font-size: 11px;
}

.ws-message-time {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ws-time-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text2);
}

.ws-time-hour {
  font-size: 10.5px;
  color: var(--text3);
}

/* Message content with keyword highlight */
.ws-message-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--r-sm);
  border-left: 2px solid rgba(155, 109, 255, 0.35);
}

.ws-highlight {
  background: rgba(155, 109, 255, 0.22);
  color: #c4b5fd;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
}

/* Pagination */
.ws-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.ws-page-btn {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--t);
}

.ws-page-btn:hover:not(:disabled) {
  background: rgba(155, 109, 255, 0.09);
  color: var(--accent);
  border-color: rgba(155, 109, 255, 0.2);
}

.ws-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ws-pagination-info {
  font-size: 12px;
  color: var(--text3);
}

/* Loading spinner */
.ws-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--text3);
  font-size: 13px;
}

.ws-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: wsSpin 0.7s linear infinite;
}

@keyframes wsSpin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.ws-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 13px;
}

.ws-empty svg {
  width: 36px;
  height: 36px;
  color: var(--border);
  margin: 0 auto 12px;
  display: block;
}

/* ── SEARCH BAR (même style que #section-search) ─────── */
#section-word-search .search-main-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(155,109,255,.25);
  border-radius: 14px;
  padding: 6px 6px 6px 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 0 0 rgba(155,109,255,0);
  transition: border-color .2s ease, box-shadow .2s ease;
}
#section-word-search .search-main-bar:focus-within {
  border-color: rgba(155,109,255,.7);
  box-shadow: 0 0 0 3px rgba(155,109,255,.12);
}
#section-word-search .search-main-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f0f2ff;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-d);
  letter-spacing: .01em;
  -webkit-text-fill-color: #f0f2ff;
}
#section-word-search .search-main-input:-webkit-autofill,
#section-word-search .search-main-input:-webkit-autofill:hover,
#section-word-search .search-main-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #0e0b1e inset !important;
  -webkit-text-fill-color: #f0f2ff !important;
  caret-color: #f0f2ff;
}
#section-word-search .search-main-input::placeholder {
  color: rgba(255,255,255,.28);
  font-weight: 400;
}
#section-word-search .search-btn-primary {
  background: linear-gradient(135deg, #7c5cfc, #9b6dff);
  color: #fff;
  border: none;
  padding: 10px 26px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: .03em;
  box-shadow: 0 4px 14px rgba(124,92,252,.35);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
#section-word-search .search-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,92,252,.5);
}
#section-word-search .search-btn-primary:active {
  transform: translateY(0);
  opacity: .9;
}
#section-word-search .search-btn-secondary {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
#section-word-search .search-btn-secondary:hover {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
}

/* Filter input (même style que search) */
#section-word-search .search-filter-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,.03);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-radius: 0;
  padding: 11px 18px;
  font-size: 13px;
  color: #9488bb;
}
#section-word-search .search-filter-input::placeholder { color: #463a6a; }
#section-word-search .search-filter-input:focus { outline: none; background: rgba(255,255,255,.05); }
