/* ===== MAIN - Base styles, variables, layout ===== */

/*
 * CSS Variables for consistent theming
 */
:root {
  /* Section Brand Colors - New Official Palette */
  --color-examples: #426fb5; /* Muted professional blue */
  --color-sandbox: #22b394; /* Softer teal-mint */
  --color-project: #d9a857; /* Warm gold - matches folder emoji */
  --color-journey: #099ec3; /* Blue Green */

  /* Border color variables - map to section colors */
  --border-examples: var(--color-examples);
  --border-sandbox: var(--color-sandbox);
  --border-project: var(--color-project);
  --border-journey: var(--color-journey);
  --border-settings: #adb5bd;

  /* Legacy alias for backward compatibility */
  --border-example: var(--color-examples);

  /* Title styling variables */
  --title-primary: #2c5aa0;
  --title-accent: #28a745;
  --title-gradient-start: #007bff;
  --title-gradient-end: #28a745;

  /* Font family variables */
  --font-primary:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
    'Helvetica Neue', sans-serif;
  --font-monospace: 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Consolas', monospace;
  --font-brand: 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Consolas', monospace;
  --font-roboto: 'Roboto', arial, sans-serif;

  /* Font weight variables */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

/*
 * Base layout styling.  A subtle background colour and modern
 * typography give the app a more contemporary feel.  The
 * content is centred with a maximum width to improve readability.
 */
html {
  -webkit-text-size-adjust: 100%; /* iOS Safari: prevent automatic text inflation */
  -moz-text-size-adjust: 100%; /* Firefox: prevent automatic text inflation */
  text-size-adjust: 100%; /* Standardized prop (harmless elsewhere) */
}

body {
  font-family: var(--font-primary);
  background: #f7f9fb;
  color: #333;
  padding: 20px;
  /* Increase the maximum width to accommodate side‑by‑side code and comment panes */
  max-width: 1300px; /* Adjusted to accommodate new 1300px event width */
  margin: auto;
  min-width: 800px; /* Prevent excessive compression on small screens */
}

/* Form controls adopt a consistent height, border radius and
   light border. */
input,
textarea {
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
}
input {
  width: 300px;
}
textarea {
  width: 100%;
  font-family: var(--font-monospace);
  resize: both;
  overflow: auto;
  background: #fff;
}

/* Unified button styling system */
button {
  font-size: 16px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #e2e6ea; /* Default grey for all buttons - same as "Add to Journey" button */
  color: #333;
}

button:hover {
  background-color: #d4dadd;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Button variants - consolidated base styles */
.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #e2e6ea;
  color: #333;
}

.btn-secondary:hover {
  background-color: #d4dadd;
}

/* Icon-only button styling for delete buttons */
.btn-icon {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ===== TITLE STYLING OPTIONS ===== */

/* Default h1 reset for custom styling */
h1 {
  margin: 0 0 20px 0;
  font-weight: 600;
}

/* OPTION 1: Modern Gradient Text */
.main-title.gradient-text {
  font-size: 2.5em;
  font-weight: 700;
  background: linear-gradient(135deg, var(--title-gradient-start), var(--title-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin: 0 0 30px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (-webkit-background-clip: text) {
  .main-title.gradient-text {
    color: var(--title-primary);
    background: none;
  }
}

/* OPTION 2: Card-Style Header */
.title-card {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 24px;
  margin: 0 0 30px 0;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.title-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.title-card .title-main {
  font-size: 2.2em;
  font-weight: 700;
  color: var(--title-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

.title-card .title-subtitle {
  font-size: 1.1em;
  color: #6c757d;
  margin: 0;
  font-weight: 400;
}

/* OPTION 3: Split Typography Design */
.split-title {
  font-size: 2.4em;
  font-weight: 700;
  text-align: center;
  margin: 0 0 30px 0;
  line-height: 1.2;
}

.split-title .title-primary {
  color: var(--title-primary);
  display: block;
  margin-bottom: 4px;
}

.split-title .title-accent {
  color: var(--title-accent);
  font-weight: 800;
  font-style: italic;
  display: block;
}

/* OPTION 4: Minimal with Accent Line */
.title-container {
  text-align: center;
  margin: 0 0 30px 0;
}

.clean-title {
  font-size: 2.3em;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
}

.title-accent-line {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--title-gradient-start), var(--title-gradient-end));
  margin: 0 auto;
  border-radius: 2px;
}

/* OPTION 5: Boxed Professional Style */
.title-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 14px 16px 10px 16px;
  margin: 0 0 20px 0;
  position: relative;
  overflow: hidden;
}

.title-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-examples) 0%,
    var(--color-sandbox) 33%,
    var(--color-project) 66%,
    var(--color-journey) 100%
  );
}

.title-wrapper {
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header-logo {
  height: 45px;
  width: 45px;
  border-radius: 50%;
  flex-shrink: 0;
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.brand-name {
  font-size: 2.1em;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-brand);
  color: var(--color-project); /* "dataLayer" uses Project color */
  margin: 0;
  letter-spacing: -0.005em;
}

.brand-accent {
  color: var(--color-sandbox); /* "Builder" uses Sandbox color */
  font-weight: var(--font-weight-semibold);
}

.beta-stamp {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  font-size: 0.55em;
  color: #495057;
  font-weight: var(--font-weight-bold);
  margin-left: 0.3em;
  letter-spacing: 0.02em;
  vertical-align: 0.25em;
  opacity: 1;
}

.beta-value {
  color: #0000ff;
}

.version-integration {
  font-size: 0.95em;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Version label inside title header */
.title-header .version-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 12px;
  color: #6c757d;
  z-index: 10;
  background: none;
  margin: 0;
  padding: 0;
}

/* Responsive adjustments for all title options */
@media (max-width: 768px) {
  .main-title.gradient-text,
  .title-card .title-main,
  .split-title,
  .clean-title,
  .brand-name {
    font-size: 1.8em;
  }

  .title-card {
    padding: 20px;
  }

  .title-header {
    padding: 10px 16px;
  }

  .title-header .version-label {
    top: 6px;
    right: 8px;
    font-size: 11px;
  }
}

/* ===== PROJECT SECTION STYLES ===== */

/* Project section border styling */
.project {
  border-left: 4px solid var(--color-project);
}

/* Project info content styling */
.project-info-content p {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.project-info-content strong {
  color: #495057;
}

/* Global form styling - used consistently throughout the application */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: inline-block;
  font-weight: normal;
  margin-bottom: 0;
  color: #495057;
  font-size: 14px;
  font-family: inherit;
  white-space: nowrap;
  width: 110px;
  text-align: left;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Specific input field widths for database section */
#projectName {
  width: 300px;
  max-width: 300px;
  min-width: 300px;
}

#projectKey {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}

#databaseProjectContent .d-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

#databaseProjectContent .d-flex.flex-wrap {
  flex-wrap: wrap;
}

#databaseProjectContent .align-center {
  align-items: center;
}

#databaseProjectContent .gap-10 {
  gap: 10px;
}

