/* ==========================================================================
   LAS CONVERT — Master Design System (Cyber-Obsidian & Frosted Glass)
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-base: #0a0c10;
  --bg-surface: #11141c;
  --bg-surface-elevated: #181d28;
  --bg-surface-glass: rgba(17, 20, 28, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 240, 255, 0.5);
  
  /* Brand Accents */
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.25);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --accent-danger: #ef4444;

  /* Text & Typography */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Dimensions & Spacing */
  --header-height: 64px;
  --sidebar-width: 250px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px var(--accent-cyan-glow);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Shell Structure */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.06), transparent 40%),
              radial-gradient(circle at 20% 80%, rgba(0, 240, 255, 0.05), transparent 40%),
              var(--bg-base);
}

/* Header */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.brand-logo-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.brand-icon {
  color: #000;
  font-size: 18px;
}

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

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-accent {
  background: linear-gradient(90deg, var(--accent-cyan), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Platform Bar */
.platform-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.platform-switcher-dropdown {
  position: relative;
}

.platform-switch-btn {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.platform-switch-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 200;
  backdrop-filter: blur(20px);
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item:hover, .dropdown-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-item strong {
  display: block;
  font-size: 13px;
}

.dropdown-item small {
  color: var(--text-muted);
  font-size: 11px;
}

.target-item {
  text-decoration: none;
  color: inherit;
}

.target-item .icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.target-item .target-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.target-item .target-details strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary, #ffffff);
}

.target-item .target-details p,
.target-item .target-details small {
  margin: 0;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hw-accel-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.hw-indicator.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.icon-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-cyan);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
}

/* Body / Sidebar + Main Stage */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Toggle button styling (Gemini-style) */
.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan, #00f0ff);
  border-color: rgba(0, 240, 255, 0.2);
}

/* Sidebar */
.sidebar,
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: nowrap;
  padding: 14px 10px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.25s ease,
              border 0.25s ease,
              opacity 0.2s ease;
}

/* Gemini-style collapsed desktop state */
.sidebar.collapsed,
.app-sidebar.collapsed {
  width: 0px !important;
  min-width: 0px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-right: none !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.app-sidebar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.sidebar-category {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 10px 12px 6px;
  text-transform: uppercase;
}

/* Collapsible Sidebar Section Styles */
.sidebar-section {
  margin-bottom: 6px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-section-header:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-section-header .chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  font-size: 10px;
}

/* Rotate chevron when section is collapsed */
.sidebar-section-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.sidebar-section-body {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}

.sidebar-section-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

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

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.12), transparent);
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
}

.worker-status-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.worker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot.online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.worker-subtext {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* Main Content Area */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: transparent;
}

.app-main::-webkit-scrollbar {
  width: 6px;
}

.app-main::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 6px;
}

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

.view-titles h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.view-titles p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* Common UI Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-cyan-glow);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--accent-danger);
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-danger);
}

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

.w-100 {
  width: 100%;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-control {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

select.form-control {
  cursor: pointer;
}

.inline-select {
  padding: 4px 10px;
  font-size: 12px;
  width: auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-cyan { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }

.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-emerald { color: var(--accent-emerald); }
.text-orange { color: var(--accent-orange); }
.text-pink { color: var(--accent-pink); }
.text-muted { color: var(--text-muted); }

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }

/* ==========================================================================
   Mobile Responsive Sidebar & Drawer Overlay Styles
   ========================================================================== */

.mobile-menu-btn {
  display: none;
}

.sidebar-mobile-header {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .sidebar,
  .app-sidebar {
    position: fixed;
    left: -100%; /* Hidden by default */
    top: 0;
    width: 280px; /* Fixed width so it doesn't take the whole screen */
    max-width: 82vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
  }
  
  /* When active class is added via JS */
  .sidebar.mobile-open,
  .app-sidebar.mobile-open {
    left: 0; 
  }
  
  /* Semi-transparent background overlay */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 12px 2px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-mobile-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .app-header {
    padding: 0 12px;
  }

  .platform-bar {
    display: none;
  }

  .hw-accel-badge {
    display: none;
  }

  .app-main {
    padding: 16px 12px;
    width: 100%;
  }
}
