/* ===== CSS Custom Properties ===== */
:root {
  --primary: #818CF8;
  --primary-light: #A5B4FC;
  --primary-dark: #6366F1;
  --secondary: #22D3EE;
  --secondary-light: #67E8F9;
  --bg: #0F172A;
  --text: #E2E8F0;
  --text-light: #94A3B8;
  --border: #1E293B;
  --card-bg: #1E293B;
  --success: #34D399;
  --error: #F87171;
  --warning: #FBBF24;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.2);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --nav-height: 64px;
  --transition: 0.2s ease;
}

/* ===== Reset / Normalize ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  padding-top: var(--nav-height);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }
input, select, textarea, button { font: inherit; }

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.navbar-brand img {
  height: 32px;
  width: auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-links a {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color var(--transition);
  white-space: nowrap;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--primary);
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
  border-radius: 2px;
}

.navbar-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Nav Auth & User Menu ===== */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-refresh-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: all var(--transition);
  flex-shrink: 0;
}

.nav-refresh-btn:hover {
  color: var(--primary-light);
  border-color: var(--primary-light);
  transform: rotate(90deg);
}

.nav-refresh-btn:active {
  transform: rotate(360deg);
}

.nav-auth-prompt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-auth-text {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  transition: all var(--transition);
}

.user-menu-btn:hover {
  border-color: var(--primary-light);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1001;
  display: none;
  overflow: hidden;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.user-dropdown-status {
  font-size: 0.75rem;
  color: var(--success);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.user-dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.85rem;
  transition: background var(--transition);
}

.user-dropdown a:hover {
  background: var(--bg);
  color: var(--primary);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--error);
  color: #fff;
  border-radius: 9px;
  margin-left: 0.25rem;
}

.nav-link-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-unread {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--error);
  color: #fff;
  border-radius: 1rem;
}

.badge-unread svg {
  flex-shrink: 0;
}

/* ===== Profile Actions ===== */
.auto-profile-prompt {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.auto-profile-prompt p {
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.login-prompt {
  text-align: center;
  padding: 1rem;
}

.login-prompt p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

.login-prompt-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.approach-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
  border: 1px solid var(--border);
  overflow: hidden;
}

.profile-card {
  padding: 2rem;
  overflow: visible;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  color: var(--text);
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}

.btn-google {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
  padding: 0.625rem 1.5rem;
}

.btn-google:hover:not(:disabled) {
  background: var(--bg);
  box-shadow: var(--shadow);
  color: var(--text);
}

.btn-google img {
  width: 18px;
  height: 18px;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.form-label .required {
  color: var(--error);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #94A3B8;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  margin-top: 0.25rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.form-check-detail {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  margin-left: 1.5rem;
}

.form-radio-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.form-radio-card {
  flex: 1;
  min-width: 140px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.form-radio-card:hover {
  border-color: var(--primary-light);
}

.form-radio-card.selected {
  border-color: var(--primary);
  background: rgba(129, 140, 248, 0.1);
}

.form-radio-card input {
  display: none;
}

/* ===== Tags / Chips ===== */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 44px;
  background: var(--card-bg);
  cursor: text;
}

.chips-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: rgba(129, 140, 248, 0.2);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-remove {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.chip-remove:hover {
  opacity: 1;
}

.chips-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  padding: 0.25rem;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text);
}

/* ===== Badges / Labels ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-primary {
  background: rgba(129, 140, 248, 0.2);
  color: var(--primary);
}

.badge-secondary {
  background: rgba(34, 211, 238, 0.15);
  color: var(--secondary);
}

.badge-success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}

.badge-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-light);
}

.badge-intent {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

/* ===== My Searches Page ===== */
.my-searches {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.my-searches .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header-actions {
  display: flex;
  gap: 0.75rem;
}

.my-searches-explainer {
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-light);
}

.searches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.search-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-stat {
  font-size: 0.8rem;
  color: var(--text-light);
}

.search-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.inline-form {
  display: inline;
}

/* ===== Search Form ===== */
.form-page {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.search-form .form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.alert-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(248, 113, 113, 0.3);
  margin-bottom: 1.5rem;
}

.tags-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  background: var(--card-bg);
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
  cursor: text;
}

