/**
 * FlowVella 2025 Modernization
 * Focus: Improved spacing, typography, and layout flow
 * Preserves existing color palette and design language
 */

/* ===================================
   TYPOGRAPHY & SPACING IMPROVEMENTS
   =================================== */

/* Better line-height for readability */
body {
  line-height: 1.6;
  letter-spacing: -0.01em; /* Subtle tightening for modern look */
}

/* Improved heading hierarchy */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 0.75em;
}

/* Better paragraph spacing */
p {
  margin-bottom: 1.25em;
}

/* Remove uppercase from navigation - more modern */
.sidenav a {
  text-transform: none;
  letter-spacing: 0;
}

/* ===================================
   SIDEBAR IMPROVEMENTS
   =================================== */

/* Increase sidebar icon spacing */
.sidenav a {
  padding: 16px 0; /* Increased from 10px */
  transition: all 0.2s ease;
}

/* Smoother hover effect */
.sidenav a:hover {
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Better visual hierarchy in sidebar - SIMPLE FIX */
.sidenav {
  gap: 8px; /* Add spacing between flex items */
  background: var(--background) !important; /* Override any gradient backgrounds */
  overflow: visible !important; /* Don't cut off content */
  top: 10px !important; /* 10px from top of viewport */
  height: calc(100vh - 20px) !important; /* Leave 10px top + 10px bottom */
}

#left-flyout ul li {
  padding: 12px 10px; /* Increased from 7px for better touch targets */
  transition: all 0.2s ease;
}

#left-flyout ul li:hover {
  transition: all 0.2s ease;
}

/* FIX: Logo hover - make it more subtle and constrained */
#left-flyout ul li:first-child {
  padding: 8px 10px; /* Reduced padding for logo */
}

#left-flyout ul li:first-child:hover {
  background-color: transparent; /* Remove black background on logo */
  padding-left: 10px; /* Keep consistent padding */
  padding-right: 10px;
}

#left-flyout ul li:first-child a {
  padding: 8px 0; /* Tighter padding for logo link */
}

#left-flyout ul li:first-child img {
  max-width: 50px; /* Constrain logo size */
  height: auto;
  transition: all 0.2s ease;
  border-radius: 12px; /* Modern icon corner radius */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle depth */
}

#left-flyout ul li:first-child:hover img {
  transform: scale(1.05); /* Subtle scale instead of background */
  opacity: 0.85;
}

/* Better spacing for navigation items (not logo) */
#left-flyout ul li:not(:first-child) {
  margin-top: 4px; /* Add gap between items */
}

#left-flyout ul li:not(:first-child):hover {
  background-color: rgba(0, 0, 0, 0.6); /* Softer black than solid #000 */
  border-radius: 8px; /* Larger radius than 4px */
}

/* Ensure links are clickable (not cursor: default) */
#left-flyout ul li a {
  cursor: pointer !important; /* Override cursor: default */
}

/* Special handling for TAHC chat button */
.tahc-open-chat {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Ensure SVG inside chat button doesn't block clicks */
.tahc-open-chat svg {
  pointer-events: none !important;
}

/* Make sure the list item doesn't block clicks */
#left-flyout ul li.mobile_link {
  pointer-events: auto !important;
}

#left-flyout ul li.mobile_link a.tahc-open-chat {
  pointer-events: auto !important;
  z-index: 100 !important;
  position: relative !important;
}

/* Profile section breathing room - simplified */
.profile_image_side {
  bottom: 20px !important; /* 20px space from bottom edge for proper breathing room */
}

/* Ensure navigation items don't overlap profile section */
#left-flyout {
  padding-bottom: 180px !important; /* Space for profile section */
}

/* Fix any gradient backgrounds on sidebar corners */
.sidenav::before,
.sidenav::after {
  display: none !important; /* Remove any pseudo-element gradients */
}

/* Remove gradient from sidebar corners */
#left-flyout::before,
#left-flyout::after {
  display: none !important;
}

.profile_image_side p {
  font-size: 9px; /* Slightly larger from 8px */
  line-height: 1.4;
}

/* ===================================
   BUTTON IMPROVEMENTS
   =================================== */

/* Smoother button interactions */
body a.btn {
  padding: 16px 28px; /* Increased from 15px 25px */
  border-radius: 8px; /* Increased from 5px for modern feel */
  transition: all 0.15s ease;
  letter-spacing: 1px; /* Reduced from 2px */
}

body a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

body a.btn.blue:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 106, 184, 0.3);
}

/* ===================================
   LAYOUT & SPACING IMPROVEMENTS
   =================================== */

/* Increased section padding for breathing room */
#columned_features .column_container .column {
  padding: 80px 60px; /* Increased top/bottom from 60px */
}

#columned_features .column_container .column:hover {
  transition: all 0.25s ease;
  transform: translateY(-4px);
}

/* Better title spacing */
#columned_features p.sec_title {
  padding-top: 80px; /* Increased from 60px */
  padding-bottom: 80px;
  line-height: 1.25; /* Better than 60px fixed */
}

#columned_features .column_container .column p.title {
  margin-bottom: 16px; /* Increased from 10px */
  line-height: 1.3;
}

#columned_features .column_container .column p.desc {
  line-height: 1.65; /* Improved from 25px fixed */
  max-width: 90%; /* Prevent overly long lines */
  margin-left: auto;
  margin-right: auto;
}

/* Section spacing improvements */
#contain #top_section {
  padding: 80px 60px; /* Increased from 60px */
}

#contain #top_section h1 {
  margin-bottom: 24px; /* Increased from 20px */
  line-height: 1.2;
}

#contain #top_section h2,
#contain #top_section h1.slack {
  margin-bottom: 72px; /* Increased from 60px */
  line-height: 1.35; /* Better than 40px fixed */
}

#contain #top_section img {
  margin-top: 72px; /* Increased from 60px */
}

#contain .section {
  padding: 72px 50px; /* Increased from 50px */
}

#contain .section p.stitle {
  margin-bottom: 28px; /* Increased from 20px */
  margin-top: 80px; /* Increased from 60px */
  line-height: 1.25; /* Better than 50px fixed */
}

