/**
 * SC Demo - Custom Styles
 * AI Chats Scraping CMS
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* ===== Backgrounds (deeper, less purple) ===== */
  --bg-primary:   #0a0e14;
  --bg-secondary: #131720;
  --bg-tertiary:  #1a1f2e;
  --bg-code:      #050810;

  /* ===== Text ===== */
  --text-primary:   #e6e9ef;
  --text-secondary: #b8bdc9;
  --text-muted:     #6b7280;

  /* ===== Accent — Indigo deep (replacing violet) ===== */
  --accent-primary: #6366f1;   /* indigo-500 — primary actions, focused state */
  --accent-light:   #818cf8;   /* indigo-400 — hover, highlights, headings emphasis */
  --accent-pink:    #f472b6;   /* kept for rare gradient/decor use only */

  /* Opacity variants — reuse instead of literal rgba() in inline styles */
  --accent-primary-05:  rgba(99, 102, 241, 0.05);
  --accent-primary-08:  rgba(99, 102, 241, 0.08);
  --accent-primary-10:  rgba(99, 102, 241, 0.10);
  --accent-primary-15:  rgba(99, 102, 241, 0.15);
  --accent-primary-20:  rgba(99, 102, 241, 0.20);
  --accent-primary-30:  rgba(99, 102, 241, 0.30);
  --accent-primary-40:  rgba(99, 102, 241, 0.40);

  /* ===== Semantic colors ===== */
  --color-success: #34d399;   /* emerald-400 */
  --color-warning: #fbbf24;   /* amber-400 */
  --color-error:   #f87171;   /* red-400 */
  --color-info:    #60a5fa;   /* blue-400 */

  /* ===== Borders ===== */
  --border-subtle: #1e2433;
  --border-strong: #2d3748;
  --border-accent: #312e81;   /* indigo-900 */

  /* ===== Gradients ===== */
  --gradient-topbar: linear-gradient(90deg, #4f46e5, #6366f1, #818cf8);
  --gradient-card:   linear-gradient(135deg, #131720 0%, #0a0e14 100%);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Utility Classes */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Card Styles */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
}

.card:hover {
  border-color: var(--border-accent);
  transition: border-color 0.2s ease;
}

.seg-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  z-index: 5;
  pointer-events: none;
}

.seg-badge-branded {
  background: #f59e0b;
  color: #2a1a03;
}

.seg-badge-generic {
  background: #22d3ee;
  color: #04272c;
}

/* Button Styles */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-pink);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
}

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

.btn-success:hover:not(:disabled) {
  opacity: 0.8;
}

.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  opacity: 0.8;
}

/* Badge Styles */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

.badge-admin {
  background: var(--accent-primary-20);
  color: var(--accent-primary);
}

.badge-user {
  background: rgba(96, 165, 250, 0.2);
  color: var(--color-info);
}

.badge-active {
  background: rgba(134, 239, 172, 0.2);
  color: var(--color-success);
}

.badge-inactive {
  background: rgba(248, 113, 113, 0.2);
  color: var(--color-error);
}

/* Alert Styles */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-success {
  background-color: rgba(134, 239, 172, 0.1);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-error {
  background-color: rgba(248, 113, 113, 0.1);
  border-color: var(--color-error);
  color: var(--color-error);
}

.alert-warning {
  background-color: rgba(253, 224, 71, 0.1);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.alert-info {
  background-color: rgba(96, 165, 250, 0.1);
  border-color: var(--color-info);
  color: var(--color-info);
}

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

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-10);
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  transition: background-color 0.2s ease;
}

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

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Sidebar Styles */
.sidebar {
  transition: transform 0.3s ease;
}

/* Header Styles */
header {
  backdrop-filter: blur(10px);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--accent-light);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-pink);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Alpine.js Transitions */
[x-cloak] {
  display: none !important;
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Text Utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
  }
  
  th,
  td {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .no-print {
    display: none !important;
  }
}
