/* Ultra-Minimalist Design System for ABU TenderBot */
:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --badge-bg: #f3f4f6;
  --badge-text: #374151;
  --badge-green-bg: #ecfdf5;
  --badge-green-text: #059669;
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --bg-card: #181a20;
  --border: #282b33;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --badge-bg: #22252c;
  --badge-text: #e5e7eb;
  --badge-green-bg: #064e3b;
  --badge-green-text: #34d399;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* App Shell - Optimized for Mobile & Desktop */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px; /* space for bottom nav */
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

/* Search & Filter Chips Bar */
.search-bar {
  padding: 14px 20px 8px 20px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 38px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.chips-row {
  display: flex;
  gap: 8px;
  padding: 8px 20px 14px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.chip.active {
  background-color: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Tender Feed Cards */
.tenders-feed {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tender-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform 0.1s, border-color 0.15s;
  cursor: pointer;
}

.tender-card:active {
  transform: scale(0.99);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.ai-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: var(--badge-green-bg);
  color: var(--badge-green-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 8px;
}

.card-info {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  gap: 8px;
}

.btn-clean {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-clean:hover {
  background-color: var(--badge-bg);
}

.btn-primary-sm {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* Bottom Tab Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  z-index: 30;
}

.bottom-nav-inner {
  max-width: 680px;
  width: 100%;
  display: flex;
  height: 56px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item span {
  font-size: 16px;
}

/* Simple Clean Form for My Search */
.settings-view {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

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

/* Clean Modal / Sheet */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  background-color: var(--bg-card);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px;
  border: 1px solid var(--border);
  animation: slideUp 0.2s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.detail-section {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
