/* ==========================================================================
   KOTHA ENTERPRISE CONSOLE - STYLESHEET
   Aesthetics: Deep Obsidian, Sendbird Violet Accents, Sidebar Navigation & Glassmorphism
   ========================================================================== */

:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-card: rgba(20, 25, 36, 0.85);
  --bg-card-hover: rgba(28, 35, 50, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #742ddd;

  --accent-purple: #6210cc;
  --accent-purple-light: #742ddd;
  --accent-purple-glow: rgba(116, 45, 221, 0.35);
  
  --text-primary: #f0f3f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Glass Panel Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Utility Colors & Typography */
.text-purple { color: var(--accent-purple-light); }
.text-cyan { color: #06b6d4; }
.text-emerald { color: var(--color-success); }
.text-amber { color: var(--color-warning); }
.text-indigo { color: #818cf8; }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-light) 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-purple-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

/* LOGIN SCREEN */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(98, 16, 204, 0.25) 0%, rgba(10, 12, 16, 0.95) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 36px;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo.sm {
  gap: 8px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}

.brand-logo.sm .logo-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
  border-radius: 6px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo.sm .logo-title {
  font-size: 16px;
}

.logo-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

.sendbird-badge {
  background: rgba(116, 45, 221, 0.15);
  color: #c084fc;
  border: 1px solid rgba(116, 45, 221, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.login-body h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  transition: all 0.2s;
}

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

.login-quickfill {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quickfill-title {
  font-size: 11px;
  color: var(--text-muted);
}

/* TOP NAVBAR */
.top-navbar {
  height: 60px;
  background: rgba(18, 22, 31, 0.95);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-env-tag {
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.live-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* METRICS RIBBON */
.metrics-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px 24px 10px 24px;
}

.metric-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.metric-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.metric-icon {
  font-size: 16px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 8px;
}

.metric-value .unit {
  font-size: 14px;
  color: var(--text-muted);
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

/* CONSOLE SPLIT BODY & SIDEBAR */
.console-body {
  display: flex;
  gap: 20px;
  padding: 10px 24px 24px 24px;
}

.console-sidebar {
  width: 230px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: calc(100vh - 200px);
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 0 12px 12px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

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

.nav-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(98, 16, 204, 0.35), rgba(116, 45, 221, 0.2));
  color: #fff;
  border-left: 3px solid var(--accent-purple-light);
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
}

.console-content {
  flex: 1;
  overflow-x: hidden;
}

.card-box {
  padding: 24px;
}

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

.box-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

/* TAB CONTENT AREAS */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* INSPECTOR SPLIT VIEW */
.inspector-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  height: calc(100vh - 220px);
  min-height: 500px;
}

@media (max-width: 1024px) {
  .inspector-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .console-body {
    flex-direction: column;
  }
  .console-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
  }
  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.stream-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stream-panel.single-view {
  height: calc(100vh - 220px);
}

.panel-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.toolbar-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  flex: 1;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  width: 100%;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-controls select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}

/* TABLE STYLING */
.table-container {
  flex: 1;
  overflow-y: auto;
}

.inspector-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.inspector-table th {
  position: sticky;
  top: 0;
  background: #141824;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.inspector-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s;
}

.inspector-table tbody tr:hover {
  background: rgba(116, 45, 221, 0.12);
}

.inspector-table tbody tr.selected {
  background: rgba(116, 45, 221, 0.25);
  border-left: 3px solid var(--accent-purple-light);
}

.inspector-table td {
  padding: 10px 14px;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* METHOD TAGS */
.method-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.method-GET { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.method-POST { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.method-DELETE { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.method-PUT { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 10px;
}

.empty-state i {
  font-size: 32px;
}

/* DETAIL PANEL */
.detail-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.detail-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.empty-detail-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.empty-detail-state i {
  font-size: 36px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.json-code {
  background: #06080c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* API SANDBOX */
.sandbox-container {
  padding: 24px;
}

.sandbox-header {
  margin-bottom: 24px;
}

.sandbox-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
}

.sandbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.flex-3 { flex: 3; }

.sandbox-response {
  display: flex;
  flex-direction: column;
  background: #06080c;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.response-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
}

.sandbox-response pre {
  padding: 16px;
  flex: 1;
  border: none;
  border-radius: 0;
  min-height: 250px;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  padding: 24px;
}

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

.margin-top {
  margin-top: 16px;
}