#databaseProjectContent .mb-10 {
  margin-bottom: 10px;
}

#databaseProjectContent .mb-15 {
  margin-bottom: 15px;
}

#databaseProjectContent .text-muted {
  color: #6c757d;
  font-size: 13px;
  margin-top: 5px;
}

#databaseProjectContent .font-sm {
  font-size: 13px;
}

#databaseProjectContent .status-indicator {
  margin-top: 10px;
  display: inline-block;
}

#databaseProjectContent .btn {
  margin-top: 15px;
}

#databaseProjectContent .d-flex.flex-wrap {
  margin-top: 10px;
  gap: 12px;
}

/* Project Metadata Info Box */
.info-box {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
}

.info-box-content {
  display: flex;
  flex-direction: row;
  gap: 16px; /* Increased from 8px for better spacing between items */
  align-items: center;
  flex-wrap: wrap;
  min-width: 0; /* Allow flex items to shrink below their content size */
  padding: 4px 0; /* Add vertical padding for breathing room */
  width: 100%; /* Ensure full width for proper wrapping */
}

.info-item {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0; /* Prevent items from shrinking too much */
  min-width: 0; /* Allow text truncation if needed */
}

/* Special styling for checkbox items to ensure proper spacing */
/* Special styling for checkbox items to ensure proper spacing */
.info-item label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  margin: 0; /* Ensure no extra margin */
}

