/* Custom Premium Stylesheet for Catalog Service Developer Dashboard */

:root {
  --bg-color: #080c14;
  --panel-bg: rgba(17, 24, 39, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-glow: rgba(99, 102, 241, 0.15);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --primary-color: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --accent-color: #06b6d4; /* Cyan */
  --accent-hover: #0891b2;
  
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Reset & Scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Glowing Background Orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
  animation: orb-float 20s infinite alternate ease-in-out;
}
.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-color) 0%, rgba(99, 102, 241, 0) 70%);
  top: -10%;
  right: -5%;
}
.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #ec4899 0%, rgba(236, 72, 153, 0) 70%);
  bottom: -10%;
  left: -10%;
  animation-delay: -5s;
}
.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-color) 0%, rgba(6, 182, 212, 0) 70%);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
}

@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 30px) scale(1.1); }
}

/* Common Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 2rem;
}

/* Glassmorphism panel base */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.glass:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Main Header */
.main-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: rgba(13, 19, 33, 0.8);
  border-color: var(--panel-border-glow);
  box-shadow: var(--shadow-glow);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand-logo {
  font-size: 2.2rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
}
.header-brand h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* System Status Indicator */
.system-status {
  padding: 0.5rem 1rem;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.status-online {
  background-color: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
}
.status-online::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--success-color);
  animation: pulse 2s infinite;
  opacity: 0.6;
}
.status-offline {
  background-color: var(--error-color);
  box-shadow: 0 0 10px var(--error-color);
}
.status-offline::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--error-color);
  animation: pulse 2s infinite;
  opacity: 0.6;
}
.status-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Panels */
.dashboard-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 500px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* Typography & Helpers */
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 600; }
.text-dim { color: var(--text-dim); font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-color);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease-in-out;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed 0%, var(--primary-color) 100%);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5), var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent-color) 0%, #0891b2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}
.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #06b6d4 0%, #00e5ff 100%);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}
.btn-loading {
  position: relative;
}

/* Loader Spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Ingestion Source Cards */
.sources-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.source-card {
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
}
.source-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}
.source-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.source-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.source-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.source-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}
.source-type-pill {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
}
.source-code {
  font-size: 0.75rem;
}
.source-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.source-sync-time {
  font-size: 0.8rem;
}
.source-sync-time strong {
  color: var(--text-main);
  font-weight: 500;
}
.source-disabled {
  opacity: 0.55;
  border-style: dashed;
}

/* Toggle Switches */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
input:checked + .toggle-slider {
  background-color: var(--success-color);
}
input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Config Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.config-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.config-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.config-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.config-table tr:last-child td {
  border-bottom: none;
}
.config-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  width: 100%;
  max-width: 180px;
  transition: border-color 0.2s;
}
.config-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Interactive Playground Panels */
.playground-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.playground-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: white;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

.dynamic-params {
  animation: slide-down 0.2s ease-out;
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* URL bar */
.action-bar {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.url-display {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}
.url-display .method {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.url-display .url {
  padding: 0 1rem;
  color: #fff;
  white-space: nowrap;
  overflow-x: auto;
}

/* JSON Response Panel */
.response-viewer {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1;
  min-height: 250px;
}
.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.response-body {
  padding: 1.25rem;
  background: rgba(5, 8, 16, 0.75);
  color: #a5f3fc; /* Soft Cyan */
  font-size: 0.85rem;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  flex: 1;
  max-height: 380px;
}

/* HTTP status codes styles */
.status-2xx { color: var(--success-color); font-weight: 600; }
.status-3xx { color: var(--info-color); font-weight: 600; }
.status-4xx { color: var(--warning-color); font-weight: 600; }
.status-5xx { color: var(--error-color); font-weight: 600; }
.status-pending { color: var(--text-muted); animation: pulse-opacity 1.5s infinite; }
.status-error { color: var(--error-color); font-weight: 600; }

@keyframes pulse-opacity {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Global loading state placeholders */
.loading-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-dim);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transform: translateY(150%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}
.toast-show {
  transform: translateY(0);
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast-icon {
  font-size: 1.2rem;
}
.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
}

/* Toast types */
.toast-success { border-color: rgba(16, 185, 129, 0.3); box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1); }
.toast-error { border-color: rgba(239, 68, 68, 0.3); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1); }
.toast-warning { border-color: rgba(245, 158, 11, 0.3); box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1); }
.toast-info { border-color: rgba(59, 130, 246, 0.3); box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1); }

/* Footer */
.main-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-dim);
}