.tags-editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tags-input {
  border: none !important;
  box-shadow: none !important;
  padding: 0.25rem 0.5rem !important;
  min-width: 120px;
  flex: 1;
  background: transparent !important;
}

.chip-editable {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(129, 140, 248, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 1rem;
  color: var(--primary-light);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}

.chip-remove:hover {
  color: var(--error);
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.intent-option {
  cursor: pointer;
}

.intent-option input {
  display: none;
}

.intent-label {
  display: block;
  padding: 0.625rem 1rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  transition: all var(--transition);
}

.intent-option input:checked + .intent-label {
  background: rgba(129, 140, 248, 0.2);
  border-color: var(--primary);
  color: var(--primary-light);
}

.intent-option:hover .intent-label {
  border-color: var(--primary-light);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.radio-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(129, 140, 248, 0.06);
}

.radio-content small {
  color: var(--text-light);
  font-size: 0.8rem;
}

.visibility-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.visibility-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.visibility-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(129, 140, 248, 0.08);
}

.visibility-option input {
  margin-top: 0.2rem;
}

.visibility-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.visibility-content p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .intent-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Upload Page ===== */
.upload-page {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.upload-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.upload-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-light);
  margin-top: 1.5rem;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(129, 140, 248, 0.08);
  color: var(--primary);
}

.upload-dropzone svg {
  margin: 0 auto 1rem;
  display: block;
}

.upload-dropzone p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.upload-preview {
  margin-top: 1.5rem;
  text-align: center;
}

.upload-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.upload-preview-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.upload-result {
  text-align: center;
}

.upload-result h2 {
  color: var(--success);
  margin-bottom: 1rem;
}

.upload-result-image {
  margin-bottom: 1.5rem;
}

.upload-result-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
}

.upload-url-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.upload-url-box .form-input {
  flex: 1;
  font-size: 0.85rem;
  font-family: monospace;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 1rem;
}

.file-info svg {
  color: var(--primary-light);
  flex-shrink: 0;
}

/* ===== Flash Messages ===== */
.flash {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: flashIn 0.3s ease;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-success {
  background: rgba(52, 211, 153, 0.15);
  color: #065F46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.flash-error {
  background: rgba(248, 113, 113, 0.15);
  color: #991B1B;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.flash-warning {
  background: rgba(251, 191, 36, 0.15);
  color: #92400E;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.flash-info {
  background: rgba(129, 140, 248, 0.2);
  color: #3730A3;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.flash-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.6;
  color: inherit;
  padding: 0;
  line-height: 1;
}

.flash-close:hover {
  opacity: 1;
}

/* ===== Chat Layout (WhatsApp style) ===== */
.chat-page {
  display: flex;
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
  max-width: 100%;
}

.chat-sidebar {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.chat-sidebar-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text);
}

.conversation-item:hover {
  background: rgba(129, 140, 248, 0.06);
  color: var(--text);
}

.conversation-item.active {
  background: rgba(129, 140, 248, 0.12);
  border-left: 3px solid var(--primary);
}

.conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-topic { font-size: 0.75rem; color: var(--primary-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: 0.8rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; }
.conv-meta { flex-shrink: 0; }
.conv-time { font-size: 0.7rem; color: var(--text-light); }

.chat-empty-sidebar { padding: 2rem 1rem; text-align: center; color: var(--text-light); }
.chat-empty-sidebar p { margin-bottom: 1rem; }

/* Main chat area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0a0f1a;
  min-width: 0;
}

.chat-header {
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  display: none;
}

.chat-header-info { flex: 1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.chat-header-other { display: flex; align-items: center; gap: 0.75rem; }
.chat-header-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; flex-shrink: 0; }
.chat-header-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.chat-header-topic { font-size: 0.75rem; color: var(--primary-light); }
.chat-header-you { font-size: 0.75rem; color: var(--text-light); text-align: right; }
.chat-header-you-label { margin-right: 0.25rem; }
.chat-header-you-name { font-weight: 600; color: var(--success); }
.chat-header-you-topic { color: var(--text-light); }

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(129, 140, 248, 0.01) 40px,
    rgba(129, 140, 248, 0.01) 80px
  );
}

.chat-date-divider {
  text-align: center;
  margin: 0.75rem 0;
}

.chat-date-divider span {
  background: rgba(129, 140, 248, 0.15);
  color: var(--text-light);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.msg {
  max-width: 65%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
  margin-bottom: 0.125rem;
}

.msg-sent {
  align-self: flex-end;
  background: #1a3a2a;
  color: #e2e8f0;
  border-bottom-right-radius: 4px;
}

.msg-received {
  align-self: flex-start;
  background: var(--card-bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-bot {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.msg-sender {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 0.15rem;
}

.msg-text { word-break: break-word; }

.msg-image img {
  max-width: 280px;
  max-height: 300px;
  border-radius: 0.5rem;
  cursor: pointer;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.msg-time { font-size: 0.65rem; color: var(--text-light); opacity: 0.7; }
.msg-status { font-size: 0.65rem; color: var(--success); }
.msg-bot-badge { font-size: 0.6rem; background: rgba(34, 211, 238, 0.2); color: var(--secondary); padding: 0.1rem 0.3rem; border-radius: 0.25rem; }

.chat-empty-messages { margin: auto; text-align: center; color: var(--text-light); padding: 2rem; }

.chat-typing {
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 0.25rem 1rem;
  font-style: italic;
}

/* Input area */
.chat-input-area {
  padding: 0.5rem 0.75rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat-attach-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all var(--transition);
  flex-shrink: 0;
}

.chat-attach-btn:hover { color: var(--primary-light); background: rgba(129, 140, 248, 0.1); }

.chat-input {
  flex: 1;
  border: none;
  background: var(--bg);
  color: var(--text);
  border-radius: 1.25rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  resize: none;
  max-height: 120px;
  outline: none;
  line-height: 1.4;
}

.chat-input::placeholder { color: var(--text-light); }

.chat-send-btn {
  background: var(--primary);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--primary-dark); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Placeholder when no conversation selected */
.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 1rem;
}

.chat-placeholder svg { opacity: 0.3; }
.chat-placeholder h2 { font-size: 1.1rem; font-weight: 500; }

/* Chat request states */
.chat-request-banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  gap: 1.5rem;
}

.request-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.request-status svg { opacity: 0.6; }
.request-status h3 { font-size: 1.1rem; font-weight: 600; }
.request-status p { font-size: 0.9rem; color: var(--text-light); max-width: 400px; }

.request-sent svg { color: var(--warning); }
.request-incoming svg { color: var(--primary-light); }
.request-declined svg { color: var(--error); }

.request-actions {
  display: flex;
  gap: 1rem;
}

/* Conversation sidebar status */
.conv-status-text { font-style: italic; }
.conv-status-pending { color: var(--warning); }
.conv-status-incoming { color: var(--primary-light); font-weight: 600; }
.conv-status-declined { color: var(--error); }
.conv-status-accepted { color: var(--success); }

.conv-pending { border-left: 3px solid var(--warning); }
.conv-declined { opacity: 0.5; }

.conv-incoming-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.conv-accepted-icon {
  color: var(--success);
  font-size: 1rem;
  font-weight: 700;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* My Searches badges */
.badge-incoming {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(129, 140, 248, 0.2);
  color: var(--primary-light);
  border-radius: 1rem;
  animation: pulse 1.5s infinite;
}

.badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  border-radius: 1rem;
}

.badge-accepted {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border-radius: 1rem;
}

/* ===== Dashboard Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ===== Image Upload Preview ===== */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.image-upload-area:hover {
  border-color: var(--primary-light);
  background: rgba(129, 140, 248, 0.06);
}

.image-upload-area.has-image {
  border-style: solid;
  padding: 0.5rem;
}

