/* =====================================================
   SodepGPT – Redesign v2 (Navy Sidebar + Light Main)
   ===================================================== */
html {
  overflow-y: scroll;
}

/* Fix width shift when filter bar opens and scrollbar appears */

/* ── Dark sidebar theme (always dark) ── */
:root {
  /* Sidebar */
  --sidebar-bg: #1a2035;
  --sidebar-bg2: #151929;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-text: #a0aec0;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(99, 179, 237, 0.15);

  /* Main content (light) */
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f7f9fc;
  --bg-input: #ffffff;
  --border: #e8ecf0;
  --border-light: #dde2e8;

  /* Text */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;

  /* Accent — teal */
  --accent: #00acc1;
  --accent-hover: #0097a7;
  --accent-glow: rgba(0, 172, 193, 0.15);
  --accent-light: #e0f7fa;

  /* User bubble */
  --user-bubble: #26c6da;
  --user-bubble-hover: #1eafc2;

  /* Misc */
  --gold: #f6ad55;
  --success: #38a169;
  --error: #e53e3e;
  --warning: #dd6b20;

  --sidebar-width: 240px;
  --topbar-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 24px;
}

/* ── Dark mode override (user preference) ── */
[data-theme="dark"] {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-card: #1f2937;
  --bg-hover: #374151;
  --bg-input: #374151;
  --border: #374151;
  --border-light: #4b5563;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #6b7280;
  --accent-light: rgba(0, 172, 193, 0.1);
  --sidebar-bg: #0f172a;
  --sidebar-bg2: #0a0f1e;
}

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

html,
body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.layout {
  display: flex;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================
   SIDEBAR (always dark navy)
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon-wrap {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #00acc1, #0077b6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  letter-spacing: 0.05em;
  display: block;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  display: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
}

.sidebar-actions {
  padding: 12px 12px 8px;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.2s;
}

.new-chat-btn:hover {
  background: var(--accent-hover);
}

.new-chat-btn svg {
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 8px 12px;
}

.nav-section-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  padding: 10px 8px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #63b3ed;
}

.nav-item.active svg {
  color: #63b3ed;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* History */
.sidebar-history {
  padding: 4px 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 12px;
  transition: all 0.15s;
  gap: 6px;
  cursor: pointer;
}

.history-item:hover,
.history-item.active {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.history-item.active {
  color: #63b3ed;
}

.history-icon {
  color: var(--sidebar-text);
  flex-shrink: 0;
  opacity: 0.6;
}

.history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 12px;
}

.delete-thread-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
}

.history-item:hover .delete-thread-btn {
  opacity: 1;
}

.delete-thread-btn:hover {
  color: #fc8181;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.theme-toggle-btn {
  color: var(--sidebar-text);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
}

/* ==========================================
   MAIN CONTENT (light)
   ========================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  min-width: 0;
  background: var(--bg-primary);
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-info {}

.topbar-title-main {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--success);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.topbar-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: background 0.2s;
}

.hamburger:hover span {
  background: var(--text-primary);
}

/* =====================================================
   CHAT PAGE
   ===================================================== */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-height));
  overflow: hidden;
  background: var(--bg-primary);
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  scroll-behavior: smooth;
  background: var(--bg-primary);
}

.messages-container::-webkit-scrollbar {
  width: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

/* ── Welcome ── */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 30px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.welcome-logo {
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.suggestion-chip {
  padding: 9px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Messages ── */
.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.message-user {
  flex-direction: row-reverse;
}

.ai-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00acc1, #0077b6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 172, 193, 0.3);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--user-bubble);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.message-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
  max-width: calc(100% - 80px);
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.message-user .message-bubble {
  background: var(--user-bubble);
  border-color: var(--user-bubble);
  color: #ffffff;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  box-shadow: 0 2px 8px rgba(38, 198, 218, 0.35);
}

.message-bubble.streaming {
  border-color: var(--accent);
}

/* Markdown in bubble */
.message-bubble p {
  margin-bottom: 8px;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
  margin: 8px 0 8px 20px;
}

.message-bubble li {
  margin-bottom: 4px;
}

.message-bubble code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
}

[data-theme="dark"] .message-bubble code {
  background: rgba(255, 255, 255, 0.1);
}

.message-bubble pre {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

[data-theme="dark"] .message-bubble pre {
  background: rgba(0, 0, 0, 0.3);
}

.message-bubble strong {
  color: var(--accent);
  font-weight: 600;
}

.message-user .message-bubble strong {
  color: rgba(255, 255, 255, 0.9);
}

.message-bubble a {
  color: var(--accent);
  text-decoration: underline;
}

.message-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}

.message-bubble th,
.message-bubble td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}

.message-bubble th {
  background: var(--bg-hover);
  font-weight: 600;
}

/* SIM Cards inside AI bubble */
.sim-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.sim-result-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-result-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.sim-result-number .sim-highlight {
  color: var(--accent);
}

.sim-result-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.sim-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.sim-result-btn-detail {
  flex: 1;
  padding: 7px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
}

.sim-result-btn-detail:hover {
  background: var(--accent-light);
}

.sim-result-btn-buy {
  flex: 1.5;
  padding: 7px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  text-decoration: none;
  display: block;
}

.sim-result-btn-buy:hover {
  background: var(--accent-hover);
}

/* Quick action tabs */
.quick-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.quick-tab {
  padding: 5px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.quick-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 4px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
  animation: bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-7px);
  }
}

