/* NZBDump Custom Styles */

:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --primary: #238636;
  --primary-hover: #2ea043;
  --secondary: #21262d;
  --secondary-hover: #30363d;
  --accent: #58a6ff;
  --warning: #d29922;
  --danger: #f85149;
  --success: #3fb950;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
}

.hero-logo {
  display: block;
  margin: 0 auto;
}

.logo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.logo-wrapper .badge {
  position: absolute;
  bottom: 40px;
  right: 30px;
}

/* Typography */
h1, h2, h3 {
  margin: 0 0 1rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-break { word-break: break-word; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--secondary);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

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

.btn-group {
  display: inline-flex;
  gap: 0.5rem;
}

/* Forms */
input[type="text"],
input[type="search"],
input[type="email"] {
  width: 100%;
  max-width: 400px;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}

.input-group input[type="text"] {
  max-width: none;
}

input[type="text"]:focus,
input[type="search"]:focus {
  border-color: var(--accent);
}

input[type="text"][readonly] {
  background: var(--bg-tertiary);
  cursor: default;
}

.input-group {
  display: flex;
  gap: 0;
}

.input-group input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.form-row label {
  flex: 0 0 120px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-row .input-group {
  flex: 1;
  min-width: 200px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-transform: uppercase;
}

.badge-primary {
  background: var(--accent);
  color: #fff;
}

.badge-success {
  background: var(--success);
  color: #fff;
}

.badge-warning {
  background: var(--warning);
  color: #000;
}

.badge-danger {
  background: var(--danger);
  color: #fff;
}

.badge-muted {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-info {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}

.alert-warning {
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.alert-danger {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
}

tbody tr:hover {
  background: var(--bg-secondary);
}

td:last-child {
  text-align: right;
}

.table-responsive {
  overflow-x: auto;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.pagination a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
}

.pagination a:hover {
  background: var(--bg-tertiary);
}

.pagination .active a {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--bg-secondary);
  margin: 10vh auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
}

/* Progress bar */
.progress {
  width: 100%;
  max-width: 200px;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
  font-size: 0;
}

/* Utilities */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.nowrap { white-space: nowrap; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* Icons */
.icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
  fill: currentColor;
}

.icon-invert {
  filter: invert(100%);
}

/* Banner */
.banner {
  display: block;
  margin: 2rem auto;
  max-width: 468px;
}

.banner img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Share section (info page) */
.share-section {
  background: var(--bg-secondary);
  padding: 2rem 1rem;
}

.share-section .container {
  max-width: 600px;
}

/* Search results page */
.search-results {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.load-more-container {
  text-align: center;
  padding: 1.5rem 0;
}

.search-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.search-controls select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

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

/* Search page alerts */
.search-alert {
  max-width: 500px;
  margin: 2rem auto;
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius);
}

.search-alert p {
  margin: 0;
  font-size: 1.1rem;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--warning);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* FAQ */
.faq h3,
.faq .lead {
  color: var(--text);
}

.faq ul,
.faq ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.faq li {
  margin-bottom: 0.5rem;
}

.faq hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.faq pre {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.875rem;
}

.faq code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
}

.faq {
  padding-bottom: 3rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--bg-secondary);
}

.faq summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details[open] summary {
  border-bottom: 1px solid var(--border);
}

.faq .faq-content {
  padding: 1rem;
}

.faq .faq-content p:last-child,
.faq .faq-content ul:last-child,
.faq .faq-content ol:last-child,
.faq .faq-content pre:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .hero {
    padding: 2rem 1rem;
  }

  .hero-logo {
    width: 150px;
    height: 150px;
  }

  .logo-wrapper .badge {
    bottom: 30px;
    right: 20px;
  }

  .flex-center {
    flex-direction: column;
    width: 100%;
  }

  .flex-center .btn {
    width: 100%;
    max-width: 400px;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row label {
    flex: none;
    margin-bottom: 0.25rem;
  }

  .form-row .input-group {
    width: 100%;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.5rem;
  }

  .alert {
    font-size: 0.9rem;
  }

  .banner {
    margin: 1.5rem auto;
  }

  /* Search results table */
  .search-results td:last-child {
    text-align: left;
  }

  .search-results .btn-group {
    flex-direction: column;
    gap: 0.25rem;
  }

  .search-results .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .hero-logo {
    width: 120px;
    height: 120px;
  }

  .logo-wrapper .badge {
    bottom: 22px;
    right: 12px;
    font-size: 0.65rem;
  }

  .btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
  }

  .form-row label {
    font-size: 0.75rem;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination a {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
  }
}
