/* ═══════════════════════════════════════════
   CLARIX — HISTORY PAGE CSS
═══════════════════════════════════════════ */

.history-page { padding: 32px 0 80px; }

/* Header */
.history-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}
.history-header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; margin-top: 8px; }

/* Stats bar */
.history-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 28px;
}
@media (max-width: 640px) { .history-stats { grid-template-columns: repeat(2,1fr); } }
.hist-stat {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-lg); padding: 18px 16px; text-align: center;
}
.hist-stat-num {
  font-family: var(--font-head); font-size: 30px; font-weight: 900; color: var(--accent); line-height: 1;
}
.hist-stat-label { font-size: 11px; color: #444; margin-top: 6px; font-weight: 500; }

/* Search + Filters */
.history-controls {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.history-search-wrap {
  flex: 1; min-width: 240px; position: relative;
}
.history-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 15px;
}
.history-search {
  width: 100%; padding: 11px 16px 11px 42px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-full); color: #fff; font-size: 14px; font-family: var(--font-body);
  transition: border-color 0.2s;
}
.history-search:focus { border-color: rgba(255,112,67,0.4); outline: none; }
.history-search::placeholder { color: #333; }

.history-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.history-filter-select {
  padding: 9px 14px; border-radius: var(--r-full);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: #888; font-size: 13px; font-family: var(--font-body);
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s;
}
.history-filter-select:focus { border-color: rgba(255,112,67,0.4); outline: none; }
.history-filter-select option { background: #111; color: #ccc; }

#favsBtn.active {
  background: rgba(255,200,67,0.1); border-color: rgba(255,200,67,0.35); color: #ffc843;
}

/* Results meta */
.history-results-meta {
  font-size: 12px; color: #444; margin-bottom: 16px; font-weight: 500;
}

/* History list */
.history-list { display: flex; flex-direction: column; gap: 12px; }

/* History card */
.hist-card {
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-lg); overflow: hidden;
  transition: all var(--t-mid); animation: fadeUp 0.3s var(--ease) both;
}
.hist-card:hover { border-color: rgba(255,112,67,0.2); }

.hist-card-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  cursor: pointer;
}
.hist-card-num {
  font-size: 11px; font-weight: 700; color: #333;
  width: 28px; text-align: center; flex-shrink: 0;
}
.hist-card-preview {
  flex: 1; font-size: 13px; color: #777; line-height: 1.5;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  min-width: 0;
}
.hist-card-meta {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap;
}
.hist-meta-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600;
  background: rgba(255,255,255,0.05); color: #555;
  border: 1px solid rgba(255,255,255,0.07);
}
.hist-meta-badge.lang { background: rgba(255,112,67,0.08); color: var(--accent); border-color: rgba(255,112,67,0.2); }
.hist-meta-badge.score { background: rgba(74,222,128,0.08); color: #4ade80; border-color: rgba(74,222,128,0.2); }

.hist-fav-btn {
  background: none; border: none; font-size: 16px; cursor: pointer;
  opacity: 0.4; transition: all 0.15s; flex-shrink: 0;
}
.hist-fav-btn:hover, .hist-fav-btn.active { opacity: 1; transform: scale(1.1); }
.hist-fav-btn.active { filter: drop-shadow(0 0 4px rgba(255,200,67,0.8)); }

.hist-expand-icon {
  font-size: 12px; color: #444; transition: transform 0.2s; flex-shrink: 0;
}
.hist-card.expanded .hist-expand-icon { transform: rotate(180deg); }

/* Expanded body */
.hist-card-body { display: none; border-top: 1px solid rgba(255,255,255,0.05); padding: 20px 18px; }
.hist-card.expanded .hist-card-body { display: block; animation: fadeIn 0.2s ease; }

.hist-body-section { margin-bottom: 16px; }
.hist-body-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #333; margin-bottom: 8px;
}
.hist-body-text {
  font-size: 13px; line-height: 1.75; color: #888;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md); padding: 14px; white-space: pre-wrap;
}
.hist-body-text.enhanced { border-color: rgba(255,112,67,0.15); color: #bbb; }

.hist-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05); margin-top: 16px;
}

/* Empty state */
.history-empty {
  text-align: center; padding: 80px 20px;
}
.history-empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.3; }
.history-empty-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: #333; margin-bottom: 8px; }
.history-empty-sub { font-size: 14px; color: #2a2a2a; }

/* Nav left for hamburger */
.nav-left { display: flex; align-items: center; gap: 12px; }
