@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Vazirmatn",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #111827;
  color: #f9fafb;
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-box h1,
.login-box h2 {
  margin: 0 0 10px;
  text-align: center;
}

.login-box p {
  margin: 0 0 24px;
  color: #9ca3af;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #d1d5db;
  font-size: 14px;
}

input,
select,
button {
  font-family: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #4b5563;
  background: #111827;
  color: #f9fafb;
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
}

select {
  max-width: 240px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input:focus,
select:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

button,
.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.login-btn {
  width: 100%;
  background: #ef4444;
  margin-top: 8px;
}

.alert,
.flash-message {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.top-bar h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.subtitle,
.user-line {
  margin: 0;
  color: #9ca3af;
}

.user-line {
  margin-top: 6px;
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(160px, 240px) auto;
  gap: 10px;
  align-items: center;
}

.logout-link {
  background: #991b1b;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.progress-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  color: #d1d5db;
}

.review-card {
  max-width: 620px;
  margin: 0 auto;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.image-wrapper {
  position: relative;
  width: 100%;
  height: 340px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.image-wrapper::before {
  content: "در حال بارگذاری تصویر...";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 14px;
  background: #fff;
}

.image-wrapper.is-loaded::before {
  display: none;
}

.image-wrapper.has-error::before {
  content: "تصویر قابل نمایش نیست";
  display: flex;
}

.image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.image-wrapper.is-loaded img {
  opacity: 1;
}

.product-meta {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.meta-row {
  line-height: 1.8;
  color: #e5e7eb;
  word-break: break-word;
}

.meta-row strong {
  color: #fca5a5;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.btn-accept {
  background: #16a34a;
}

.btn-decline {
  background: #dc2626;
}

.btn-skip {
  background: #6b7280;
}

.btn-undo {
  background: #2563eb;
}

.btn-nav {
  background: #374151;
}

.empty-state {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 18px;
  padding: 42px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 10px;
}

.empty-state p {
  margin: 0;
  color: #9ca3af;
}

@media (max-width: 900px) {
  .top-bar,
  .top-actions {
    flex-direction: column;
    width: 100%;
  }

  .filter-form {
    width: 100%;
    grid-template-columns: 1fr;
  }

  select {
    max-width: 100%;
  }

  .logout-link {
    width: 100%;
    text-align: center;
  }

  .progress-box {
    flex-direction: column;
  }

  .review-card {
    max-width: 100%;
  }

  .image-wrapper {
    height: 300px;
  }

  .review-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 16px, 100%);
    padding: 12px 0;
  }

  .top-bar h1 {
    font-size: 24px;
  }

  .review-card {
    padding: 12px;
    border-radius: 14px;
  }

  .image-wrapper {
    height: 240px;
    border-radius: 12px;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }

  button,
  .btn {
    width: 100%;
    padding: 14px 16px;
  }
}
