/* not user right now */

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
  }
}

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --chart-1: 12 76% 61%;
    --chart-2: 173 58% 39%;
    --chart-3: 197 37% 24%;
    --chart-4: 43 74% 66%;
    --chart-5: 27 87% 67%;
    --radius: 0.5rem;
    --header-height: 4rem;
    --content-padding: 2rem;
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
  .dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --ring: 0 0% 83.1%;
    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

@layer base {

}


.preview-block {
  position: relative;
  touch-action: none;
}

/* Hide controls by default */
.preview-block .block-controls {
  opacity: 0;
  pointer-events: none;
}

/* Show controls ONLY when block is selected */
.preview-block.selected .block-controls {
  opacity: 1;
  pointer-events: auto;
}

.preview-block.selected {
  outline: 2px solid #0559FA;
  outline-offset: -2px;
}

.preview-block[data-hidden="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.preview-block.hidden-block {
  opacity: 0.5 !important;
}

/* Add these styles to your existing globals.css */
.mode-switcher {
  /* Base styles */
  --transition-duration: 0.2s;
}

.mode-switcher [data-state="on"] {
  transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-switcher:hover {
  background-color: var(--muted);
}

/* Ghost script tag styling */
.script-editor .ghost-script-start::before,
.script-editor .ghost-script-end::before {
  content: '<script>';
  position: absolute;
  left: -40px;
  color: #666;
  font-family: monospace;
  pointer-events: none;
  opacity: 0.7;
}

.script-editor .ghost-script-end::before {
  content: '</script>';
}

.script-editor .ghost-script-margin {
  background-color: rgba(100, 100, 100, 0.2);
  width: 50px !important;
}

.ghost-tag {
  color: #666;
  font-family: monospace;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: none;
}

/* Update link styles in builder mode */
.builder-container .preview-block a {
  cursor: default !important; /* Show default cursor instead of pointer */
  pointer-events: auto !important; /* Allow events for our custom handler */
  position: relative; /* For the overlay */
}

/* Add a subtle visual indicator that links are disabled */
.builder-container .preview-block a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
}

/* Make links in selected blocks visually distinct */
.builder-container .preview-block.selected a {
  outline: 1px dashed rgba(14, 165, 233, 0.3);
  outline-offset: 2px;
}


/* Removed contenteditable styling - no visual styles for inline editable fields */
/*
.builder-container .preview-block.selected [contenteditable] { 
  outline: 1px dashed rgba(14, 165, 233, 0.5);
  outline-offset: 2px;
  @apply caret-blue-500;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

.builder-container .preview-block.selected [contenteditable]:focus {
  outline: 2px solid rgba(63, 85, 225, 0.9);
  outline-offset: 2px;
  caret-color: #0ea5e9;
}
*/

/* Ensure caret visibility in all contenteditable elements */
[contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
       user-select: text;
  cursor: text !important;
}

/* Add this to your global CSS */
[contenteditable="true"] {
  data-gramm: false;
  data-gramm_editor: false;
  data-enable-grammarly: false;
  spellcheck: false;
}

/* Force hide Grammarly elements */
grammarly-extension {
  display: none !important;
  pointer-events: none !important;
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

html, body {
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

/* Make sidebar 100% hidden when collapsed */
[data-collapsible="icon"] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\] {
  width: 0 !important;
}

[data-collapsible="icon"] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+_2px\)\] {
  width: 0 !important;
  left: -100% !important;
}

/* Completely hide site switcher when sidebar is collapsed */
[data-collapsible="icon"] [data-sidebar="header"] {
  display: none !important;
}



@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

