/* -----------------------------------------------------------
   CLOUD EXPLORER — PROVIDER ONBOARDING DARK THEME
   Clean, polished, modern blue-on-dark aesthetic
-----------------------------------------------------------*/

:root {
  --cx-bg: #0B0E12;              /* Your primary bg */
  --cx-panel: #11151b;           /* Slightly lighter panel */
  --cx-tile: #171d25;            /* Tile card */
  --cx-border: #1f2937;          /* Subtle border */
  --cx-text: #cbd5e1;            /* Light gray-blue */
  --cx-text-dim: #64748b;        /* Muted */
  --cx-accent: #0070f3;          /* Accent blue */
  --cx-accent-hover: #339CFF;    /* Hover blue */
  --cx-success: #22c55e;         /* Green success */
  --cx-danger: #ef4444;          /* Red danger */
}

/* Panel layout */
.provider-onboarding-panel {
  background: var(--cx-panel);
  padding: 24px;
  border-radius: 14px;
  margin: 16px auto;
  width: 100%;
  max-width: 1000px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  animation: fadeInScale 0.25s ease-out forwards;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.provider-title {
  color: var(--cx-text);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.provider-subtitle {
  color: var(--cx-text-dim);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* Tile grid */
.provider-tiles {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Individual tile */
.provider-tile {
  flex: 1 1 240px;
  background: var(--cx-tile);
  padding: 18px 16px;
  border-radius: 12px;
  border: 1px solid var(--cx-border);
  text-align: center;
  transition: all 0.2s ease;
}

.provider-tile:hover {
  border-color: var(--cx-accent);
  box-shadow: 0 0 10px rgba(0,112,243,0.25);
  transform: translateY(-2px);
}

/* Disabled tiles */
.provider-tile.disabled {
  opacity: 0.4;
  filter: grayscale(0.4);
  box-shadow: none;
  transform: none;
}

.provider-name {
  margin-top: 8px;
  font-size: 1.1rem;
  color: var(--cx-text);
  font-weight: 500;
}

.provider-status {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--cx-text-dim);
}

.provider-status.connected {
  color: var(--cx-success);
  font-weight: 600;
}

/* Icons */
.provider-icon {
  font-size: 2.2rem;
}

/* Azure icon tint */
.provider-icon.azure {
  color: var(--cx-accent);
}

/* Actions */
.provider-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Buttons */
.provider-btn {
  background: var(--cx-accent);
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.provider-btn:hover {
  background: var(--cx-accent-hover);
  box-shadow: 0 0 12px rgba(51,156,255,0.55);
}

.provider-btn.connect-btn {
  background: var(--cx-accent);
}

.provider-btn.config-btn {
  background: #1e293b;
  border: 1px solid #334155;
}

.provider-btn.config-btn:hover {
  background: #273449;
}

.provider-btn.remove-btn {
  background: var(--cx-danger);
}

.provider-btn.remove-btn:hover {
  background: #f87171;
}

/* -----------------------------------------------------------
   MODAL — Azure Device Login
-----------------------------------------------------------*/

.provider-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99900;
  animation: fadeIn 0.2s ease-out forwards;
}

.provider-modal-content {
  background: var(--cx-panel);
  padding: 26px 28px;
  border-radius: 16px;
  width: 420px;
  max-width: 95%;
  box-shadow: 0 6px 30px rgba(0,0,0,0.45);
  border: 1px solid var(--cx-border);
  text-align: center;
}

.provider-modal-content h3 {
  font-size: 1.25rem;
  color: var(--cx-text);
  margin-bottom: 16px;
}

.provider-modal-content p {
  color: var(--cx-text-dim);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.azure-uri {
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 10px;
  border-radius: 8px;
  color: var(--cx-accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.azure-code {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 12px;
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.cancel-btn {
  background: #1e293b;
  border: 1px solid #334155;
}

.cancel-btn:hover {
  background: #273449;
}

/* Fade animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Collapsible behavior */
#provider-onboarding.hidden-panel {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

#provider-onboarding.visible-panel {
  max-height: 700px;  /* enough room for tiles */
  opacity: 1;
  overflow: visible;
  transition: all 0.25s ease;
}

/* ===============================
   PROVIDER AUTH MODAL (Dark Glass)
   =============================== */

.provider-auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.provider-auth-content {
  background: linear-gradient(145deg, #0b0e12 0%, #141a25 100%);
  border: 1px solid rgba(80, 150, 255, 0.18);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 122, 255, 0.2);
  padding: 28px 34px;
  width: 420px;
  max-width: 90%;
  border-radius: 14px;
  color: #dce7ff;
  font-family: Inter, sans-serif;
  animation: scaleIn 0.2s ease-out;
}

.provider-auth-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #6bb0ff;
  text-shadow: 0 0 8px rgba(80, 150, 255, 0.4);
}

.provider-auth-content p {
  font-size: 0.95rem;
  color: #9cb7dd;
  margin-bottom: 20px;
  line-height: 1.4;
}

.auth-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(80, 150, 255, 0.15);
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.auth-box label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #7ea6ff;
  letter-spacing: 0.05em;
}

.auth-box .code {
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 6px rgba(80, 150, 255, 0.4);
}

.auth-link {
  display: inline-block;
  background: #0070f3;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  margin-top: 8px;
  text-decoration: none;
  text-align: center;
  width: 100%;
  font-weight: 500;
  transition: background 0.15s ease;
}

.auth-link:hover {
  background: #339cff;
}

.auth-close {
  margin-top: 16px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: #9cb7dd;
  padding: 8px;
  border: 1px solid rgba(80, 150, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #cdddff;
  border-color: rgba(80, 150, 255, 0.25);
}

/* Entrance animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.copy-btn {
  padding: 6px 10px;
  background: rgba(80, 150, 255, 0.15);
  border: 1px solid rgba(80, 150, 255, 0.25);
  color: #a9c9ff;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(80, 150, 255, 0.25);
  color: #fff;
}

#provider-status-summary {
  margin: 10px 0 20px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: #a8c3ff;
  font-size: 0.9rem;
}

.provider-summary-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.provider-label {
  font-weight: 600;
  color: #c7dcff;
}

.provider-connected {
  color: #76ffb3;
}

.provider-disconnected {
  color: #6680aa;
}

.provider-meta {
  color: #7c9ad8;
  font-style: italic;
}

.provider-status {
  font-size: 14px;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.provider-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.provider-status .dot.green {
  background-color: #4ade80;
}

.provider-status .dot.gray {
  background-color: #9ca3af;
}

#provider-status-summary {
  display: none;                /* default hidden until something is linked */
  background: #050816;          /* matches your dark header */
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 4px 18px;
  font-size: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Segoe UI", sans-serif;
  color: #e5e7eb;
}

#provider-status-summary .provider-status-shell {
  display: flex;
  gap: 24px;
  align-items: center;
}

#provider-status-summary .provider-status-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

#provider-status-summary .prov-name {
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #93c5fd;          /* Azure blue */
}

#provider-status-summary .prov-state {
  color: #22c55e;          /* green “Connected” */
  font-weight: 500;
}

#provider-status-summary .prov-meta {
  color: #9ca3af;
}

