/* ══════════════════════════════════════════════
   SYNTAX SYNDICATE — COMPONENT LIBRARY
   Cards · Forms · Modals · Toasts · Badges · Tabs
   ══════════════════════════════════════════════ */

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}
.card-flat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.card-accent-left {
  border-left: 3px solid var(--accent);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--carbon-black);
}
.card-desc {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.65;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

/* ── CARD ICON ── */
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-bg2);
  border: 1px solid rgba(65,105,225,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-icon-sm {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.card-icon-sm svg {
  width: 16px;
  height: 16px;
}

/* ── FORMS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-label {
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-grey);
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--pale-slate);
  border-radius: 7px;
  font-family: var(--font);
  font-size: .85rem;
  color: var(--carbon-black);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(65,105,225,.1);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--pale-slate-2);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237985a0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-submit {
  padding: 11px 28px;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 600;
  background: var(--carbon-black);
  color: #fff;
  border: none;
  cursor: pointer;
  width: fit-content;
  transition: background .2s;
}
.form-submit:hover { background: var(--gunmetal); }
.form-submit:disabled { opacity: .5; cursor: not-allowed; }
.form-submit-accent {
  padding: 11px 28px;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  width: fit-content;
  transition: background .2s;
}
.form-submit-accent:hover { background: var(--accent-hi); }
.form-error {
  font-size: .72rem;
  color: #d32f2f;
  margin-top: 2px;
}
.form-hint {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: 2px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-2);
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── BADGES / TAGS ── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 100px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-accent {
  background: var(--accent-bg);
  border: 1px solid rgba(65,105,225,0.3);
  color: var(--accent);
}
.badge-green {
  background: rgba(76,175,125,.12);
  color: #2e7d52;
  border: 1px solid rgba(76,175,125,.3);
}
.badge-premium {
  background: linear-gradient(135deg, rgba(108,99,255,.15), rgba(0,245,212,.15));
  border: 1px solid rgba(108,99,255,.35);
  color: #6c63ff;
}
.badge-admin {
  background: rgba(10,14,26,.08);
  border: 1px solid rgba(10,14,26,.2);
  color: var(--carbon-black);
}
.badge-danger {
  background: rgba(211,47,47,.1);
  border: 1px solid rgba(211,47,47,.3);
  color: #d32f2f;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: .6rem;
  padding: 2px 9px;
  border-radius: 4px;
  background: var(--accent-bg);
  border: 1px solid rgba(65,105,225,0.2);
  color: var(--accent);
}

/* ── AVATAR ── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-bg);
  border: 1px solid rgba(65,105,225,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent-hi);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-lg { width: 80px; height: 80px; font-size: 1.4rem; border-radius: 16px; }
.avatar-xl { width: 120px; height: 120px; font-size: 2rem; border-radius: 20px; }

/* ── TABS ── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 20px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--carbon-black); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(65,105,225,.1);
}
.search-bar svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.search-bar input {
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: .85rem;
  color: var(--carbon-black);
  width: 100%;
  background: transparent;
}
.search-bar input::placeholder { color: var(--pale-slate-2); }

/* ── FILTER CHIPS ── */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  transition: all .18s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── DATA TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.data-table th {
  background: var(--tint);
  color: var(--text-3);
  font-weight: 600;
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.data-table tr:hover td { background: var(--bright-snow); }
.data-table tr:last-child td { border-bottom: none; }

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--carbon-black);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: toast-in .3s var(--ease);
  max-width: 380px;
}
.toast.hiding { animation: toast-out .3s var(--ease) forwards; }
.toast-success { border-left: 3px solid #2e7d52; }
.toast-error   { border-left: 3px solid #d32f2f; }
.toast-info    { border-left: 3px solid var(--accent); }
.toast-icon { flex-shrink: 0; font-size: 1rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,14,26,0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: calc(100% - 48px);
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  transform: scale(0.95) translateY(10px);
  transition: transform .25s var(--ease);
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--carbon-black);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  transition: background .2s, color .2s;
}
.modal-close:hover { background: var(--tint); color: var(--carbon-black); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent-bg);
  border: 1px solid rgba(65,105,225,.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}
.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--carbon-black);
}
.empty-state-desc {
  font-size: .85rem;
  color: var(--text-3);
  max-width: 320px;
}

/* ── LOADING / SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--tint) 25%, var(--tint-2) 50%, var(--tint) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 20px; width: 70%; margin-bottom: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 10px; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 32px;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  transition: all .18s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── STAR RATING ── */
.star-rating {
  display: flex;
  gap: 2px;
}
.star-rating .star {
  font-size: 1rem;
  color: var(--pale-slate);
  cursor: pointer;
  transition: color .15s;
}
.star-rating .star.filled { color: #e6a817; }
.star-rating .star:hover { color: #e6a817; }
.star-display {
  color: #e6a817;
  font-size: .72rem;
  letter-spacing: 2px;
}

/* ── STAT CARD ── */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--carbon-black);
  letter-spacing: -.03em;
  line-height: 1;
}
.stat-change {
  font-size: .72rem;
  font-weight: 500;
}
.stat-change.up { color: #2e7d52; }
.stat-change.down { color: #d32f2f; }

/* ── LINK STYLES ── */
.link-accent {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .2s;
}
.link-accent:hover { color: var(--accent-hi); }

/* ── PREMIUM GATE OVERLAY ── */
.premium-gate {
  position: relative;
  overflow: hidden;
}
.premium-gate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(255,255,255,0.95));
  pointer-events: none;
}
.premium-gate-cta {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 26, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
  opacity: 0; visibility: hidden;
  transition: all 0.3s var(--ease);
  padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
  width: 100%; max-width: 500px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s var(--ease);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bright-snow);
}
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--carbon-black); letter-spacing: -0.01em; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: rgba(0, 0, 0, 0.05);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.modal-body { padding: 24px; overflow-y: auto; max-height: 80vh; }

/* ── RESPONSIVE OVERRIDES ── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .modal-content { padding: 0; border-radius: 20px 20px 0 0; position: fixed; bottom: 0; transform: translateY(100%); }
  .modal-overlay.active .modal-content { transform: translateY(0); }
  .modal-body { padding: 20px; }
  .toast { max-width: calc(100vw - 48px); }
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 10px 14px; font-size: .78rem; }
}
