.irdb-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.irdb-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 3rem 0 1rem 0;
}

.irdb-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-family: var(--font-sans);
}

.header-description {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.irdb-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-section {
  margin-bottom: 1.5rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 20, 147, 0.1);
}

.search-bar button {
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--bg);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-bar button i {
  color: var(--bg) !important;
}

.search-bar button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filters select {
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.stat-item {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.stat-item strong {
  color: var(--accent);
  font-size: 1rem;
}

.last-updated {
  text-align: center;
  margin-top: 0.75rem;
}

.update-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.update-badge i {
  font-size: 0.85rem;
}

.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.results {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.result-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.result-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.04);
}

.result-item h3 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1.1rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.content-wrapper {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.content-wrapper p {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.content-wrapper strong {
  color: var(--text);
  margin-right: 0.35rem;
}

.button-group {
  display: flex;
  gap: 0.75rem;
}

.download-button,
.send-button {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.download-button i,
.send-button i {
  color: inherit;
  font-size: 0.85rem;
}

.download-button:hover {
  background: var(--accent);
  color: var(--bg) !important;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.download-button:hover i {
  color: var(--bg) !important;
}

.send-button:hover {
  background: #fff;
  color: #000 !important;
  border-color: #fff;
  transform: translateY(-1px);
}

.send-button:hover i {
  color: #000 !important;
}

.send-button:disabled,
.download-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.send-button.sending {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.send-status {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.send-status.success {
  background: rgba(0, 255, 128, 0.08);
  border-color: rgba(0, 255, 128, 0.3);
  color: #00ff80;
}

.send-status.error {
  background: rgba(255, 68, 68, 0.08);
  border-color: rgba(255, 68, 68, 0.3);
  color: #ff4444;
}

.read-more {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8rem;
  padding: 0;
  margin-left: 0.25rem;
  font-family: var(--font-mono);
}

.read-more:hover {
  color: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.75rem;
}

.page-nav {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.page-nav:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.page-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#currentPage {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.no-results,
.error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.error {
  color: #ff4444;
}

.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.popup-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 460px;
  width: 90%;
  margin: 1rem;
  text-align: center;
}

.popup-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.popup-content h2 {
  margin-bottom: 1rem;
  color: var(--text);
  font-family: var(--font-sans);
}

.popup-content p {
  margin-bottom: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.9rem;
}

.popup-content ul {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.popup-content li {
  padding: 0.4rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.popup-content li i {
  margin-right: 0.5rem;
  color: var(--accent);
}

.close-popup {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--bg);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.close-popup:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .irdb-container {
    padding: 1rem 0.75rem;
  }

  .irdb-header {
    padding: 2rem 0 0.5rem 0;
    margin-bottom: 1.5rem;
  }

  .irdb-header h1 {
    font-size: 1.5rem;
  }

  .irdb-main {
    padding: 1rem;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .stats {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem;
  }

  .button-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .result-item {
    padding: 1rem;
  }

  .content-wrapper {
    flex-direction: column;
    gap: 0.15rem;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar button {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .irdb-header h1 {
    font-size: 1.3rem;
  }

  .irdb-header {
    padding: 1.5rem 0 0.25rem 0;
  }

  .result-item h3 {
    font-size: 1rem;
  }
}