#contain .section p.sdesc {
  line-height: 1.65; /* Better than 25px fixed */
  max-width: 720px; /* Prevent overly long lines */
  margin-left: auto;
  margin-right: auto;
}

#contain .section .in_contain p.title {
  margin-bottom: 28px; /* Increased from 20px */
  margin-top: 80px; /* Increased from 60px */
  line-height: 1.25; /* Better than 50px fixed */
}

#contain .section .in_contain p.desc {
  line-height: 1.65; /* Better than 25px fixed */
}

#contain .section .in_contain img {
  margin-right: 80px; /* Increased from 60px */
}

/* ===================================
   SMOOTH TRANSITIONS
   =================================== */

/* Add transitions to all interactive elements */
a, button, input, select, textarea {
  transition: all 0.2s ease;
}

/* Remove jarring 1s transitions, use modern 0.25s */
body a.slackbtn,
body a.slackbtn:hover,
#columned_features .column_container .column,
#columned_features .column_container .column:hover,
#columned_features .column_container .column .pro_feature,
#columned_features .column_container .column:hover .pro_feature {
  transition: all 0.25s ease;
}

/* ===================================
   RESPONSIVE SPACING ADJUSTMENTS
   =================================== */

@media screen and (max-width: 900px) {
  #columned_features p.sec_title {
    padding-top: 48px; /* Increased from 30px */
    padding-bottom: 48px;
    line-height: 1.3;
  }

  #columned_features .column_container {
    padding-bottom: 72px; /* Increased from 60px */
  }

  #columned_features .column_container .column {
    padding-top: 48px; /* Increased from 30px */
    padding-bottom: 24px;
  }
}

@media screen and (max-width: 500px) {
  #contain #top_section h1 {
    font-size: 32px; /* Slightly smaller than 35px for mobile */
    line-height: 1.25;
  }

  #contain #top_section h2 {
    font-size: 24px; /* Slightly smaller than 30px */
    line-height: 1.35;
  }

  /* Adjust button padding for mobile */
  body a.btn {
    padding: 14px 24px;
    font-size: 14px;
  }
}

/* ===================================
   SUBTLE REFINEMENTS
   =================================== */

/* Remove text-transform uppercase where it appears */
body a.btn {
  text-transform: none; /* More modern than uppercase */
  font-weight: 500; /* Add weight instead */
}

/* Improve focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #426ab8;
  outline-offset: 2px;
}

/* Better hover states for feather icons */
.feather {
  transition: all 0.2s ease;
}

.feather:hover {
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Improve border radius consistency */
.sidenav {
  border-radius: 16px; /* Slightly smaller than 20px for refinement */
}

.profile_image_side,
.profile_image_side img {
  border-radius: 50%; /* Perfect circle instead of 30px/40px */
}

/* ===================================
   CAPSULE/PILL IMPROVEMENTS
   =================================== */

/* If there are capsule elements, ensure consistent border-radius */
.capsule,
.pill,
.badge,
.tag {
  border-radius: 24px; /* Modern pill shape */
  padding: 6px 16px;
  transition: all 0.2s ease;
}

.capsule:hover,
.pill:hover,
.badge:hover,
.tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===================================
   IMPROVED TOUCH TARGETS
   =================================== */

/* Ensure minimum 44px touch targets for mobile */
@media (pointer: coarse) {
  .sidenav a,
  button,
  input[type="button"],
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===================================
   MY FLOWS PAGE IMPROVEMENTS
   =================================== */

/* Fix "My Flows" title alignment and styling */
.flowboard_tile_view p.list_title,
.flowboard_tile_view h1.list_title {
  font-size: 32px !important; /* Larger, more prominent */
  font-weight: 600 !important; /* Bolder */
  margin-left: 0 !important; /* Remove left offset */
  margin-bottom: 24px !important;
  margin-top: 32px !important;
  line-height: 1.2 !important;
}

/* Fix "Create Your Flow" button section */
.new-button-holder {
  margin: 0 auto 48px auto !important; /* Better spacing */
  width: 100% !important;
  max-width: 800px;
  text-align: center;
}

.create-button-grow {
  width: auto !important;
  margin: 0 auto 16px auto !important;
  display: inline-block;
}

.create-button-grow a img {
  transition: all 0.2s ease;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.create-button-grow:hover a img {
  transform: scale(1.08) !important; /* Slightly more subtle */
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.create_your_flow {
  font-size: 20px !important; /* Slightly smaller */
  font-weight: 600 !important; /* Bolder for more contrast */
  color: #111 !important; /* Darker for better contrast */
  margin: 0 !important;
}

/* Dark mode support for Create Your Flow text */
@media (prefers-color-scheme: dark) {
  .create_your_flow {
    color: #f0f0f0 !important; /* Light text for dark mode */
  }

  .flowboard_tile_view p.list_title,
  .flowboard_tile_view h1.list_title {
    color: #f0f0f0 !important;
  }
}

.create-flow {
  width: 100% !important;
  text-align: center;
}

/* Fix Prev/Next navigation buttons */
.nextPrevFlowsTop,
.nextPrevFlowsBot {
  height: auto !important;
  font-size: 15px !important; /* Slightly larger */
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.nextPrevFlowsTop a,
.nextPrevFlowsBot a {
  color: #666 !important;
  text-decoration: none !important;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.nextPrevFlowsTop a:hover,
.nextPrevFlowsBot a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333 !important;
}

.nextPrevFlowsTop a img,
.nextPrevFlowsBot a img {
  width: 16px !important;
  height: 16px !important;
  vertical-align: middle !important;
}

/* Flow tiles improvements */
.flowboard_tile_view #flowboard_list_block ul li {
  border-radius: 12px !important; /* More modern than 3px */
  background: #f5f5f5 !important; /* Slightly lighter */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.25s ease !important;
  margin: 20px !important;
  overflow: visible !important; /* Don't cut off content */
}

.flowboard_tile_view #flowboard_list_block ul li:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Remove any pseudo-element gradients from tiles */
.flowboard_tile_view #flowboard_list_block ul li::before,
.flowboard_tile_view #flowboard_list_block ul li::after {
  display: none !important;
}

/* Circular profile pictures */
.flowboard_tile_view #flowboard_list_block ul li div.author a.avatar img,
.flowboard_tile_view #flowboard_list_block ul li div.author img {
  border-radius: 50% !important; /* Perfect circle */
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
}

/* Fix bottom gray section */
.flowboard_tile_view #flowboard_list_block ul li div.links,
.flowboard_tile_view #flowboard_list_block ul li div.social {
  background: #f0f0f0 !important; /* Lighter, more modern gray */
  border-bottom-left-radius: 12px !important; /* Match tile radius */
  border-bottom-right-radius: 12px !important;
  height: 50px !important; /* Taller for better touch targets */
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 8px !important; /* Space from title/author */
}

/* Dark mode support for bottom section */
@media (prefers-color-scheme: dark) {
  .flowboard_tile_view #flowboard_list_block ul li div.links,
  .flowboard_tile_view #flowboard_list_block ul li div.social {
    background: #2a2a2a !important;
  }

  .flowboard_tile_view #flowboard_list_block ul li {
    background: #1a1a1a !important;
  }

  .flowboard_tile_view #flowboard_list_block ul li div.links ul li a svg,
  .flowboard_tile_view #flowboard_list_block ul li div.social ul li a svg {
    stroke: #aaa !important;
    fill: none !important;
  }

  .flowboard_tile_view #flowboard_list_block ul li div.links ul li a:hover svg,
  .flowboard_tile_view #flowboard_list_block ul li div.social ul li a:hover svg {
    stroke: #0877bb !important;
    fill: none !important;
  }
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul,
.flowboard_tile_view #flowboard_list_block ul li div.social ul {
  display: flex !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  justify-content: space-evenly !important;
  align-items: center !important;
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul li,
.flowboard_tile_view #flowboard_list_block ul li div.social ul li {
  width: 20% !important; /* 5 buttons = 20% each */
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul li a,
.flowboard_tile_view #flowboard_list_block ul li div.social ul li a {
  font-size: 11px !important;
  color: #666 !important;
  transition: all 0.2s ease;
  padding: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul li a div,
