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

body {
  min-height: 100vh;
  background: #111827;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
}

.container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 36px;
}

h1 {
  margin-top: 18px;
  font-size: 44px;
  color: #7c3aed;
}

.subtitle {
  margin-top: 10px;
  color: #d1d5db;
  font-size: 17px;
  line-height: 1.4;
}

.tagline {
  margin-top: 10px;
  margin-bottom: 28px;
  color: #9ca3af;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.actions {
  display: grid;
  gap: 18px;
}

button {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

#scanButton {
  background: #7c3aed;
}

#searchButton {
  background: #2563eb;
}

.recent {
  margin-top: 40px;
  padding: 22px;
  background: #1f2937;
  border-radius: 15px;
}

.recent h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.recent p {
  color: #d1d5db;
}

footer {
  margin-top: 50px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}
.hidden {
  display: none;
}

.search-panel {
  margin-top: 28px;
  padding: 20px;
  background: #1f2937;
  border-radius: 15px;
}

.search-panel label {
  display: block;
  margin-bottom: 10px;
  color: #d1d5db;
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  min-width: 0;
  flex: 1;
  padding: 14px;
  border: 1px solid #374151;
  border-radius: 10px;
  background: #111827;
  color: white;
  font-size: 16px;
}

.search-row input:focus {
  outline: 2px solid #7c3aed;
  border-color: transparent;
}

#submitSearchButton {
  width: auto;
  margin: 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: #7c3aed;
  font-size: 16px;
}

#searchStatus {
  margin-top: 16px;
  color: #9ca3af;
}

.search-results {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.card-result {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid #374151;
  border-radius: 12px;
  background: #111827;
  cursor: pointer;
}

.card-result img {
  width: 90px;
  height: auto;
  border-radius: 7px;
}

.card-result-info {
  min-width: 0;
}

.card-result-info h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.card-result-info p {
  margin-bottom: 5px;
  color: #d1d5db;
  font-size: 14px;
}

.card-result-info .card-price {
  margin-top: 8px;
  color: #a78bfa;
  font-weight: 700;
}
.card-detail-panel {
  margin-top: 30px;
  padding: 20px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 16px;
}

.close-detail-button {
  width: auto;
  margin: 0 0 18px auto;
  padding: 9px 13px;
  display: block;
  background: #374151;
  color: #d1d5db;
  border-radius: 9px;
  font-size: 14px;
}

.selected-card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.selected-card-header img {
  width: 90px;
  height: auto;
  border-radius: 8px;
}

.selected-card-header h2 {
  margin-bottom: 8px;
  font-size: 23px;
}

.selected-card-header p {
  margin-bottom: 6px;
  color: #d1d5db;
  font-size: 14px;
}

.detail-field {
  margin-top: 22px;
}

.detail-field label {
  display: block;
  margin-bottom: 9px;
  color: #d1d5db;
  font-weight: 700;
}

.detail-field select,
.detail-field input {
  width: 100%;
  padding: 14px;
  border: 1px solid #4b5563;
  border-radius: 10px;
  background: #111827;
  color: white;
  font-size: 17px;
}

.detail-field select:focus,
.detail-field input:focus {
  outline: 2px solid #7c3aed;
  border-color: transparent;
}

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

.price-box {
  padding: 15px;
  background: #111827;
  border-radius: 11px;
}

.price-box span {
  display: block;
  margin-bottom: 7px;
  color: #9ca3af;
  font-size: 13px;
}

.price-box strong {
  color: #a78bfa;
  font-size: 20px;
}

.money-input,
.percentage-input {
  display: flex;
  align-items: center;
  border: 1px solid #4b5563;
  border-radius: 10px;
  background: #111827;
}

.money-input span,
.percentage-input span {
  padding: 0 14px;
  color: #9ca3af;
  font-size: 18px;
}

.money-input input,
.percentage-input input {
  border: none;
  background: transparent;
}

.quick-percentages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 14px;
}


.quick-percentages button {
    margin: 0;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    color: white;
}

.quick-percentages button:nth-child(1) {
    background: #16a34a;
}

.quick-percentages button:nth-child(2) {
    background: #2563eb;
}

.quick-percentages button:nth-child(3) {
    background: #7c3aed;
}

.quick-percentages button:nth-child(4) {
    background: #f59e0b;
}

.quick-percentages button:nth-child(5) {
    background: #dc2626;
}
.offer-result {
    margin-top: 25px;
    background: linear-gradient(135deg,#6d28d9,#8b5cf6);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}

.offer-result strong {
    font-size: 36px;
}

@media (max-width: 380px) {
  .selected-card-header {
    flex-direction: column;
  }

  .selected-card-header img {
    width: 150px;
    margin: auto;
  }

  .quick-percentages {
    grid-template-columns: repeat(3, 1fr);
  }
}
