/* ====== GLOBAL RESET ====== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #ffffff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, 'Helvetica Neue', Arial;
  color: #1f2937;
  overflow-x: hidden;
}

/* ====== LIGHT THEME VARIABLES ====== */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --accent: #4f46e5;
  --muted: #6b7280;
  --text: #1f2937;
  --shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
}

/* ====== DARK THEME VARIABLES (Deep Blue Palette) ====== */
body.dark {
  --bg: #0f1829;          /* Darkest navy background */
  --surface: #192841;     /* Card and container background */
  --accent: #1c2e4a;      /* Buttons and highlights */
  --muted: #203354;       /* Muted tones, borders */
  --text: #E3E9F5;        /* Faint bluish-white text */
  --shadow: 0 6px 16px rgba(10, 15, 30, 0.6);
}

/* ====== BODY ====== */
body {
  background: var(--bg);
  color: var(--text);
  padding: 28px;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

/* ====== APP CONTAINER ====== */
.app {
  max-width: 1200px;
  margin: 0 auto;
}

/* ====== HEADER ====== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

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

.logo {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d8d4ff, #a5b4fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #312e81;
  font-size: 30px;
  box-shadow: var(--shadow);
}

/* ====== HEADER ACTIONS ====== */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ====== BUTTONS ====== */
.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

/* ====== SEARCH BAR ====== */
.search-bar {
  display: grid;
  grid-template-columns: 1fr 200px 200px 120px;
  gap: 12px;
  background: var(--surface);
  padding: 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.search-bar input,
.search-bar select {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px;
  border-radius: 8px;
  color: inherit;
  width: 100%;
}

/* ====== RESPONSIVE SEARCH BAR ====== */
@media (max-width: 800px) {
  .search-bar {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-actions {
    align-self: flex-start;
  }
}

/* ====== MAIN SECTION ====== */
.main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
}

/* ====== FILTERS ====== */
.filters {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

/* Scrollbar for filters */
.filters::-webkit-scrollbar {
  width: 6px;
}

.filters::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.filters h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.filters label {
  font-weight: 600;
  font-size: 13px;
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
}

.filters input,
.filters select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #f0f0f0;
  color: #1f2937;
}

/* Rating range section */
.rating-range {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 14px;
}

.rating-stars {
  color: #facc15;
  font-weight: 700;
  font-size: 18px;
  position: relative;
  top: 2px;
}

/* ====== DARK MODE ADAPTATIONS ====== */
body.dark .filters input,
body.dark .filters select {
  background: #1c2e4a;
  color: var(--text);
  border: 1px solid #23395d;
}

body.dark .filters {
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

body.dark .logo {
  background: linear-gradient(135deg, #1c2e4a, #23395d);
  color: var(--text);
}

body.dark .btn {
  background: var(--accent);
  color: #E3E9F5;
  box-shadow: 0 4px 12px rgba(10, 15, 30, 0.4);
}

body.dark .card {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

body.dark .meta {
  color: #A5B3D9;
}

/* ====== GRID & CARD ====== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ====== CARD MEDIA ====== */
.media {
  height: 150px;
  overflow: hidden;
}

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

/* ====== CARD BODY ====== */
.card-body {
  padding: 12px;
}

.title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 14px;
}