.flowboard_tile_view #flowboard_list_block ul li div.social ul li a div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul li a:hover,
.flowboard_tile_view #flowboard_list_block ul li div.social ul li a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul li a svg,
.flowboard_tile_view #flowboard_list_block ul li div.social ul li a svg {
  width: 20px !important;
  height: 20px !important;
  transition: all 0.2s ease;
  stroke: #666 !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.flowboard_tile_view #flowboard_list_block ul li div.links ul li a:hover svg,
.flowboard_tile_view #flowboard_list_block ul li div.social ul li a:hover svg {
  transform: scale(1.1);
  stroke: #0877bb !important;
}

/* Improve preview images */
.flowboard_tile_view #flowboard_list_block ul li a img.preview {
  border-top-right-radius: 12px !important; /* Match tile radius */
  border-top-left-radius: 12px !important;
  min-height: 200px !important; /* Ensure consistent height */
  object-fit: cover !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; /* Fallback gradient */
}

/* If preview image fails to load, show nice gradient background */
.flowboard_tile_view #flowboard_list_block ul li div.image_section {
  min-height: 200px !important;
  background: #f0f0f0 !important; /* Use solid color instead of gradient */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
  overflow: hidden !important;
}

.flowboard_tile_view #flowboard_list_block ul li div.image_section a {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Dark mode for image section background */
@media (prefers-color-scheme: dark) {
  .flowboard_tile_view #flowboard_list_block ul li div.image_section {
    background: #2a2a2a !important;
  }
}

/* Make sure parent tile doesn't cut content */
.flowboard_tile_view #flowboard_list_block ul li {
  overflow: visible !important; /* Ensure nothing is cut off */
}

/* Author section - REDESIGN: position absolute in upper left corner */
.flowboard_tile_view #flowboard_list_block ul li div.author {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 10 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: 24px !important;
  padding: 8px 16px 8px 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  min-height: auto !important;
  max-width: calc(100% - 24px) !important;
  overflow: hidden !important;
}

/* Dark mode support for author badge */
@media (prefers-color-scheme: dark) {
  .flowboard_tile_view #flowboard_list_block ul li div.author {
    background: rgba(0, 0, 0, 0.6) !important;
  }
}

/* Profile pic - circular and properly sized */
.flowboard_tile_view #flowboard_list_block ul li div.author a.avatar {
  width: 40px !important;
  height: 40px !important;
  flex-shrink: 0 !important;
  display: block !important;
  margin: 0 !important;
}

/* Make sure avatar image is circular */
.flowboard_tile_view #flowboard_list_block ul li div.author a.avatar img {
  width: 40px !important;
  height: 40px !important;
  display: block !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

/* Title - flows next to avatar */
.flowboard_tile_view #flowboard_list_block ul li div.author > a:not(.avatar):not(.owner) {
  font-family: "Open Sans" !important;
  text-decoration: none !important;
  color: #ffffff !important;
  padding: 0 !important;
  margin: 0 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  display: block !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Hide username on My Flows page */
.flowboard_tile_view #flowboard_list_block ul li div.author a.owner {
  display: none !important;
}

/* Make image section position relative for absolute positioning of author */
.flowboard_tile_view #flowboard_list_block ul li div.image_section {
  position: relative !important;
}

/* Description styling */
.flowboard_tile_view #flowboard_list_block ul li p.description {
  padding: 0 12px 12px 12px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #666 !important;
}

/* Responsive improvements for myflows */
@media screen and (max-width: 1080px) {
  .flowboard_tile_view {
    width: 100% !important;
    max-width: 1080px;
    padding: 0 20px;
  }

  .flowboard_tile_view p.list_title,
  .flowboard_tile_view h1.list_title {
    margin-left: 0 !important;
  }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Better keyboard navigation visibility */
*:focus-visible {
  outline: 2px solid #426ab8;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Remove old focus styles */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ===================================
   MODERN SHADOW SYSTEM
   =================================== */

/* Replace old box-shadows with modern subtle shadows */
.card,
.panel,
.modal,
.dropdown {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
              0 1px 2px rgba(0, 0, 0, 0.06);
}

.card:hover,
.panel:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08),
              0 2px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

/* Remove heavy inset shadows from forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  box-shadow: none !important; /* Remove old inset shadows */
  border: 1px solid #d1d5db;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: #426ab8;
  box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.1);
}

