/* ==========================================================================
   Conduit Design System - Custom CSS
   ========================================================================== */

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 100px;
  background-color: #2e5dff;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background-color: #1a3fb3;
  box-shadow: 0 2px 8px rgba(46, 93, 255, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background-color: #a3a3a0;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 100px;
  background-color: transparent;
  color: #2e5dff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1.5px solid #2e5dff;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

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

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 100px;
  background-color: #ef4444;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-danger:hover {
  background-color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:active {
  transform: scale(0.98);
}

/* ---------- Cards ---------- */

.card {
  background-color: #fff;
  border-radius: 16px;
  border: 1px solid #e8e8e6;
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.04), 0 1px 2px rgba(10, 10, 10, 0.02);
}

.card:hover {
  box-shadow: 0 2px 8px rgba(10, 10, 10, 0.06), 0 1px 3px rgba(10, 10, 10, 0.04);
  transform: translateY(-1px);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* ---------- Inputs ---------- */

.input-field {
  display: block;
  padding: 0.625rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #d4d4d0;
  background-color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #0a0a0a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.input-field::placeholder {
  color: #a3a3a0;
}

.input-field:focus {
  border-color: #2e5dff;
  box-shadow: 0 0 0 3px rgba(46, 93, 255, 0.1);
}

.input-field:disabled {
  background-color: #f2f2f0;
  color: #a3a3a0;
  cursor: not-allowed;
}

/* ---------- Tables ---------- */

.table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #e8e8e6;
  background-color: #fff;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table-wrapper thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #737370;
  background-color: #fafafa;
  border-bottom: 1px solid #e8e8e6;
  white-space: nowrap;
  user-select: none;
}

.table-wrapper thead th.sortable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.table-wrapper thead th.sortable:hover {
  color: #0a0a0a;
}

.table-wrapper thead th.sortable::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.5rem;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #d4d4d0;
}

.table-wrapper thead th.sortable.sort-asc::after {
  border-top: none;
  border-bottom: 5px solid #2e5dff;
}

.table-wrapper thead th.sortable.sort-desc::after {
  border-top: 5px solid #2e5dff;
}

.table-wrapper tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f2f2f0;
  color: #0a0a0a;
}

.table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

.table-wrapper tbody tr:hover {
  background-color: #fafafa;
}

/* ---------- Sidebar slide panel ---------- */

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background-color: #fff;
  border-left: 1px solid #e8e8e6;
  box-shadow: -4px 0 24px rgba(10, 10, 10, 0.08);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.slide-panel.is-open {
  transform: translateX(0);
}

/* ---------- Scrollbar styling ---------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #d4d4d0;
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #a3a3a0;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #d4d4d0 transparent;
}

/* ---------- Select dropdown ---------- */

.select-field {
  display: block;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #d4d4d0;
  background-color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  color: #0a0a0a;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23737370' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.select-field:focus {
  border-color: #2e5dff;
  box-shadow: 0 0 0 3px rgba(46, 93, 255, 0.1);
}

/* ---------- Markdown/prose styling ---------- */

.prose h1 { font-size: 1.5rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }
.prose h2 { font-size: 1.25rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.prose h3 { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.prose p { margin: 0.5rem 0; line-height: 1.6; }
.prose ul, .prose ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li { margin: 0.25rem 0; }
.prose code { background: #f2f2f0; padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-size: 0.875em; }
.prose pre { background: #f2f2f0; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 0.75rem 0; }
.prose pre code { background: none; padding: 0; }
.prose strong { font-weight: 600; }
.prose blockquote { border-left: 3px solid #d4d4d0; padding-left: 1rem; margin: 0.75rem 0; color: #737370; }
.prose a { color: #2e5dff; text-decoration: underline; }
.prose hr { border-color: #e8e8e6; margin: 1rem 0; }

/* ---------- Utilities ---------- */

.text-gradient {
  background: linear-gradient(135deg, #2e5dff 0%, #4a73ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Animations ---------- */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.page-enter {
  animation: fadeInUp 200ms ease-out both;
}

.stagger-enter {
  opacity: 0;
  animation: fadeInUp 200ms ease-out both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

.skeleton {
  background: linear-gradient(90deg, #e8e8e6 25%, #f2f2f0 50%, #e8e8e6 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 8px;
  display: block;
}