/* Add extra spacing for checkbox items - target items that contain checkboxes */
.info-item > label > input[type='checkbox'] {
  margin-right: 2px; /* Small spacing after checkbox */
}

.info-item > label > .info-label {
  margin-right: 2px; /* Small spacing after label text */
}

.info-item-version {
  gap: 8px;
}

.info-item-right {
  margin-left: auto;
}

.info-label {
  font-weight: 600;
  color: #495057;
  font-size: 13px;
}

.info-value {
  color: #6c757d;
  font-size: 13px;
  font-family: var(--font-monospace);
}

.info-value-version {
  font-size: 16px;
  font-weight: 700;
  color: #007bff;
}

.info-separator {
  color: #dee2e6;
  font-weight: 300;
  padding: 0 8px; /* Increased from 4px for better visual separation */
  user-select: none;
  font-size: 14px;
  flex-shrink: 0; /* Prevent separators from shrinking */
}

/* Project Description Section */
/* Project Description section - now using standardized .section-sub-sub classes */

/* Random Variables section - now using standardized .section-sub-sub classes */

/* How It Works section - now using standardized .section-sub-sub classes */

#databaseProjectContent .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#databaseProjectContent .justify-end {
  justify-content: flex-end;
}

#databaseProjectContent .mb-20 {
  margin-bottom: 15px;
}

/* Connection status button styling */
#testDatabaseConnection {
  background-color: #6c757d;
  color: white;
  border: 1px solid #6c757d;
}

#testProjectConnection.connected {
  background-color: #e2e6ea;
  border-color: #e2e6ea;
  color: #212529;
  cursor: default;
}

#testProjectConnection.connected:hover {
  background-color: #e2e6ea;
  border-color: #e2e6ea;
  color: #212529;
}

#testProjectConnection.connecting {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

#testProjectConnection.error {
  background-color: #dc3545;
  border-color: #dc3545;
}

#testProjectConnection.connected::before {
  content: '✅ ';
}

#testProjectConnection.connecting::before {
  content: '';
}

#testProjectConnection.error::before {
  content: '❌ ';
}

#testProjectConnection:not(.connected):not(.connecting):not(.error):not(.connected-subtle):not(
    .connecting-subtle
  ):not(.error-subtle)::before {
  content: '🔗 ';
}

#testProjectConnection:disabled {
  opacity: 0.7;
  cursor: default !important;
}

#testProjectConnection:disabled:hover {
  background-color: inherit;
  border-color: inherit;
}

/* Subtle connection indicator styles */
.connected-subtle {
  background-color: #f8f9fa;
  border-color: #e9ecef;
  color: #6c757d;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
}

.connecting-subtle {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
}

.timeout-subtle {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
}

.error-subtle {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
}

.secondary-subtle {
  background-color: #e9ecef;
  border-color: #dee2e6;
  color: #6c757d;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
}

/* Project Events section styles */
.project-events-display {
  min-height: 200px;
  max-height: none;
  overflow-y: auto;
}

.no-events-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.no-events-message p {
  margin-bottom: 20px;
  font-size: 16px;
}

