/* LaunchDesk Shared Demo Companion Toolbar */

:root {
  --ld-comp-bg: rgba(10, 17, 34, 0.85);
  --ld-comp-border: rgba(255, 255, 255, 0.1);
  --ld-comp-text: #e2e8f0;
  --ld-comp-muted: #94a3b8;
  --ld-comp-accent: #fbbf24;
  --ld-comp-accent-glow: rgba(251, 191, 36, 0.2);
  --ld-comp-rose: #f43f5e;
}

body.ld-demo-active {
  padding-top: 54px !important; /* Space for fixed toolbar */
}

.ld-companion-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 54px;
  background: var(--ld-comp-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ld-comp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 999999;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ld-comp-text);
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ld-companion-bar.ld-minimized {
  transform: translateY(-100%);
}

.ld-comp-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ld-comp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ld-comp-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.ld-comp-back:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.ld-comp-divider {
  width: 1px;
  height: 24px;
  background: var(--ld-comp-border);
}

.ld-comp-preset-info {
  display: flex;
  flex-direction: column;
}
.ld-preset-switcher {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--ld-comp-border);
  padding: 6px 32px 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px auto;
  transition: all 0.2s ease;
}
.ld-preset-switcher:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.ld-preset-switcher option {
  background: var(--ld-comp-bg);
  color: #fff;
  padding: 8px;
}

.ld-comp-center {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--ld-comp-border);
}

.ld-device-btn {
  background: transparent;
  border: none;
  color: var(--ld-comp-muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.ld-device-btn:hover {
  color: #fff;
}
.ld-device-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ld-comp-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ld-mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--ld-comp-border);
  border-radius: 6px;
  overflow: hidden;
}
.ld-mode-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ld-comp-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}
.ld-mode-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ld-order-btn {
  background: var(--ld-comp-accent);
  color: #000;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 0 10px var(--ld-comp-accent-glow);
  transition: all 0.2s ease;
}
.ld-order-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--ld-comp-accent-glow);
  background: #fde68a;
}

/* Device Simulator Wrapper (When toggled) */
.ld-device-wrapper {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
  transform-origin: top center;
  width: 100%;
  height: calc(100vh - 54px);
  overflow: auto;
  background: #000; /* Backdrop for mobile/tablet framing */
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.ld-device-wrapper.desktop {
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  background: transparent;
}
.ld-device-wrapper.tablet {
  width: 768px;
  max-width: calc(100% - 24px);
  height: calc(100vh - 75px);
  max-height: 900px;
  border: 12px solid #1e293b;
  border-radius: 24px;
  margin: 10px auto;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  background: #fff;
  box-sizing: border-box;
}
.ld-device-wrapper.mobile {
  width: 375px;
  max-width: calc(100% - 24px);
  height: calc(100vh - 75px);
  max-height: 750px;
  border: 14px solid #1e293b;
  border-radius: 36px;
  margin: 10px auto;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  background: #fff;
  box-sizing: border-box;
}

.ld-device-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

@media (max-width: 900px) {
  .ld-comp-center { display: flex; }
  .ld-mode-toggle { display: none; }
}
@media (max-width: 600px) {
  .ld-comp-preset-info { display: none; }
  .ld-comp-back span { display: none; }
}

/* Global Responsive Admin Panel Rules for All Demo Admin Pages */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .admin-layout, .admin-container, .admin-dashboard, .dashboard {
    flex-direction: column !important;
    display: flex !important;
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  .admin-sidebar, .sidebar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
  }

  .admin-brand, .logo {
    margin-bottom: 16px !important;
    font-size: 18px !important;
  }

  .admin-nav, .sidebar ul {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    display: flex !important;
  }

  .admin-nav a, .sidebar li {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
  }

  .admin-main, .dashboard-content {
    margin-left: 0 !important;
    padding: 20px 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .kpi-grid, .dashboard-grid, .kpi-section, .retainer-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    display: grid !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .kpi-card, .stat-card {
    padding: 16px !important;
  }

  .kpi-card .val, .stat-card .val, .kpi-value, .stat-value {
    font-size: 22px !important;
  }

  .leads-table, .data-table, .crm-table, #appointments-table, .admin-table {
    font-size: 12px !important;
    width: 100% !important;
  }

  .leads-table th, .leads-table td,
  .data-table th, .data-table td,
  .crm-table th, .crm-table td,
  #appointments-table th, #appointments-table td,
  .admin-table th, .admin-table td {
    padding: 10px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .cms-editor, .pricing-editor, .portfolio-cms, .card {
    padding: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .plan-edit-row, #serviceEditorWrapper > div, .menu-item-row, .cms-form, .admin-form, .form-row {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
}

@media (max-width: 600px) {
  .kpi-grid, .dashboard-grid, .kpi-section, .retainer-stats {
    grid-template-columns: 1fr !important;
  }
}