#provider-status-summary .prov-meta.subtle {
  opacity: 0.8;
  font-style: italic;
}

/* ============================
   Better Mobile Status Display
   ============================ */
@media (max-width: 600px) {
  #provider-status-summary {
    padding: 8px 12px !important;
  }

  .provider-status-shell {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .provider-status-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.3;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
  }

  .provider-status-row .prov-name {
    font-weight: 700;
    color: #60a5fa;
  }

  .prov-meta {
    opacity: 0.85;
    font-size: 0.85rem;
  }
}

#provider-auth-modal {
  position: fixed;
  z-index: 999999 !important;
  inset: 0;
}

.provider-auth-content {
  position: relative;
  z-index: 1000000 !important;
}
#provider-auth-modal {
  position: fixed;
  z-index: 999999 !important;
  inset: 0;
}

.provider-auth-content {
  position: relative;
  z-index: 1000000 !important;
}

.provider-toggle-container,
#provider-menu,
#provider-menu-panel {
  z-index: 5000 !important;
}

#provider-status-summary {
  padding-top: env(safe-area-inset-top, 0);
}

#provider-auth-modal {
  z-index: 5000 !important;
}

#provider-select-modal {
  z-index: 4000 !important;
}

#provider-onboarding {
  z-index: 2000 !important;
}

/* Make sure provider auth modal is ABOVE everything */
.provider-auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;             /* sits above provider list + header */
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
}

/* 🔥 Force-correct mobile menu panel for visibility */
#mobile-menu-panel {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}


#mobile-menu-panel.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Full-screen overlay */
.provider-auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
}

/* Main card */
.provider-auth-content {
  position: relative;
  min-width: min(520px, 92vw);
  padding: 32px 32px 26px;
  border-radius: 24px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

/* Floating close pill */
.auth-close-pill {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px 5px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.35), transparent 55%),
              rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  cursor: pointer;
}

.auth-close-pill .pill-icon {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* subtle interaction */
.auth-close-pill:hover {
  transform: translateX(-50%) translateY(-1px);
  border-color: rgba(96, 165, 250, 0.9);
}

.auth-close-pill:active {
  transform: translateX(-50%) translateY(0);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

/* Small spacing tweaks so the title isn't cramped under the pill */
.provider-auth-content h2 {
  margin-top: 8px;
  margin-bottom: 16px;
}

