/* shadcn-style CSS variables */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;

  --success: 142 76% 36%;
  --warning: 38 92% 50%;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  min-height: 100vh;
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  padding: 1rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Navigation */
.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: background-color 0.15s ease;
}

.nav-link:hover {
  background-color: hsl(var(--accent));
}

.nav-link.active {
  background-color: hsl(var(--accent));
  font-weight: 500;
}

.spot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: auto;
}

.spot-indicator.has-spot {
  background-color: hsl(var(--success));
}

.spot-indicator.no-spot {
  background-color: hsl(var(--border));
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-width: 0;
  overflow-x: hidden;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.page-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  min-width: 0;
  overflow: hidden;
}

.card-header {
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background-color: hsl(240 4.8% 91%);
}

.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
}

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

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
}

/* Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

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

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

th {
  background-color: hsl(var(--muted));
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

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

tr:hover td {
  background-color: hsl(var(--muted) / 0.5);
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  padding: 0.75rem;
  background-color: hsl(var(--muted));
  border-radius: var(--radius);
}

.info-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  word-break: break-all;
}

/* Storage display */
.storage-section {
  margin-bottom: 1.5rem;
  min-width: 0;
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.storage-title {
  font-size: 1rem;
  font-weight: 600;
}

.storage-content {
  background-color: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.75rem;
  max-height: 200px;
  overflow: auto;
  white-space: pre;
  margin: 0;
  max-width: 100%;
}

.storage-empty {
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

/* Ad spot container */
.spot-container {
  margin-bottom: 2rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.spot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}

.spot-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spot-id {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.spot-id a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.spot-id a:hover {
  text-decoration: underline;
}

.spot-campaign {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.spot-campaign a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.spot-campaign a:hover {
  text-decoration: underline;
  color: hsl(var(--foreground));
}

.spot-actions {
  display: flex;
  gap: 0.5rem;
}

.spot-content {
  padding: 1rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--background));
}

.spot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--muted));
  border-top: 1px solid hsl(var(--border));
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.spot-meta {
  display: flex;
  gap: 1rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-success {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}

.badge-warning {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

.badge-destructive {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* Form controls */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

select.form-input {
  cursor: pointer;
}

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

.alert-info {
  background-color: hsl(217 91% 60% / 0.1);
  border: 1px solid hsl(217 91% 60% / 0.2);
  color: hsl(217 91% 40%);
}

.alert-warning {
  background-color: hsl(var(--warning) / 0.1);
  border: 1px solid hsl(var(--warning) / 0.2);
  color: hsl(38 92% 35%);
}

/* No spot placeholder */
.no-spot-placeholder {
  text-align: center;
  padding: 3rem;
  color: hsl(var(--muted-foreground));
}

.no-spot-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-spot-text {
  font-size: 1rem;
  font-weight: 500;
}

.no-spot-subtext {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }
}

/* Utility classes */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: hsl(var(--muted-foreground)); }
.font-medium { font-weight: 500; }
.font-mono { font-family: monospace; }
