/* public/style.css */
:root {
  --bg-color: #0b0e14;
  --panel-bg: #12172199;
  --panel-border: #ffffff14;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: "Outfit", -apple-system, sans-serif;
  --globe-1: #3b82f626;
  --globe-2: #8b5cf626;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  display: flex;
  position: relative;
  overflow-x: hidden;
  justify-content: center;
  align-items:  flex-start;
  min-height: 100vh;
  padding-top: 10vh;
}

.background-globes {
  position: fixed;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  inset: 0;
}

.globe {
  position: absolute;
  filter: blur(100px);
  border-radius: 50%;
}

.globe-1 {
  background: var(--globe-1);
  width: 600px;
  height: 600px;
  top: -100px;
  left: -100px;
}

.globe-2 {
  background: var(--globe-2);
  width: 500px;
  height: 500px;
  bottom: -50px;
  right: -100px;
}

.container {
  z-index: 10;
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  letter-spacing: -1px;
  margin-bottom: 10px;
  font-size: 3.5rem;
  font-weight: 700;
}

header h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-section {
  position: relative;
  width: 100%;
  margin-bottom: 40px;
}

.search-container {
  display: flex;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  align-items:  center;
  padding: 8px;
  box-shadow: 0 10px 30px #0000004d;
}

.input-wrapper {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  align-items:  center;
  gap: 8px;
  padding: 8px;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  color: #eff6ff;
  display: flex;
  animation: popIn .2s ease;
  background: #3b82f633;
  border: 1px solid #3b82f666;
  border-radius: 6px;
  align-items:  center;
  gap: 6px;
  padding: 4px 10px;
  font-size: .9rem;
}

.tag-pill button {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  line-height: 1;
}

.tag-pill button:hover {
  color: #fff;
}

#tag-search {
  color: var(--text-main);
  font-family: var(--font-family);
  outline: none;
  background: none;
  border: none;
  flex: 1;
  min-width: 200px;
  padding: 4px;
  font-size: 1.1rem;
}

#tag-search::placeholder {
  color: #fff3;
}

#generate-btn {
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  transition: background .2s;
  font-size: 1rem;
  font-weight: 600;
}

#generate-btn:hover {
  background: var(--primary-hover);
}

.search-dropdown-wrapper {
  position: relative;
  width: 100%;
}

.search-results {
  position: absolute;
  border: 1px solid var(--panel-border);
  overflow-y: auto;
  z-index: 100;
  background: #111827;
  border-radius: 8px;
  max-height: 300px;
  top: 10px;
  left: 0;
  right: 0;
  box-shadow: 0 10px 40px #00000080;
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  transition: background .1s;
}

.search-result-item:hover, .search-result-item.active {
  background: #ffffff0d;
}

.search-result-item span.slug {
  color: var(--text-muted);
  font-size: .85rem;
}

.results-section {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  animation: slideUp .4s ease forwards;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px #0000004d;
}

.results-section.hidden {
  display: none;
}

.results-header {
  margin-bottom: 20px;
}

.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 16px;
}

.tab-btn {
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-family);
  background: none;
  border: none;
  padding: 10px 0;
}

.tab-btn.active {
  color: #fff;
}

.tab-btn.active:after {
  content: "";
  position: absolute;
  background: var(--primary);
  height: 2px;
  bottom: -1px;
  left: 0;
  right: 0;
}

.copy-btn {
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  cursor: pointer;
  background: #ffffff0d;
  border-radius: 6px;
  padding: 6px 12px;
  transition: all .2s;
  font-size: .9rem;
}

.copy-btn:hover {
  background: #ffffff1a;
}

.copy-btn.copied {
  background: #10b981;
  border-color: #059669;
}

.tab-content {
  display: none;
  position: relative;
}

.tab-content.active {
  display: block;
  animation: fadeIn .3s;
}

.badge {
  position: absolute;
  color: #fbbf24;
  background: #ffffff1a;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: .75rem;
  font-weight: 600;
  top: 12px;
  right: 12px;
}

.badge.converted {
  color: #34d399;
}

textarea {
  border: 1px solid var(--panel-border);
  color: #c9d1d9;
  resize: vertical;
  outline: none;
  background: #0d1117;
  border-radius: 8px;
  width: 100%;
  height: 400px;
  padding: 16px;
  font-family: Menlo, Monaco, Courier New, monospace;
  font-size: .9rem;
  line-height: 1.5;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal {
  position: fixed;
  display: flex;
  z-index: 1000;
  backdrop-filter: blur(5px);
  background: #000000b3;
  justify-content: center;
  align-items:  center;
  inset: 0;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  display: flex;
  overflow-y: auto;
  border-radius: 12px;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  padding: 30px;
}

.modal-content.large {
  max-width: 800px;
}

.modal-content input, .modal-content textarea {
  border: 1px solid var(--panel-border);
  color: #fff;
  font-family: var(--font-family);
  outline: none;
  background: #0000004d;
  border-radius: 6px;
  width: 100%;
  padding: 10px;
}

.upvote-btn {
  color: #34d399;
  cursor: pointer;
  display: inline-flex;
  background: #10b98133;
  border: 1px solid #10b981;
  border-radius: 4px;
  align-items:  center;
  gap: 5px;
  margin-left: 10px;
  padding: 4px 8px;
  transition: all .2s;
  font-size: .8em;
}

.upvote-btn:hover:not(:disabled) {
  background: #10b98166;
}

.upvote-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.rule-meta {
  display: flex;
  border-bottom: 1px solid #ffffff1a;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 10px;
  padding-bottom: 5px;
  font-size: .9em;
}

#toast-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  bottom: 20px;
  right: 20px;
}

.toast {
  color: #fff;
  backdrop-filter: blur(5px);
  animation: slideInRight .3s ease-out forwards;
  background: #3b82f6e6;
  border: 1px solid #fff3;
  border-radius: 8px;
  max-width: 300px;
  padding: 12px 20px;
  font-size: .95em;
  box-shadow: 0 4px 12px #0003;
}

.toast.error {
  background: #ef4444e6;
}

.toast.success {
  background: #10b981e6;
  top: auto;
}

.toast.fade-out {
  animation: fadeOut .3s ease-in forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  overflow-y: auto;
  gap: 20px;
  max-height: 60vh;
  margin-top: 15px;
}

.category-group h3 {
  color: var(--primary);
  border-bottom: 1px solid #ffffff1a;
  margin-bottom: 10px;
  padding-bottom: 5px;
  font-weight: 500;
}

.category-tag {
  display: inline-block;
  cursor: pointer;
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 4px;
  margin: 4px;
  padding: 6px 12px;
  transition: all .2s;
}

.category-tag:hover {
  background: #ffffff26;
  border-color: #60a5fa;
  transform: translateY(-1px);
}