.event-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Project Events header styling */
.project-events-header {
  margin-bottom: 20px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

.project-events-header h6 {
  margin: 0;
  color: #007bff;
  font-weight: 600;
}

.project-events-header small {
  color: #6c757d;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-indicator.connected {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-indicator.disconnected {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-indicator.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Read-only input styling */
.form-control[readonly] {
  background-color: #f8f9fa;
  color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .database-project-management,
  .database-operations,
  .database-info {
    padding: 15px;
  }

  .database-operations .d-flex {
    flex-direction: column;
    gap: 8px;
  }

  .database-operations .d-flex button {
    width: 100%;
  }
}

/* Project Management Modals */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  max-height: 95vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal.show .modal-content {
  opacity: 1;
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.close {
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 15px 20px;
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #e9ecef;
}

.modal-footer .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

/* Project state management styles */
/* Make h4 headers with project action buttons use flexbox */
h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-action-buttons {
  margin-left: auto;
  display: flex;
  gap: 5px;
}

.project-action-buttons button {
  margin-left: 0;
  font-size: 12px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #ced4da;
  color: #495057;
  transition: all 0.2s ease;
}

/* Save Changes button states */
#saveChangesBtn:disabled {
  background-color: #6c757d;
  opacity: 0.6;
  cursor: not-allowed;
}

#saveChangesBtn.has-changes {
  background-color: #ffc107;
  color: #000;
}

#saveChangesBtn.has-changes:hover {
  background-color: #e0a800;
}

/* Read-only input styling */
input[readonly] {
  background-color: #f8f9fa;
  border-color: #e9ecef;
  color: #6c757d;
}

/* Project Key field specific styling */
#projectKey {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.5px;
  background-color: #fff; /* Changed from #f1f3f4 to white */
  border: 2px solid #e9ecef;
  color: #495057;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}

/* Copy Project Key button styling */
#copyKeyBtn {
  white-space: nowrap;
  flex-shrink: 0;
}

input[readonly]:focus {
  background-color: #f8f9fa;
  border-color: #e9ecef;
  box-shadow: none;
}

/* Dynamic Project UI Button Styling */
/* Project Name and Project Key buttons start grey and turn blue when input has content */
/* Add border to make buttons more clearly visible like add-link-btn */
#projectNameActionBtn,
#projectKeyActionBtn,
#removeProjectGtmBtn,
#reloadProjectBtn,
#saveDescriptionBtn,
#loadGtmAndSaveProjectBtn,
#clearProjectBtn,
#deleteProjectBtn {
  border: 1px solid #d1d5db; /* Add border like add-link-btn */
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Default grey buttons */
#projectNameActionBtn,
#projectKeyActionBtn,
#removeProjectGtmBtn,
#saveDescriptionBtn,
#loadGtmAndSaveProjectBtn {
  background-color: #e2e6ea; /* Default grey */
  color: #333;
}

#projectNameActionBtn:hover,
#projectKeyActionBtn:hover,
#removeProjectGtmBtn:hover,
#saveDescriptionBtn:hover,
#loadGtmAndSaveProjectBtn:hover {
  background-color: #d4dadd;
  border-color: #9ca3af;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Blue state when input has content (only for Project Name button) */
#projectNameActionBtn.has-content {
  background-color: #007bff;
  color: white;
  border-color: #0056b3; /* Darker blue border when active */
}

#projectNameActionBtn.has-content:hover {
  background-color: #0056b3;
  border-color: #004085;
}

/* Header action buttons styling */
/* reloadProjectBtn and clearProjectBtn - white background in grey headers */
#reloadProjectBtn,
#clearProjectBtn {
  background-color: #fff; /* White background for grey headers */
  color: #495057;
  border-color: #ced4da; /* Match other white buttons */
}

#reloadProjectBtn:hover,
#clearProjectBtn:hover {
  background-color: #e9ecef; /* Light grey hover */
  border-color: #adb5bd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* deleteProjectBtn - red with darker red hover, uses same border styling */
#deleteProjectBtn {
  background-color: #dc3545;
  color: white;
  border-color: #c82333; /* Darker red border */
}