/* ===================================
   FLOW CREATOR MODERNIZATION
   =================================== */

/* Lighten any pure black backgrounds in the creator */
[style*="background-color: black"],
[style*="background: black"],
[style*="background-color:#000"],
[style*="background:#000"] {
  background-color: #1a1a1a !important;
  background: #1a1a1a !important;
}

/* Lighten the top toolbar background */
#edit-mode-top-bar,
.edit-mode-toolbar,
header[style*="background"],
div[style*="background: black"],
div[style*="background-color: black"] {
  background: #1a1a1a !important; /* Lighter than pure black */
  padding: 12px 20px !important;
  min-height: 60px !important;
}

/* Better spacing for toolbar icons */
#edit-mode-top-bar > div,
#edit-mode-top-bar > button,
.edit-mode-toolbar > div,
.edit-mode-toolbar > button {
  margin: 0 8px !important; /* More breathing room */
}

/* Modernize title input field */
#flow-title-input,
input[name="flow_title"],
.flow-title-input {
  background: #2a2a2a !important;
  border: 1px solid #3a3a3a !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  font-size: 16px !important;
  color: #fff !important;
  min-width: 300px !important;
  transition: all 0.2s ease;
}

#flow-title-input:focus,
input[name="flow_title"]:focus,
.flow-title-input:focus {
  border-color: #426ab8 !important;
  box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.15) !important;
  outline: none !important;
}

/* ===================================
   FLOW CREATOR MODERNIZATION
   =================================== */

/* Force dark mode for creator only */
body.creator-dark-mode {
  background: #2d2d2d !important; /* Dark gray for creator dark mode */
}

body.creator-dark-mode .background_off_white {
  background: #2d2d2d !important;
  background-color: #2d2d2d !important;
}

body.creator-dark-mode .container,
body.creator-dark-mode #container {
  background: #2d2d2d !important;
}

/* Force dark mode on creator panels and inputs */
body.creator-dark-mode .panel {
  background: #1a1a1a !important;
  border-color: #3a3a3a !important;
}

body.creator-dark-mode .input,
body.creator-dark-mode input[type="text"],
body.creator-dark-mode input[type="number"] {
  background: #2a2a2a !important;
  color: #ffffff !important;
  border-color: #3a3a3a !important;
}

/* Force dark on container with inline styles */
body.creator-dark-mode .container,
body.creator-dark-mode #container {
  background: #2d2d2d !important;
}

/* Marketing pages always stay light - no dark mode */

/* Main creator container spacing */
#mainApp,
#main_stage {
  padding: 10px 16px 16px 16px !important;
  background: transparent !important; /* Let the body background show through */
}

/* Canvas/stage area - match background color */
[class*="Canvas"],
[class*="canvas"],
.stage,
.main-canvas,
#canvas,
.creator-canvas {
  background: #e8e8e8 !important; /* Match body background */
}

@media (prefers-color-scheme: dark) {
  [class*="Canvas"],
  [class*="canvas"],
  .stage,
  .main-canvas,
  #canvas,
  .creator-canvas {
    background: #2d2d2d !important; /* Match dark mode background */
  }
}

/* Remove white backgrounds from creator containers */
[class*="CreatorContainer"],
[class*="creatorContainer"],
[class*="MainContainer"],
[class*="mainContainer"] {
  background: transparent !important;
}

/* Toolbar improvements */
.toolbar-button,
#edit-mode-top-bar,
.edit-mode-toolbar,
[class*="toolbar"],
[class*="Toolbar"] {
  background: #f8f8f8 !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  margin: 8px !important;
}

/* Dark mode toolbar */
@media (prefers-color-scheme: dark) {
  .toolbar-button,
  #edit-mode-top-bar,
  .edit-mode-toolbar,
  [class*="toolbar"],
  [class*="Toolbar"] {
    background: #2a2a2a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }
}

/* Toolbar buttons */
.toolbar-button,
#edit-mode-top-bar button,
.edit-mode-toolbar button,
[class*="toolbar"] button,
[class*="Toolbar"] button {
  background: transparent !important;
  border: none !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  margin: 0 4px !important;
}

.toolbar-button:hover,
#edit-mode-top-bar button:hover,
.edit-mode-toolbar button:hover,
[class*="toolbar"] button:hover,
[class*="Toolbar"] button:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-1px) !important;
}

@media (prefers-color-scheme: dark) {
  .toolbar-button:hover,
  #edit-mode-top-bar button:hover,
  .edit-mode-toolbar button:hover,
  [class*="toolbar"] button:hover,
  [class*="Toolbar"] button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
  }
}

/* Improve slide thumbnail section at bottom - make it more compact */
.slide-thumbnails,
#slide-strip,
.bottom-slide-bar,
.thumbs-section,
.thumbs-container,
[class*="ScreenStrip"],
[class*="screenStrip"] {
  background: #f8f8f8 !important;
  padding: 8px 12px !important; /* Even more compact */
  border-top: 1px solid #e0e0e0 !important;
  margin-top: 16px !important; /* Space from main canvas */
  max-height: 140px !important; /* Shorter max height */
  overflow-y: auto !important; /* Allow scrolling if needed */
}

/* Dark mode for slide thumbnails */
@media (prefers-color-scheme: dark) {
  .slide-thumbnails,
  #slide-strip,
  .bottom-slide-bar,
  [class*="ScreenStrip"],
  [class*="screenStrip"] {
    background: #1a1a1a !important;
    border-top: 1px solid #333 !important;
  }
}

/* Modernize slide thumbnail cards - using actual class names */
.slide-thumbnail,
.slide-card,
.thumb,
.thumb-inner {
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.25s ease !important;
  border: 3px solid transparent !important;
  margin: 0 8px !important;
}

.slide-thumbnail:hover,
.slide-card:hover,
.thumb:hover,
.thumb-inner:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Make screen preview row with good sizing */
.screen_item {
  padding: 2px !important;
  margin: 0 10px 0 0 !important; /* 10px space on the right between previews */
  display: inline-block !important;
  vertical-align: top !important; /* Align all items to top */
}