.cursor-blink {
  animation: blink 0.8s infinite;
  color: var(--accent);
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ── Input Area ── */
.input-area {
  border-top: 1px solid var(--border);
  padding: 14px 16px 12px;
  background: var(--bg-secondary);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  max-width: 900px;
  margin: 0 auto;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  resize: none;
  max-height: 140px;
  min-height: 24px;
  line-height: 1.6;
}

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

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.05);
}

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

.input-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* =====================================================
   SEARCH / PHONG THUY / OTHER PAGES
   ===================================================== */
.search-page,
.settings-page,
.checkout-page {
  padding: 24px;
  max-width: 960px;
  margin: 0 auto;
  height: calc(100dvh - var(--topbar-height));
  overflow-y: auto;
}

.search-header {
  margin-bottom: 24px;
}

.search-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.search-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.search-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

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

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

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.search-btn {
  margin-top: 4px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full {
  width: 100%;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

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

.btn-danger:hover {
  background: rgba(229, 62, 62, 0.08);
  border-color: var(--error);
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 172, 193, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.btn-spinner-white {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* SIM Grid (search result page) */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.sim-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sim-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.sim-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.sim-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sim-type {
  font-size: 12px;
  color: var(--text-muted);
}

.sim-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
}

.sim-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  transition: background 0.2s;
}

.btn-buy:hover {
  background: var(--accent-hover);
}

.status-prepaid {
  color: var(--success);
  font-size: 12px;
}

.status-postpaid {
  color: var(--text-muted);
  font-size: 12px;
}

/* Alerts */
.alert-success {
  background: rgba(56, 161, 105, 0.08);
  border: 1px solid rgba(56, 161, 105, 0.3);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(229, 62, 62, 0.08);
  border: 1px solid rgba(229, 62, 62, 0.3);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Results */
.results-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.results-header strong {
  color: var(--text-primary);
  margin-left: 4px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state svg {
  opacity: 0.25;
}

.empty-state p {
  font-size: 14px;
}

/* =====================================================
   SETTINGS – ADMIN
   ===================================================== */
.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.settings-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.admin-login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.admin-login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.admin-login-icon {
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.admin-login-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-login-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 700px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.settings-card-header svg {
  color: var(--accent);
  flex-shrink: 0;
}

.settings-card-header h2 {
  font-size: 15px;
  font-weight: 700;
}

.api-key-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.api-key-masked {
  font-family: 'Consolas', monospace;
  letter-spacing: 0.04em;
  color: var(--text-muted) !important;
  flex: 1;
}

.suggestion-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.suggestion-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

/* =====================================================
   ABOUT PAGE
   ===================================================== */
.about-page {
  padding: 32px 24px;
  max-width: 960px;
  margin: 0 auto;
  height: calc(100dvh - var(--topbar-height));
  overflow-y: auto;
}

.about-hero {
  text-align: center;
  padding: 32px 0 40px;
}

.about-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.about-hero h1 {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #0077b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.about-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.about-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.about-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.about-card-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}

.about-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.about-tech {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.about-tech h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.tech-badge {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(0, 172, 193, 0.3);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.about-footer-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0 32px;
}

.about-footer-note strong {
  color: var(--text-secondary);
}

/* Checkout */
.checkout-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 540px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.checkout-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.order-sim-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-light);
  border: 1px solid rgba(0, 172, 193, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.order-sim-number {
  font-size: 18px;
  font-weight: 600;
}

.order-sim-price {
  color: var(--success);
  font-weight: 700;
  font-size: 16px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
  }

  .layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .layout.sidebar-open .sidebar-overlay {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
  }

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

  .sim-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .message {
    max-width: 100%;
  }

  .messages-container {
    padding: 14px 10px;
  }

  .input-area {
    padding: 10px 12px;
  }

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

@media (min-width: 769px) {
  .hamburger {
    display: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

/* Blazor error */
#blazor-error-ui {
  background: var(--error);
  bottom: 0;
  left: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
  display: none;
  padding: 0.6rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  color: white;
  font-size: 14px;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

/* Spinner (keep from old) */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =====================================================
   SEARCH PAGE – REDESIGN
   ===================================================== */
.search-bar-section {
  padding: 20px 0 12px;
}

.search-bar-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 760px;
}

.search-bar-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  transition: border-color 0.2s;
}

.search-bar-input-group:focus-within {
  border-color: var(--accent);
}

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

.search-bar-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.search-bar-input::placeholder {
  color: var(--text-muted);
}

.search-bar-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.search-bar-clear:hover {
  color: var(--error);
}

.search-go-btn {
  padding: 10px 22px;
  border-radius: var(--radius-pill) !important;
  gap: 7px;
  flex-shrink: 0;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 72px;
  flex-shrink: 0;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.filter-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Operator logo chips */
.op-chip {
  padding: 4px 12px;
  position: relative;
}

.op-logo {
  height: 20px;
  width: auto;
  max-width: 64px;
  object-fit: contain;
  display: block;
}

.chip-check {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-left: 2px;
}

/* Sim card with logo */
.sim-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-op-logo {
  height: 18px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  opacity: 0.85;
}

.search-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0.6;
}

.search-empty-hint svg {
  opacity: 0.3;
}

.search-empty-hint strong {
  color: var(--accent);
}

/* =====================================================
   CHECKOUT PAGE – REDESIGN
   ===================================================== */
.checkout-page {
  padding: 24px;
  height: calc(100dvh - var(--topbar-height));
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.checkout-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.checkout-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.checkout-header-icon {
  width: 46px;
  height: 46px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.checkout-header h1 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 3px;
}

.checkout-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.order-sim-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-light);
  border: 1.5px solid rgba(0, 172, 193, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.order-sim-label {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.order-sim-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.order-sim-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

/* Form spacing in checkout */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.checkout-form .form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.checkout-form .form-group label svg {
  color: var(--accent);
  flex-shrink: 0;
}

.required {
  color: var(--error);
  font-size: 13px;
}

.form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkout-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

/* Order success */
.order-success-box {
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.order-success-icon {
  width: 72px;
  height: 72px;
  background: rgba(56, 161, 105, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.order-success-box h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
}

.order-success-box p {
  font-size: 14px;
  color: var(--text-secondary);
}

.order-success-box strong {
  color: var(--accent);
}

/* Alert flex row */
.alert-error {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .form-row-half {
    grid-template-columns: 1fr;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-label {
    min-width: unset;
  }
}

/* ── Filter toggle button ── */
.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  flex-shrink: 0;
  position: relative;
}

.btn-filter-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-filter-toggle.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Sort inline (in results header) ── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}

.results-header strong {
  color: var(--text-primary);
}

.sort-inline-chips {
  display: flex;
  gap: 4px;
}

.sort-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
}

.sort-inline-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-inline-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Fix: stable search bar layout (no width shift) ── */
.search-bar-section {
  width: 100%;
}

.search-bar-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.search-bar-input-group {
  flex: 1;
  min-width: 0;
  /* prevent flex child from overflowing */
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.search-bar-input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Always in DOM but invisible – prevents layout shift */
.search-bar-clear {
  visibility: visible;
  flex-shrink: 0;
}

.search-bar-clear.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Fix filter toggle not causing shift - fixed height row */
.search-go-btn,
.btn-filter-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Mobile Responsive cho Search Page ── */
@media (max-width: 768px) {
  .search-page {
    padding: 16px;
    height: auto;
    min-height: calc(100dvh - var(--topbar-height));
  }

  /* Wrap thanh công cụ thành wrap trên mobile */
  .search-bar-wrap {
    flex-wrap: wrap;
  }

  /* Input group chiếm chọn 1 dòng */
  .search-bar-input-group {
    flex: 0 0 100%;
    margin-bottom: 8px;
  }

  /* Các nút chia đôi */
  .search-go-btn {
    flex: 1;
    justify-content: center;
  }

  .btn-filter-toggle {
    flex: 1;
    justify-content: center;
    width: auto;
  }

  /* Filter bar margin */
  .filter-bar {
    padding: 16px;
  }

  /* Filter chips rớt dòng */
  .filter-chips {
    flex-wrap: wrap;
  }

  .sim-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .sort-inline-chips {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}