#deleteProjectBtn:hover {
  background-color: #c82333;
  border-color: #bd2130; /* Even darker red border on hover */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Highlight required field animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.highlight-required {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2) !important;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 107, 107, 0.4);
  }
}

/* ===== STICKY ENVIRONMENT WARNING BAR ===== */

.environment-warning-bar {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: #fff9e6;
  color: rgba(0, 0, 0, 0.8);
  text-align: center;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  max-width: 1300px;
  width: 100%;
  box-sizing: border-box;
}

/* ===== STICKY HEADER - Navigation and Status Indicators ===== */

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  margin: 0 auto 20px auto; /* Center and match body width */
  max-width: 1300px; /* Match body max-width */
  width: 100%;
  box-sizing: border-box;
  border-radius: 4px; /* Match section rounded corners on all sides */
}

/* When environment warning bar is shown, adjust sticky header position */
.environment-warning-bar:not([style*='display: none']) ~ .sticky-header {
  top: 37px;
}

.sticky-header-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.sticky-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Status Indicators Group - compact, small indicators */
.status-indicators-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Action Buttons Group - larger, prominent buttons */
.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  gap: 0;
  align-items: center;
}

.tab-separator {
  color: #dee2e6;
  font-weight: 300;
  padding: 0 8px;
  user-select: none;
  font-size: 14px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px 4px 0 0;
  background-color: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  position: relative;
}

.tab-btn:hover {
  background-color: #f8f9fa;
  color: #333;
}

.tab-btn.active {
  background-color: #f8f9fa;
}

/* Active tab colors match section brand colors */
.tab-btn[data-tab='project'].active {
  color: var(--color-project);
  border-bottom-color: var(--color-project);
}

.tab-btn[data-tab='sandbox'].active {
  color: var(--color-sandbox);
  border-bottom-color: var(--color-sandbox);
}

.tab-btn[data-tab='journey'].active {
  color: var(--color-journey);
  border-bottom-color: var(--color-journey);
}

.tab-btn[data-tab='examples'].active {
  color: var(--color-examples);
  border-bottom-color: var(--color-examples);
}

.tab-btn.settings-tab {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-btn:focus {
  outline: none;
}

/* Status Indicators - Rectangular badges matching design system */
/* More specific selector to override utilities.css */
.sticky-header .status-indicator {
  display: inline-block;
  margin-right: 0;
  padding: 3px 8px;
  border-radius: 4px !important;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
  min-width: 40px;
  width: auto !important;
  height: auto !important;
  cursor: default;
  white-space: nowrap;
  border: none;
  background-color: #e2e6ea;
  color: #6c757d;
  line-height: 1.3;
  box-sizing: border-box;
}

.sticky-header .status-indicator.gtm-status {
  cursor: pointer;
}

.sticky-header .status-indicator.gtm-status:hover {
  background-color: #d4dadd;
}

/* GTM Status States - Light green when loaded, light red when not */
.sticky-header .status-indicator.gtm-status.gtm-loaded {
  background-color: #d4edda !important;
  color: #155724 !important;
}

.sticky-header .status-indicator.gtm-status.gtm-none {
  background-color: #f8d7da !important;
  color: #721c24 !important;
}

.sticky-header .status-indicator.db-status.connected {
  background-color: #d4edda !important;
  color: #155724 !important;
}

.sticky-header .status-indicator.db-status.connecting {
  background-color: #fff3cd !important;
  color: #856404 !important;
}

.sticky-header .status-indicator.db-status.error {
  background-color: #f8d7da !important;
  color: #721c24 !important;
}

.sticky-header .status-indicator.db-status.disconnected {
  background-color: #f8d7da !important;
  color: #721c24 !important;
}

.sticky-header .status-indicator.test-status {
  background-color: #007bff !important;
  color: white !important;
  cursor: default !important;
}

/* Remove label/value structure - use direct text */
.status-label,
.status-value,
.status-dropdown {
  display: none;
}

/* Status Actions - Rectangular badges matching design system */
/* More specific selector to override utilities.css */
.sticky-header .status-action {
  display: inline-block;
  margin-right: 0;
  padding: 3px 8px;
  border-radius: 4px !important;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
  min-width: 40px;
  width: auto !important;
  height: auto !important;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background-color: #e2e6ea;
  color: #6c757d;
  transition: background-color 0.2s ease;
  line-height: 1.3;
  box-sizing: border-box;
}

.sticky-header .status-action:hover {
  background-color: #d4dadd;
}

.sticky-header .status-action.settings-icon {
  padding: 2px 6px;
  font-size: 16px;
  min-width: 32px;
  background-color: transparent !important;
  filter: grayscale(50%) brightness(0.6);
  transition: filter 0.2s ease;
}

.sticky-header .status-action.settings-icon:hover {
  background-color: transparent !important;
  filter: grayscale(0%) brightness(1);
  transform: none;
}

.sticky-header .status-action.user-refresh {
  font-size: 12px;
  padding: 3px 6px;
}

/* Authentication Button Styles - Google Sign-In Material Button */
.sticky-header .status-action.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: white !important;
  background-image: none;
  border: 1px solid #747775 !important;
  -webkit-border-radius: 4px;
  border-radius: 4px !important;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #1f1f1f !important;
  cursor: pointer;
  font-family: var(--font-roboto);
  font-size: 14px;
  height: 40px !important;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 20px !important;
  position: relative;
  text-align: center;
  -webkit-transition:
    background-color 0.218s,
    border-color 0.218s,
    box-shadow 0.218s;
  transition:
    background-color 0.218s,
    border-color 0.218s,
    box-shadow 0.218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
}