/* Larger, wider screen preview thumbnails */
.screen_item img:not(.add) {
  height: 70px !important; /* Larger height */
  width: auto !important; /* Let width scale proportionally */
  max-width: none !important; /* Allow it to be wider */
  vertical-align: middle !important;
  border: none !important; /* Remove white border on unselected */
}

/* Keep add screen button at good size and centered */
.screen_item img.add,
.screen_item img.height_80 {
  height: 80px !important;
  vertical-align: top !important;
  position: relative !important;
  top: -5px !important;
}

.screen_item.new_screen {
  vertical-align: top !important;
}

.screen-selector-buttons {
  padding: 4px 8px !important;
  min-height: auto !important;
  margin-top: 4px !important;
}

/* Bigger Delete and Copy icons */
.screen-selector-buttons svg,
.screen-selector-buttons .feather {
  width: 28px !important; /* Bigger icons */
  height: 28px !important;
}

#screen_select {
  padding: 4px !important;
  height: 135px !important;
  box-sizing: border-box !important;
}

#screen_select .scroll_flex {
  height: 100% !important;
  align-items: center !important;
}

#screen_select .screen_item,
#screen_select .new_screen {
  height: auto !important;
  max-height: 120px !important;
}

#screen_select .current_screen {
  padding: 2px !important;
  height: auto !important;
  max-height: 120px !important;
}

/* Reduce space below thumbnails - tighten up the whole structure */
#screen_select .flex_thumbnails,
#screen_select #flex_thumbnails {
  height: auto !important;
  max-height: 120px !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Make delete/copy buttons tighter and larger icons, no text */
#screen_select .screen-selector-buttons {
  margin-top: 2px !important;
  padding: 0 !important;
  display: flex !important;
  gap: 8px !important;
  justify-content: center !important;
  align-items: center !important;
}

#screen_select .screen-selector-buttons .feather {
  width: 30px !important;
  height: 30px !important;
}

#screen_select .screen-selector-buttons span {
  display: none !important;
}

/* Remove any default styling from screen_item.selected that would affect layout */
.screen_item.selected {
  padding: 2px !important; /* Same as unselected - no movement */
  background: none !important;
  border: none !important;
  margin: 0 10px 0 0 !important; /* Keep same spacing as unselected */
}

/* Ensure .current_screen has no extra spacing by default */
.current_screen {
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: top !important;
}

/* Hide scrollbars on screen thumbnail list */
.scroll_flex {
  overflow-x: auto !important;
  overflow-y: visible !important; /* Allow gray background to extend vertically */
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE/Edge */
  padding: 12px 0 !important; /* Add vertical padding to prevent clipping */
}

.scroll_flex::-webkit-scrollbar {
  display: none !important; /* Chrome/Safari */
}

/* Ensure screen selector doesn't clip */
#screen_select {
  overflow: visible !important;
}

.screen_item {
  overflow: visible !important;
}

/* First screen needs extra left margin to prevent clipping */
.screen_item:first-child {
  margin-left: 12px !important;
}

/* Gray fill ONLY around the screen preview image - not the buttons */
.screen_item.selected .current_screen {
  background: #666 !important; /* Gray fill */
  border: none !important; /* No border */
  border-radius: 12px !important;
  padding: 6px !important;
  box-sizing: border-box !important;
  margin: -6px !important; /* Negative margin to offset padding - prevents movement */
  overflow: hidden !important; /* Ensure image respects border-radius */
}

/* Hide old beta ribbon */
.ribbon {
  display: none !important;
}

/* Screen number positioning - move inside gray area accounting for border radius and padding */
.screen_item .top-left,
.screen_item .span_left {
  top: 4px !important; /* Position near top edge, inside the rounded corner */
  left: 4px !important; /* Position near left edge, inside the rounded corner */
  z-index: 10 !important; /* Ensure it's above the image */
  color: white !important; /* White text on gray background */
  font-weight: 600 !important; /* Make it more visible */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important; /* Subtle shadow for readability */
}

/* Keep the image itself clean but add rounded corners */
.screen_item.selected .current_screen img,
.screen_item.selected .current_screen a {
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.screen_item.selected .current_screen img {
  border-radius: 8px !important; /* Rounded corners on the image itself to match outer radius */
}

/* Ensure buttons stay untouched */
.screen_item.selected .screen-selector-buttons {
  background: none !important;
  border: none !important;
}

/* Old selectors - minimal styling */
.slide-thumbnail.active,
.slide-card.active,
.slide-thumbnail.selected,
.slide-card.selected,
.thumb.active,
.thumb.selected {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  background: none !important;
}

@media (prefers-color-scheme: dark) {
  .slide-thumbnail.active,
  .slide-card.active,
  .slide-thumbnail.selected,
  .slide-card.selected,
  [class*="Screen"][class*="thumb"].active,
  [class*="screen"][class*="thumb"].active,
  [class*="Screen"][class*="thumb"].selected,
  [class*="screen"][class*="thumb"].selected,
  [class*="active"] [class*="Screen"][class*="thumb"],
  [class*="active"] [class*="screen"][class*="thumb"] {
    border-color: #999 !important; /* Lighter gray for dark mode */
    background: #333 !important;
  }
}

/* Override any red borders on screens - remove border and add solid gray background */
.thumb[style*="border"],
.thumb-inner[style*="border"],
.current_screen[style*="border"],
[style*="border: 2px solid red"],
[style*="border: 3px solid red"],
[style*="border-color: red"],
[style*="border:2px solid red"],
[style*="border:3px solid red"] {
  border: none !important;
  background: #666 !important;
  background-color: #666 !important;
}

/* Override white backgrounds - AGGRESSIVE */
[class*="Canvas"][style*="background"],
[class*="canvas"][style*="background"],
.stage[style*="background"],
[style*="background: white"],
[style*="background:white"],
[style*="background: #fff"],
[style*="background:#fff"],
[style*="backgroundColor"],
div[style*="background: white"],
div[style*="background:#fff"] {
  background: #e8e8e8 !important;
  background-color: #e8e8e8 !important;
}

@media (prefers-color-scheme: dark) {
  [class*="Canvas"][style*="background"],
  [class*="canvas"][style*="background"],
  .stage[style*="background"],
  [style*="background: white"],
  [style*="background:white"],
  [style*="background: #fff"],
  [style*="background:#fff"],
  [style*="backgroundColor"],
  div[style*="background: white"],
  div[style*="background:#fff"] {
    background: #2d2d2d !important;
    background-color: #2d2d2d !important;
  }
}
/* Control Panel Styling - match left side nav */
#control_panel {
  min-width: 1200px !important; /* Minimum width for desktop usage */
  background: var(--background) !important; /* Match sidenav */
  border: 2px solid var(--foreground) !important; /* Match sidenav */
  border-radius: 20px !important; /* SAME as sidenav */
  padding: 6px !important; /* Reduced padding */
  overflow: visible !important; /* Ensure panel is visible */
  box-sizing: border-box !important;
  margin: 2px 10px !important; /* top/bottom: 2px, left/right: 10px */
  margin-top: 2px !important;
  margin-left: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  min-height: 120px !important; /* Fixed height to prevent bouncing when panel shows/hides */
  height: 120px !important;
}