.image-upload-preview {
  max-width: 300px;
  max-height: 300px;
  margin: 0 auto;
  border-radius: var(--radius);
  object-fit: cover;
}

.image-upload-text {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== Language Switcher ===== */
.lang-switcher {
  position: relative;
}

.lang-switcher-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all var(--transition);
}

.lang-switcher-btn:hover {
  border-color: var(--primary-light);
}

.lang-switcher-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  z-index: 1001;
  display: none;
  overflow: hidden;
}

.lang-switcher-dropdown.open {
  display: block;
}

.lang-switcher-dropdown a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: var(--text);
  font-size: 0.85rem;
  transition: background var(--transition);
}

.lang-switcher-dropdown a:hover {
  background: var(--bg);
  color: var(--primary);
}

.lang-switcher-dropdown a.active {
  color: var(--primary);
  font-weight: 600;
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 1002;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-banner-text {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
}

.cookie-banner-text a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-banner.hidden {
  display: none;
}

/* ===== Landing Page ===== */
.hero {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-search {
  margin-bottom: 1.5rem;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.25rem 0.25rem 0.25rem 1rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.hero-search-icon {
  color: var(--text-light);
  flex-shrink: 0;
}

.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.75rem;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
}

.hero-search-input::placeholder {
  color: #94A3B8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.hero-visual {
  flex-shrink: 0;
}

.hero-logo {
  width: 200px;
  height: 200px;
  opacity: 0.9;
}

.features {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-icon {
  color: var(--primary);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.cta-section {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.cta-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.cta-section p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.recent-searches {
  padding: 3rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.recent-searches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.recent-searches-header .section-title {
  margin-bottom: 0;
}

.search-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.search-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.search-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.search-card-username {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.badge-intent {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(129, 140, 248, 0.2);
  color: var(--primary);
  border-radius: 1rem;
}

.search-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.search-card-bio {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.search-card-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--text);
}

.chip-sm {
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}

.chip-more {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

.search-card-footer {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.search-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.5rem;
}

.search-card-location {
  font-size: 0.8rem;
  color: var(--text-light);
}

.search-card-dates {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-card-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.search-card-expiry {
  font-size: 0.7rem;
  color: var(--text-light);
  padding: 0.1rem 0.4rem;
  border-radius: 0.75rem;
  background: rgba(148, 163, 184, 0.1);
}

.search-card-expiry.expiry-soon {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.15);
}

.search-card-expiry.expiry-urgent {
  color: var(--error);
  background: rgba(248, 113, 113, 0.15);
}

.expiry-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.expiry-custom-date {
  margin-top: 0.5rem;
}

.search-card-mine {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.search-card-badges {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge-mine {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border-radius: 1rem;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-mine svg {
  flex-shrink: 0;
}

.search-card-owner {
  font-size: 0.8rem;
}

.search-card-by {
  color: var(--text-light);
}

.score-breakdown {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.score-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-light);
}

.score-bars {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.score-bar-item {
  display: grid;
  grid-template-columns: 60px 1fr 30px;
  gap: 0.5rem;
  align-items: center;
}

.score-bar-label {
  font-size: 0.65rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.score-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.score-bar-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.score-fill-semantic { background: var(--primary-light); }
.score-fill-date { background: var(--secondary); }
.score-fill-location { background: var(--success); }
.score-fill-intent { background: var(--warning); }

.score-bar-val {
  font-size: 0.65rem;
  color: var(--text-light);
  text-align: right;
}

.toggle-wrap {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-logo {
    width: 120px;
    height: 120px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .recent-searches-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ===== Discover Page ===== */
.discover {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.filter-bar {
  margin-bottom: 2rem;
}

.filter-form .filter-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-search {
  flex: 2;
  min-width: 200px;
}

.filter-logic {
  flex-shrink: 0;
}

.filter-row-secondary {
  margin-top: 0.75rem;
}

.show-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.show-toggle-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
}

.filter-intent,
.filter-location {
  flex: 1;
  min-width: 140px;
}

.toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.toggle-option {
  cursor: pointer;
}

.toggle-option input {
  display: none;
}

.toggle-label {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  transition: all var(--transition);
}

.toggle-option input:checked + .toggle-label {
  background: var(--primary);
  color: #fff;
}

.toggle-sm .toggle-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.search-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.search-card-actions .btn {
  width: 100%;
  justify-content: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ===== Profile Page ===== */
.profile-page {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-username {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.profile-title {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.badge-lg {
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}

.profile-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.profile-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.profile-bio {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

.profile-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-details {
  display: grid;
  gap: 0.75rem;
}

.detail-row {
  display: flex;
  gap: 1rem;
}

.detail-row dt {
  font-weight: 500;
  color: var(--text-light);
  min-width: 100px;
}

.detail-row dd {
  color: var(--text);
}

.profile-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.approach-form {
  width: 100%;
}

.profile-actions .btn-lg {
  width: 100%;
}

.approach-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.approach-form-row .form-select {
  flex: 1;
  min-width: 0;
}

.approach-form-row .btn {
  flex-shrink: 0;
}

.approach-form-row .form-select {
  flex: 1;
}

.approach-disabled {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

.profile-legal {
  text-align: center;
  padding: 1.25rem 0 0;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.profile-legal a {
  color: var(--text-light);
}

.profile-legal a:hover {
  color: var(--primary);
}

.profile-legal-sep {
  margin: 0 0.5rem;
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 2rem;
  padding: 1.5rem 0;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 1rem;
}

/* ===== Auth Pages ===== */
.auth-container {
  max-width: 440px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  border: 1px solid var(--border);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ===== Consent Page ===== */
.consent-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.consent-section-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ===== Character Counter ===== */
.char-counter {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.char-counter.warning {
  color: var(--warning);
}

.char-counter.danger {
  color: var(--error);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  max-width: 400px;
  margin: 0 auto 1.5rem;
  font-size: 0.9rem;
}

/* ===== Match Card ===== */
.match-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.match-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ===== Confirm Dialog ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-dialog {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.confirm-dialog-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.confirm-dialog-text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* ===== RTL Support ===== */
[dir="rtl"] body {
  text-align: right;
}

[dir="rtl"] .navbar-links {
  direction: rtl;
}

[dir="rtl"] .chat-conversation-item.active {
  border-left: none;
  border-right: 3px solid var(--primary);
}

[dir="rtl"] .chat-message-sent {
  border-bottom-right-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
}

[dir="rtl"] .chat-message-received,
[dir="rtl"] .chat-message-bot {
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: 4px;
}

[dir="rtl"] .chat-message-sent .chat-message-time {
  text-align: left;
}

[dir="rtl"] .form-select {
  background-position: left 0.75rem center;
  padding-right: 0.875rem;
  padding-left: 2.5rem;
}

[dir="rtl"] .form-check-detail {
  margin-left: 0;
  margin-right: 1.5rem;
}

[dir="rtl"] .char-counter {
  text-align: left;
}

[dir="rtl"] .lang-switcher-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .confirm-dialog-actions {
  justify-content: flex-start;
}

[dir="rtl"] .flash {
  direction: rtl;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar-links,
  .navbar-auth {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
  }

  .navbar-links.open,
  .navbar-auth.open {
    display: flex;
  }

  .navbar-auth {
    top: auto;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
  }

  .navbar-toggle {
    display: block;
  }

  .chat-page {
    flex-direction: column;
  }

  .chat-sidebar {
    width: 100%;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .chat-back-btn {
    display: block;
  }

  .msg {
    max-width: 85%;
  }

  .chat-header-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-header-you {
    text-align: left;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cookie-banner {
    flex-direction: column;
    text-align: center;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .form-radio-group {
    flex-direction: column;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chat-sidebar {
    width: 280px;
  }
}

/* ===== Print ===== */
@media print {
  .navbar,
  .cookie-banner,
  .navbar-toggle,
  .btn,
  .chat-input-area,
  .lang-switcher {
    display: none !important;
  }

  body {
    padding-top: 0;
    background: #fff;
    color: #000;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
  }
}
