/* ==========================================================================
   BUTTONS (Solid Studio Brand Styling — No Gradients)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
}

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

.btn-primary {
  background-color: var(--brand-purple);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.20), 0 4px 14px rgba(90, 64, 119, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-purple-dark);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 6px 20px rgba(90, 64, 119, 0.45);
  transform: translateY(-1px);
  color: #FFFFFF;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-purple-light);
  border: 1px solid var(--brand-purple-border);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--brand-purple-tint);
  border-color: var(--brand-purple-light);
  color: #FFFFFF;
}

.btn-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
  background-color: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

/* ==========================================================================
   CARDS & STATS (Dark Glassmorphism)
   ========================================================================== */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-md);
  overflow: hidden;
  margin-bottom: 24px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-md);
  border-color: var(--border-color-hover);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-purple {
  background-color: var(--brand-purple-tint);
  color: var(--brand-purple-light);
  border: 1px solid var(--brand-purple-border);
}

.stat-icon-pink {
  background-color: var(--brand-pink-tint);
  color: var(--brand-pink);
  border: 1px solid var(--brand-pink-border);
}

.stat-icon-green {
  background-color: var(--status-published-bg);
  color: var(--status-published-text);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.stat-icon-amber {
  background-color: var(--status-draft-bg);
  color: var(--status-draft-text);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* ==========================================================================
   TABLES & LISTS
   ========================================================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table td {
  padding: 14px 18px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

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

.item-meta-title {
  font-weight: 600;
  color: var(--text-main);
  display: block;
  margin-bottom: 2px;
  transition: color var(--transition-fast);
}

.item-meta-title:hover {
  color: var(--brand-pink);
}

.item-meta-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge-published {
  background-color: var(--status-published-bg);
  color: var(--status-published-text);
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-draft {
  background-color: var(--status-draft-bg);
  color: var(--status-draft-text);
  border-color: rgba(245, 158, 11, 0.25);
}

.badge-modified {
  background-color: var(--status-modified-bg);
  color: var(--status-modified-text);
  border-color: rgba(124, 58, 237, 0.30);
}

.badge-pill {
  border-radius: var(--radius-full);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.20);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-input {
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.switch-input:checked {
  background-color: var(--brand-purple);
}

.switch-input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background-color: #FFFFFF;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.switch-input:checked::before {
  transform: translateX(20px);
}

/* ==========================================================================
   DYNAMIC TAG / CHIP INPUT
   ========================================================================== */
.chip-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 46px;
  cursor: text;
}

.chip-input-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.20);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background-color: var(--brand-pink-tint);
  color: var(--brand-pink);
  border: 1px solid var(--brand-pink-border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
}

.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chip-remove:hover {
  opacity: 1;
}

.chip-raw-input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 120px;
  font-size: 0.875rem;
  color: var(--text-main);
  padding: 2px 0;
}

/* ==========================================================================
   SEARCH BAR
   ========================================================================== */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.20);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 1px 0 rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.removing {
  animation: toastSlideOut 0.25s forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

.toast-success {
  border-left: 4px solid #10B981;
}

.toast-error {
  border-left: 4px solid #EF4444;
}

.toast-info {
  border-left: 4px solid var(--brand-purple-light);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  width: 56px;
  height: 56px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 20px;
}