/* Dark mode for control panel */
@media (prefers-color-scheme: dark) {
  #control_panel {
    background: var(--background) !important;
    border: 2px solid var(--foreground) !important;
    color: white !important;
  }

  #control_panel * {
    color: white !important;
  }

  /* EXCEPTION: Title input must be BLACK text on WHITE background */
  #control_panel #preview_flow_buttons .input,
  #control_panel #preview_flow_buttons input {
    color: #000 !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
  }
}

.control {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important; /* Reduced spacing between all items */
  padding: 4px !important;
  min-height: 38px !important;
}

.panel {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 4px 8px !important; /* Minimal padding to fit in container */
  background: white !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border: none !important;
  border-radius: 8px !important; /* Reduced from 20px */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  min-height: 38px !important;
}

/* Dark mode for panel */
@media (prefers-color-scheme: dark) {
  .panel {
    background: black !important;
  }

  .panel * {
    color: white !important;
  }
}

/* Hide spacer images in panel */
.panel img[src*="spacer"] {
  display: none !important;
}

/* Hide panel when it only contains the spacer (no object selected) */
.panel:not(:has(button)):not(:has(input)):not(:has(select)):not(:has(.color-picker)):not(:has(.location-controls)) {
  display: none !important;
}

.panel .flex {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  width: fit-content !important;
}

#textControls,
.textControls,
#objectControls,
.objectControls,
#locationControls,
.locationControls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#textControls form,
.textControls form,
#objectControls form,
.objectControls form,
#locationControls form,
.locationControls form {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

/* Make sure all SVGs/icons are vertically centered */
.panel svg,
.panel .feather {
  vertical-align: middle !important;
  display: inline-block !important;
}

.panel select,
.panel input,
.panel button,
.panel label {
  vertical-align: middle !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* Style inputs and selects */
.panel input,
.panel select {
  border-radius: 6px !important; /* Less rounded to match proportionally */
  padding: 2px 8px !important; /* Reduced vertical padding for shorter height */
  border: 1px solid #ccc !important;
  height: 28px !important; /* 10px shorter than before */
  font-size: 13px !important;
}

.panel label {
  font-size: 13px !important;
  gap: 4px !important;
}

/* Color picker swatch - make it bigger */
.panel input[type="color"],
.panel .color_swatch,
.panel .buttonControlsColor {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
  border: 2px solid #ccc !important;
  cursor: pointer !important;
  padding: 2px !important;
}

.add_items {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important; /* Equal spacing between add buttons */
}

.div_styles {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 8px !important;
  gap: 4px !important; /* Space between icon and text */
}

.div_styles svg {
  margin: 0 !important;
}

.div_styles span {
  font-size: 11px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.flex_third_center {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  justify-content: center !important;
}

#preview_flow_buttons {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Delete and Copy buttons - space them out AGGRESSIVELY */
.slide-actions,
.thumbnail-actions,
.screen-selector-buttons {
  display: flex !important;
  justify-content: space-between !important; /* Push buttons to opposite sides */
  padding: 12px 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Individual action buttons */
.slide-actions button,
.thumbnail-actions button,
.screen-selector-buttons button {
  font-size: 11px !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  background: #f0f0f0 !important;
  border: 1px solid #d0d0d0 !important;
  transition: all 0.2s ease !important;
  flex: 0 0 auto !important; /* Don't grow, don't shrink */
  max-width: 100px !important;
  min-width: 80px !important;
  display: flex !important;
  align-items: center !important; /* Center icon and text vertically */
  justify-content: center !important; /* Center icon and text horizontally */
  gap: 6px !important; /* Space between icon and text */
}

/* Delete button stays on the left */
.slide-actions button:first-child,
.thumbnail-actions button:first-child,
.screen-selector-buttons button:first-child {
  margin-right: auto !important;
  margin-left: 0 !important;
}

/* Copy button stays on the right */
.slide-actions button:last-child,
.thumbnail-actions button:last-child,
.screen-selector-buttons button:last-child {
  margin-left: auto !important;
  margin-right: 0 !important;
}

.slide-actions button:hover,
.thumbnail-actions button:hover,
[class*="deleteScreen"]:hover,
[class*="copyScreen"]:hover,
[class*="delete-screen"]:hover,
[class*="copy-screen"]:hover {
  background: #e0e0e0 !important;
  transform: scale(1.05) !important;
}

/* Add Screen button spacing */
[class*="addScreen"],
[class*="add-screen"],
.add-slide-button {
  margin-top: 8px !important;
}

/* Remove or modernize the BETA ribbon */
.beta-ribbon,
[class*="beta"],
[id*="beta"] {
  display: none !important; /* Hide dated BETA ribbon */
}

/* If you want to keep it but modernize it */
.beta-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Modernize left sidebar in creator */
#creator-sidebar,
.creator-left-nav {
  background: #2a2a2a !important;
  padding: 16px 8px !important;
}

#creator-sidebar button,
.creator-left-nav button {
  width: 64px !important;
  height: 64px !important;
  border-radius: 10px !important;
  margin: 8px 0 !important;
  background: transparent !important;
  border: none !important;
  transition: all 0.2s ease;
}

#creator-sidebar button:hover,
.creator-left-nav button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.05);
}

#creator-sidebar button.active,
.creator-left-nav button.active {
  background: #426ab8 !important;
}

/* Improve top-right action buttons */
.top-right-actions,
#top-right-buttons {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
}

.top-right-actions button,
#top-right-buttons button {
  padding: 10px 16px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease;
}