.sticky-header .status-action.gsi-material-button .gsi-material-button-icon {
  height: 24px;
  margin-right: 12px;
  min-width: 24px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-header .status-action.gsi-material-button .gsi-material-button-icon svg {
  width: 24px;
  height: 24px;
}

.sticky-header .status-action.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.sticky-header .status-action.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: var(--font-roboto);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.sticky-header .status-action.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity 0.218s;
  transition: opacity 0.218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.sticky-header .status-action.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61 !important;
  border-color: #1f1f1f1f !important;
}

.sticky-header .status-action.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 0.38;
}

.sticky-header .status-action.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 0.38;
}

.sticky-header .status-action.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.sticky-header .status-action.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #303030;
  opacity: 0.12;
}

.sticky-header .status-action.gsi-material-button:not(:disabled):hover {
  -webkit-box-shadow:
    0 1px 2px 0 rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
  box-shadow:
    0 1px 2px 0 rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.sticky-header .status-action.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #303030;
  opacity: 0.08;
}

/* Authenticated state - show user profile */
.sticky-header .status-action.gsi-material-button.authenticated {
  background-color: white !important;
  border-color: #747775 !important;
  height: 40px !important;
}

.sticky-header .status-action.gsi-material-button.authenticated .gsi-material-button-icon {
  border-radius: 50%;
  overflow: hidden;
}

.sticky-header .status-action.gsi-material-button.authenticated img {
  width: 24px;
  height: 24px;
  display: block;
}

/* Hide all sections by default - sticky header will show active tab */
.section.settings-section,
.section.journey-section,
.section.sandbox-section,
.section.events-section.example,
.section.events-section.project {
  display: none;
}

/* Hide sandbox info box by default - shown only when sandbox tab is active */
[data-testid='alert_sandbox_info'] {
  display: none;
}

/* Show section when it's the active tab (handled by JavaScript) */
.section.active-tab {
  display: block;
}

/* Journey section - spacing between header and content */
#journeyContent {
  margin-top: 20px;
}

/* Alert boxes */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 15px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.5;
}

.alert-info {
  background-color: #fff9e6;
  border-color: #ffeaa7;
  color: #856404;
  font-weight: 600;
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.alert strong {
  font-weight: 600;
}
