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

body {
  background: #1b1b1b;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* Country navigation */
.country-nav {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
}

.country-link {
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s, filter 0.2s;
  filter: grayscale(80%);
  display: flex;
  align-items: center;
}

.country-link img {
  display: block;
}

.country-link:hover {
  opacity: 1;
  filter: grayscale(0%);
}

.country-link.active {
  opacity: 1;
  filter: grayscale(0%);
}

.region-label {
  color: #888;
  font-size: 12px;
  margin-right: 4px;
  align-self: center;
}

.region-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #ccc;
  z-index: 1000;
}

.region-banner a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.region-banner a:hover {
  text-decoration: underline;
}

.region-banner-close {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.region-banner-close:hover {
  color: #fff;
}

h1 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #fff;
}

/* Logo styling */
.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.logo-disk {
  color: #60a5fa;
}

.logo-dojo {
  color: #fff;
  position: relative;
}

.logo-dojo::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  border-radius: 2px;
}

.tagline {
  color: #aaa;
  margin-bottom: 24px;
  font-size: 14px;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: #252525;
  border: 1px solid #333;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 6px 10px;
  background: #1b1b1b;
  border: 1px solid #444;
  color: #eee;
  border-radius: 4px;
  font-size: 13px;
  min-width: 120px;
}

.filter-group select:focus {
  outline: none;
  border-color: #6cb6ff;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-primary, .btn-secondary {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: #4ade80;
  color: #000;
}

.btn-primary:hover {
  background: #22c55e;
}

.btn-secondary {
  background: #444;
  color: #eee;
}

.btn-secondary:hover {
  background: #555;
}

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

.results-count {
  font-size: 13px;
  color: #888;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a2a;
}

th {
  background: #252525;
  color: #ccc;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
}

th.sortable:hover {
  color: #fff;
  background: #303030;
}

th.sortable::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  opacity: 0.3;
}

th.sortable:hover::after {
  border-top-color: #888;
  margin-top: 2px;
}

th.sort-asc::after {
  border-bottom-color: #4ade80;
  border-top-color: transparent;
  margin-top: -2px;
  opacity: 1;
}

th.sort-desc::after {
  border-top-color: #4ade80;
  border-bottom-color: transparent;
  margin-top: 2px;
  opacity: 1;
}

tr:hover {
  background: #252525;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-sm {
  width: 1%;
  white-space: nowrap;
}

.value {
  font-weight: bold;
  color: #fff;
}

.best {
  color: #4ade80;
  font-weight: bold;
}

.link a {
  text-decoration: none;
}

.link a:hover {
  text-decoration: underline;
}

/* Model name links */
td a:not(.source-amazon):not(.source-ebay):not(.source-newegg):not(.view-btn) {
  color: #6cb6ff;
  text-decoration: none;
}

td a:not(.source-amazon):not(.source-ebay):not(.source-newegg):not(.view-btn):hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* Disk type styling */
.type {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.type-hdd {
  color: #60a5fa;
}

.type-ssd {
  color: #a78bfa;
}

/* Disk-specific: Interface colors */
.interface {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.interface-sata {
  color: #aaa;
}

.interface-sas {
  color: #7dd3fc;
}

.interface-nvme {
  color: #c4b5fd;
}

/* Condition indicators */
.condition {
  font-size: 12px;
}

.cond-new {
  color: #22c55e;
}

.cond-used {
  color: #aaa;
}

/* Form factor styling */
.form {
  font-size: 13px;
}

.form-m2 {
  color: #a78bfa;
}

.form-35 {
  color: #60a5fa;
}

.form-25 {
  color: #aaa;
}

/* Source/Link styling */
a.source-amazon {
  color: #fb923c;
}

a.source-ebay {
  color: #60a5fa;
}

a.source-newegg {
  color: #aaa;
}

footer {
  border-top: 1px solid #333;
  padding-top: 16px;
  color: #888;
  font-size: 13px;
}

footer a {
  color: #6cb6ff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.loading {
  color: #888;
  padding: 40px 0;
}

.error {
  color: #f87171;
  padding: 40px 0;
}

/* Main layout with sidebar */
.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.content {
  flex: 1;
  min-width: 0;
}

.info-panels {
  flex-shrink: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-panel {
  background: #252525;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 13px;
}

.info-panel h3 {
  font-size: 13px;
  color: #fff;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-panel p {
  color: #aaa;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.info-panel p:last-child {
  margin-bottom: 0;
}

.info-panel a {
  color: #6cb6ff;
  text-decoration: none;
}

.info-panel a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .info-panels {
    display: none;
  }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
    font-size: 13px;
  }

  th, td {
    padding: 8px 6px;
  }

  h1 {
    font-size: 20px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group select {
    min-width: 100%;
  }

  .filter-actions {
    margin-left: 0;
    margin-top: 8px;
  }
}