/* Save/Draft button styling */
.save-button,
button[data-action="save"],
button[data-action="draft"] {
  background: #426ab8 !important;
  color: white !important;
  border: none !important;
}

.save-button:hover,
button[data-action="save"]:hover {
  background: #355492 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 106, 184, 0.3) !important;
}

/* ===================================
   CONTROL PANEL IMPROVEMENTS
   =================================== */

/* Grouped sections with subtle borders - snug fit */
#add_items,
#preview_flow_buttons,
#flex_third_center,
.panel .flex,
.location-controls-wrapper {
  border: 1px solid rgba(128, 128, 128, 0.5) !important;
  border-radius: 8px !important;
  padding: 4px 8px !important; /* Match panel padding */
  margin: 2px !important;
  min-height: 38px !important; /* Match panel min-height */
  box-sizing: border-box !important;
}

/* Minimal padding for compact height */
#control_panel #add_items,
#control_panel #flex_third_center,
.panel > .flex,
.location-controls-wrapper {
  padding: 2px !important;
}

/* Add items - super tight horizontal */
#control_panel #add_items {
  padding-left: 2px !important;
  padding-right: 2px !important;
}

/* Flex third center - super tight */
#control_panel #flex_third_center {
  padding-left: 2px !important;
  padding-right: 2px !important;
}

/* Dark mode: lighter border */
body.dark-mode #add_items,
body.dark-mode #preview_flow_buttons,
body.dark-mode #flex_third_center,
body.dark-mode .panel .flex,
body.dark-mode .location-controls-wrapper {
  border-color: rgba(200, 200, 200, 0.5) !important;
}

/* Add items section - GRID LAYOUT for perfect uniformity */
#add_items {
  display: flex !important;
  align-items: stretch !important;
  gap: 4px !important;
}

#add_items .div_styles,
#add_items .add_buttons,
#add_items .addYouTube > div,
#add_items .webView > div,
#add_items > div > div {
  width: 48px !important;
  height: 38px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Labels - make them NOT affect layout */
#add_items label {
  display: contents !important;
}

/* Hide file inputs */
#add_items input[type="file"] {
  display: none !important;
}

/* Icons */
#add_items .feather,
#add_items svg {
  width: 20px !important;
  height: 20px !important;
  margin-bottom: 2px !important;
  display: block !important;
}

/* Text */
#add_items span {
  font-size: 9px !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
  display: block !important;
}

/* Title input visibility in dark mode - BLACK text on WHITE background */
body.dark-mode #preview_flow_buttons .input,
body.dark-mode #preview_flow_buttons input.input {
  color: #000 !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
}

/* Also fix for general dark mode class */
.dark-mode #preview_flow_buttons .input,
.dark-mode #preview_flow_buttons input.input {
  color: #000 !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
}

/* Simple layout: keep everything in one row for now */
.control {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 4px !important;
  justify-content: space-between !important;
  min-height: 38px !important;
}

/* Add buttons section */
#add_items {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
  width: fit-content !important;
}

/* View/title/post section - compact */
#preview_flow_buttons {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex: 0 1 auto !important;
  justify-content: center !important;
  width: fit-content !important;
  max-width: 600px !important;
  height: 38px !important;
  padding: 2px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  border: none !important;
}

/* Make buttons in view/title/post section more compact */
#preview_flow_buttons button,
#preview_flow_buttons .div_styles {
  padding: 2px 6px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  height: 34px !important;
  max-height: 34px !important;
}

#preview_flow_buttons .div_styles span {
  font-size: 10px !important;
  line-height: 1 !important;
}

/* Title input should flex to fill available space */
#preview_flow_buttons .input {
  flex: 1 !important;
  min-width: 150px !important;
  max-width: 400px !important;
  height: 34px !important;
  max-height: 34px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  border-right: none !important; /* Remove right border to connect with button */
  border-top-right-radius: 0 !important; /* Remove right corner radius */
  border-bottom-right-radius: 0 !important;
}

/* Post button should connect seamlessly with input */
#preview_flow_buttons button.post {
  border-top-left-radius: 0 !important; /* Remove left corner radius to connect with input */
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 6px !important; /* Match input's left radius */
  border-bottom-right-radius: 6px !important;
  display: inline-flex !important; /* Use flexbox for proper centering */
  align-items: center !important; /* Vertical center */
  justify-content: center !important; /* Horizontal center */
  height: 34px !important; /* Match input height */
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* Undo/redo/help/settings section */
#flex_third_center {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
  width: fit-content !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 2px !important;
  background: var(--background) !important;
}

/* Hide spacers in flex_third_center to eliminate black lines */
#flex_third_center img.margin_left {
  display: none !important;
}

/* Handle long titles with ellipsis */
#preview_flow_buttons .input {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Compact buttons in undo/redo section */
#flex_third_center button {
  padding: 2px 4px !important;
  height: 34px !important;
  max-height: 34px !important;
  line-height: 1.1 !important;
}

/* Undo/Redo disabled state */
#flex_third_center button.empty:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
}

