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

body {
  font-family: 'Unbounded', sans-serif;
  background-color: #f1f2f6;
  color: #180a73;
  line-height: 1.35;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

/* ===== MAIN CONTAINER ===== */
.main {
  max-width: 100%;
  padding: 16px;
}

/* ===== NAVIGATION BUTTONS ===== */
.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* Кнопка на всю ширину */
.btn-primary {
  background-color: #180a73;
  color: #ade720;
}

.btn-primary:hover {
  background-color: #2a1a9a;
}

/* Ряд из двух кнопок */
.btn-row {
  display: flex;
  gap: 12px;
}

.btn-row .btn {
  flex: 1;
  min-width: 0;
}

/* Вторая кнопка - фиолетовый фон, белый текст */
.btn-secondary {
  background-color: #180a73;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #2a1a9a;
}

/* Третья кнопка - зеленый фон, фиолетовый текст */
.btn-accent {
  background-color: #ade720;
  color: #180a73;
}

.btn-accent:hover {
  background-color: #c4f52a;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background-color: #180a73;
  color: #ade720;
  border: none;
  border-radius: 1.5rem;
  cursor: pointer;
  text-align: center;
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: #2a1a9a;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* ===== CATEGORIES ===== */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category {
  flex-shrink: 0;
  padding: 10px 16px;
  background-color: #fff;
  border-radius: 1.5rem;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 400;
  color: #180a73;
  transition: all 0.2s ease;
}

.category.active {
  background-color: #ade720;
  color: #180a73;
  font-weight: 600;
}

/* ===== CARDS GRID ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ===== CARD ===== */
.card {
  position: relative;
  background-color: #fff;
  border-radius: 1.5rem;
  padding: 16px;
  min-height: 180px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(24, 10, 115, 0.12);
}

.card:active {
  transform: translateY(-2px);
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-emoji {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.card-emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-partner-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background-color: #f1f2f6;
}

.card-partner-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Content */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.card-content h3 {
  font-size: 13px;
  font-weight: 600;
  color: #180a73;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-content p {
  font-size: 11px;
  font-weight: 400;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Action Button */
.card-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  background-color: #ade720;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #180a73;
  font-weight: 600;
  transition: all 0.2s ease;
  z-index: 2;
}

.card-btn:hover {
  background-color: #c4f52a;
  transform: scale(1.1);
}

/* ===== REGISTRATION ===== */
.registration {
  max-width: 400px;
  margin: 20px auto;
  padding: 24px;
  background-color: #fff;
  border-radius: 2rem;
}

.registration h1 {
  font-size: 20px;
  font-weight: 600;
  color: #180a73;
  margin-bottom: 12px;
  text-align: center;
}

.registration p {
  font-size: 13px;
  color: #666;
  margin-bottom: 20px;
  text-align: center;
}

.registration label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #180a73;
}

.registration input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 2px solid #e1e1e1;
  border-radius: 1rem;
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.registration input[type="text"]:focus {
  outline: none;
  border-color: #ade720;
}

.preferences {
  margin-bottom: 20px;
}

.preferences span {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #180a73;
}

.preferences label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px 16px;
  background-color: #f1f2f6;
  border-radius: 1rem;
  cursor: pointer;
  font-weight: 400;
  transition: background-color 0.2s ease;
}

.preferences label:hover {
  background-color: #e8e9ed;
}

.preferences input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #ade720;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(24, 10, 115, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 0;
}

.modal-content {
  background-color: #fff;
  border-radius: 2rem 2rem 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: #180a73;
  margin-bottom: 16px;
  padding-right: 40px;
}

.modal-content p {
  font-size: 14px;
  color: #444;
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-content .close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  background-color: #f1f2f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: #180a73;
  transition: background-color 0.2s ease;
}

.modal-content .close:hover {
  background-color: #e1e2e6;
}

.modal-content a {
  display: inline-block;
  padding: 14px 24px;
  background-color: #ade720;
  color: #180a73;
  text-decoration: none;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.modal-content a:hover {
  background-color: #c4f52a;
}

/* ===== MODAL CONTENT SECTIONS ===== */
.modal-description {
  font-size: 14px;
  color: #333;
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-text {
  font-size: 13px;
  color: #444;
  margin-bottom: 16px;
  line-height: 1.6;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 0.75rem;
  white-space: pre-line;
}

.modal-disclaimer {
  font-size: 12px;
  color: #856404;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  padding: 12px 16px;
  border-radius: 0.75rem;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}

.modal-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background-color: #ade720;
  color: #180a73;
  text-decoration: none;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  transition: background-color 0.2s ease;
}

.modal-btn:hover {
  background-color: #c4f52a;
}

/* ===== LOADING STATE ===== */
.cards:empty::before,
.cards:has(:only-child):not(:has(.card))::before {
  content: '';
}

/* ===== UTILITY ===== */
#content {
  min-height: 200px;
}

/* ===== SMART SEARCH ===== */
.smart-search {
  max-width: 100%;
}

.smart-search h2 {
  font-size: 18px;
  font-weight: 600;
  color: #180a73;
  margin-bottom: 8px;
}

.search-hint {
  font-size: 12px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.4;
}

#searchInput {
  width: 100%;
  padding: 16px;
  border: 2px solid #e1e1e1;
  border-radius: 1rem;
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  margin-bottom: 12px;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s ease;
  caret-color: #180a73;
}

#searchInput:focus {
  outline: none;
  border-color: #ade720;
}

#searchBtn {
  margin-bottom: 20px;
}

.extracted-tags {
  background-color: #f1f2f6;
  padding: 16px;
  border-radius: 1rem;
  margin-bottom: 16px;
}

.tags-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #180a73;
  margin-bottom: 10px;
}

.tag-badge {
  display: inline-block;
  padding: 6px 12px;
  background-color: #ade720;
  color: #180a73;
  border-radius: 1rem;
  font-size: 11px;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 8px;
}

.results-title {
  font-size: 16px;
  font-weight: 600;
  color: #180a73;
  margin-bottom: 16px;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  color: #666;
}

.error-message {
  background-color: #ffe5e5;
  color: #d32f2f;
  padding: 16px;
  border-radius: 1rem;
  font-size: 13px;
  margin-top: 16px;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  color: #666;
  background-color: #f1f2f6;
  border-radius: 1rem;
  margin-top: 16px;
}
