/* Google Font Host Grotesk: Weights 400 and 500 only */
@import url('https://fonts.googleapis.com/css2?family=Host+Grotesk:wght@400;500;600&display=swap');

:root {
  --font-family: 'Host Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Light Mode (Default) Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #faf5ff;
  --bg-tertiary: #f5f3ff;
  --bg-card: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #f3e8ff;
  --lilac: #a855f7;
  --lilac-accent: #c084fc;
  
  --border-faint: #f3e8ff;
  --border-subtle: #e2e8f0;
  --border-primary: #ddd6fe;

  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
}

[data-theme="dark"] {
  --bg-primary: #09090b;
  --bg-secondary: #121216;
  --bg-tertiary: #18181b;
  --bg-card: #121216;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-light: #2e1065;
  --lilac: #c084fc;
  --lilac-accent: #d8b4fe;
  
  --border-faint: #27272a;
  --border-subtle: #3f3f46;
  --border-primary: #4c1d95;

  --danger: #ef4444;
  --danger-light: #450a0a;
  --success: #22c55e;
  --success-light: #052e16;
}

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

body {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  box-shadow: none !important;
}

/* Strictly no bold font weights, use only 500 or 400 */
h1, h2, h3, h4, h5, h6, strong, th, .font-medium {
  font-weight: 500;
}

/* Strictly no uppercase transformation */
* {
  text-transform: none !important;
}

/* Strictly no box-shadows */
*, *:before, *:after {
  box-shadow: none !important;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--lilac));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 500;
  font-size: 16px;
}

.brand-title {
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: normal;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.isax-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.isax-icon svg {
  display: block;
}

.nav-item .isax-icon {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.nav-item:hover .isax-icon,
.nav-item.active .isax-icon {
  color: var(--primary);
}

.nav-item:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--border-primary);
  font-weight: 500;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  overflow-y: auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
}

.page-title {
  font-size: 20px;
  color: var(--text-primary);
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-primary);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

.content-body {
  padding: 32px;
  max-width: 1300px;
  width: 100%;
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.metric-value {
  font-size: 28px;
  color: var(--text-primary);
  font-weight: 500;
}

.metric-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* Panels & Tables */
.panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 28px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 17px;
  color: var(--text-primary);
}

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

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

th {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
}

td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
}

tr:hover td {
  background-color: var(--bg-tertiary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-pro {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--border-primary);
}

.badge-free {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.badge-guest {
  background-color: #fff7ed;
  color: #c2410c;
  border-color: #ffedd5;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.input-field {
  width: 100%;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
}

/* Search Bar */
.search-box {
  max-width: 320px;
}

/* Generation Card Grid */
.generation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.gen-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background-color: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gen-preview {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.gen-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.gen-prompt {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gen-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Hidden elements */
.hidden {
  display: none !important;
}