/* Hide panel when no object selected - only show if it has content beyond spacer */
.panel .flex:not(:has(#textControls)):not(:has(#objectControls)):not(:has(.ColorPicker)) {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Panel buttons uniform sizing */
.panel .flex > * {
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 10px !important;
}

/* Location controls - better alignment and styling */
.location-controls-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  width: fit-content !important;
  /* padding is set by grouped sections rule above */
}

.location-controls-wrapper #locationControls {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.location-controls-wrapper form {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Fix icon vertical alignment - center them properly */
.location-controls-wrapper .feather,
.location-controls-wrapper svg,
.location-controls-wrapper img {
  flex-shrink: 0 !important;
  vertical-align: middle !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important; /* Override inline styles */
  padding-bottom: 0 !important;
  align-self: center !important;
  display: inline-flex !important;
}

.location-controls-wrapper .Tooltip-root,
.location-controls-wrapper [class*="Tooltip"] {
  display: flex !important;
  align-items: center !important;
  margin-top: 0 !important;
  padding-top: 0 !important; /* Override inline styles */
  padding-bottom: 0 !important;
}

.location-controls-wrapper label {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.location-controls-wrapper input.location-input {
  border-radius: 4px !important;
  padding: 2px 6px !important; /* Reduced vertical padding for shorter height */
  font-size: 13px !important;
  width: 50px !important;
  height: 28px !important; /* 10px shorter than before */
  text-align: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  border: 1px solid #ccc !important; /* Ensure consistent border color */
  border-color: #ccc !important;
}

/* Override all border states */
.location-controls-wrapper input.location-input:hover,
.location-controls-wrapper input.location-input:active,
.location-controls-wrapper input#mmo_y {
  border-color: #ccc !important; /* Force gray border */
}

/* Focus state */
.location-controls-wrapper input.location-input:focus {
  border-color: #426ab8 !important; /* Standard focus color */
  outline: none !important;
}

/* Size SVG color fix for light mode */
body:not(.dark-mode) .location-controls-wrapper svg {
  color: #000 !important;
  fill: #000 !important;
}


/* ===================================
   SETTINGS MODAL 2025 DESIGN
   =================================== */

.settings-modal-2025 {
  background: var(--background);
  color: var(--text-color);
  border-radius: 12px;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.settings-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-color);
}

.settings-card {
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: 8px;
  padding: 16px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.setting-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0070bc;
}

.setting-label span {
  font-size: 14px;
}

.setting-label-inline {
  font-size: 14px;
  font-weight: 500;
  min-width: 140px;
}

.setting-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: var(--background);
  color: var(--text-color);
  font-size: 14px;
}

.setting-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.setting-input:focus {
  outline: none;
  border-color: #0070bc;
}

body.dark-mode .setting-input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.settings-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: var(--background);
  color: var(--text-color);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.settings-textarea:focus {
  outline: none;
  border-color: #0070bc;
}

body.dark-mode .settings-textarea {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.screen-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-indicator {
  font-size: 14px;
  color: var(--text-color);
  min-width: 120px;
  text-align: center;
}

.nav-button {
  background: transparent;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
  background: rgba(128, 128, 128, 0.1);
  border-color: rgba(128, 128, 128, 0.5);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.done-button {
  background: #0070bc;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.done-button:hover {
  background: #005a96;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 112, 188, 0.3);
}

.done-button:active {
  transform: translateY(0);
}

/* Settings selector styling */
.settings-modal-2025 select {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: var(--background);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
}

body.dark-mode .settings-modal-2025 select {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.settings-modal-2025 select:focus {
  outline: none;
  border-color: #0070bc;
}

.settings-modal-2025 select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Settings Tab Buttons */
.settings-tab-button {
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: var(--background);
  color: var(--text-color);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-tab-button:hover {
  border-color: rgba(128, 128, 128, 0.5);
  background: rgba(128, 128, 128, 0.05);
}

.settings-tab-button.active {
  border: 2px solid #0070bc;
  background: rgba(0, 112, 188, 0.1);
  font-weight: 500;
  color: #0070bc;
}

body.dark-mode .settings-tab-button {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .settings-tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .settings-tab-button.active {
  background: rgba(0, 112, 188, 0.2);
  border-color: #0070bc;
  color: #4da3ff;
}

/* Privacy Settings Form Styles */
.setting-label-block {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  fontSize: 14px;
  color: var(--text-color);
}

.setting-input-full {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: var(--background);
  color: var(--text-color);
  font-size: 14px;
  margin-bottom: 12px;
}

body.dark-mode .setting-input-full {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.setting-input-full:focus {
  outline: none;
  border-color: #0070bc;
  box-shadow: 0 0 0 2px rgba(0, 112, 188, 0.1);
}

.setting-select-full {
  width: 100%;
  margin-bottom: 12px;
}

.url-input-group {
  display: flex;
  align-items: center;
}

.url-prefix {
  background: rgba(128, 128, 128, 0.1);
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: rgba(128, 128, 128, 0.8);
  white-space: nowrap;
}

body.dark-mode .url-prefix {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
}

.url-input {
  border-radius: 0 8px 8px 0;
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: var(--background);
  color: var(--text-color);
  font-size: 14px;
}

body.dark-mode .url-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.url-input:focus {
  outline: none;
  border-color: #0070bc;
}

.subgroups-container {
  margin-top: 16px;
  padding: 16px;
  background: rgba(128, 128, 128, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.2);
}

body.dark-mode .subgroups-container {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-row {
  margin-bottom: 8px;
}

.checkbox-row:last-child {
  margin-bottom: 0;
}

.password-container {
  margin-top: 16px;
  padding: 16px;
  background: rgba(128, 128, 128, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.2);
}

body.dark-mode .password-container {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.2);
}

.change-password-link {
  display: block;
  margin: 12px 0;
  font-size: 13px;
  color: #0070bc;
  text-decoration: none;
}

.change-password-link:hover {
  text-decoration: underline;
}

body.dark-mode .change-password-link {
  color: #4da3ff;
}

.password-fields {
  margin-top: 12px;
}

.password-fields input {
  margin-bottom: 12px;
}

.password-fields input:last-child {
  margin-bottom: 0;
}


/* Flow Info Modal Styling */
.flow-info-popup {
  width: 280px !important;
}

.flow-info-modal {
  background: var(--background);
  color: var(--text-color);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  max-width: 280px;
  border: 1px solid rgba(128, 128, 128, 0.3);
}

body.dark-mode .flow-info-modal {
  background: #2a2a2a;
  border-color: rgba(200, 200, 200, 0.3);
}

.flow-info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.flow-info-close:hover {
  opacity: 1;
}

.flow-info-modal strong {
  color: var(--text-color);
  opacity: 0.9;
}

.flow-info-modal a {
  color: #0070bc;
  text-decoration: none;
}

.flow-info-modal a:hover {
  text-decoration: underline;
}

/* Updated Fri Oct 24 11:27:07 AM UTC 2025 */
