/* ==========================================================================
   COMPONENTS
   Brand filter, Search, Phone Cards, Compare Drawer, Specs Modal, Toast
   ========================================================================== */

/* --------------------------------------------------------------------------
   Search & Filter Hub
   -------------------------------------------------------------------------- */
.filter-hub {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.search-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.9rem 3.5rem 0.9rem 3rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-normal);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
  background: rgba(15, 23, 42, 0.9);
}

.search-shortcut-badge {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.sort-select-wrapper {
  position: relative;
  min-width: 200px;
}

.sort-select {
  width: 100%;
  height: 100%;
  padding: 0.9rem 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: var(--transition-normal);
}

.sort-select:focus {
  border-color: var(--accent-indigo);
}

/* --------------------------------------------------------------------------
   Brand Filter Chips Bar (Brand အလိုက် ရှာဖွေနိုင်ခြင်း)
   -------------------------------------------------------------------------- */
.brand-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1rem;
  scrollbar-width: thin;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  user-select: none;
}

.brand-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.brand-chip.active {
  background: var(--grad-primary);
  color: #0f172a;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.brand-chip .chip-count {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-full);
}

.brand-chip.active .chip-count {
  background: rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

/* Category Filter Tabs */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.category-tab {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.category-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.category-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Filter Summary / Active criteria */
.filter-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reset-filters-btn {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Phone Card (3D Tilt & Glassmorphism)
   -------------------------------------------------------------------------- */
.phone-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
}

.phone-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4), 0 0 25px rgba(6, 182, 212, 0.2);
}

.card-top-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-badge.flagship {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-badge.camera {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.card-badge.gaming {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.card-badge.foldable {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.card-badge.midrange {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.fav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.fav-btn.active {
  color: var(--accent-rose);
}

.card-image-wrap {
  width: 100%;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at center, rgba(255,255,255,0.04) 0%, transparent 70%);
}

.card-image {
  max-height: 165px;
  max-width: 85%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.phone-card:hover .card-image {
  transform: scale(1.08) translateY(-4px);
}

.card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-brand {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 0.75px;
  margin-bottom: 0.2rem;
}

.card-model {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-amber);
  font-weight: 700;
}

/* Mini Score Bars */
.card-scores {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.score-bar-bg {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  margin: 0 0.6rem;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
}

/* Highlights preview */
.card-specs-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
}

.card-spec-item {
  display: flex;
  flex-direction: column;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-spec-item .spec-label {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.card-spec-item .spec-val {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.card-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

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

.btn-compare-check {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-compare-check:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-compare-check.selected {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-view-details {
  padding: 0.55rem 0.95rem;
  background: var(--grad-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-view-details:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Comparison Floating Bar & Drawer
   -------------------------------------------------------------------------- */
.compare-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-full);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(6, 182, 212, 0.3);
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.compare-floating-bar.visible {
  transform: translateX(-50%) translateY(0);
}

.compare-bar-thumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-thumb-slot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.compare-thumb-slot.filled {
  border-style: solid;
  border-color: var(--accent-cyan);
  background: #1e293b;
}

.compare-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-thumb-remove {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(244, 63, 94, 0.9);
  color: white;
  width: 16px;
  height: 16px;
  font-size: 10px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
}

.compare-thumb-slot.filled:hover .compare-thumb-remove {
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-open-compare {
  background: var(--grad-primary);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-open-compare:hover {
  transform: scale(1.04);
}

.btn-clear-compare {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Comparison Modal
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 2rem;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  font-size: 1.25rem;
}

.modal-close-btn:hover {
  background: var(--accent-rose);
  color: white;
}

/* Compare Matrix Table */
.compare-matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.compare-matrix-table th,
.compare-matrix-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.compare-matrix-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  width: 22%;
}

.compare-matrix-table td {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.compare-col-header {
  text-align: center !important;
}

.compare-col-header img {
  max-height: 100px;
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Specs Modal Details
   -------------------------------------------------------------------------- */
.detail-modal-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-modal-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.detail-modal-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.detail-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.detail-spec-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.detail-spec-card h4 {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.detail-spec-card p {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Highlights List */
.highlights-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.highlight-pill {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease, slideUp 0.3s ease;
  pointer-events: auto;
}
