/* ================================
   Custom CSS for Sistema Editorial
   Works alongside Tailwind CDN
   ================================ */

/* ========================================
   THEME COLOR VARIABLES
   Heidi-style warm light theme + Dark theme
   ======================================== */

:root {
    /* Light Theme (Heidi-inspired warm cream) - DEFAULT */
    --color-bg-body: #faf8f5;
    --color-bg-primary: #f5f3f0;
    --color-bg-secondary: #ebe8e4;
    --color-bg-card: #ffffff;
    --color-bg-card-gradient-start: rgba(255, 255, 255, 0.95);
    --color-bg-card-gradient-end: rgba(255, 255, 255, 0.85);
    --color-bg-input: #ffffff;
    --color-bg-hover: rgba(139, 92, 246, 0.05);
    --color-bg-overlay: rgba(0, 0, 0, 0.4);

    --color-text-primary: #1e293b;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-text-inverse: #f3f4f6;

    --color-border: #e7e5e4;
    --color-border-subtle: #f0eeeb;
    --color-border-input: #d6d3d1;

    /* Scrollbar - Light */
    --color-scrollbar-track: #f5f3f0;
    --color-scrollbar-thumb: #d6d3d1;
    --color-scrollbar-thumb-hover: #a8a29e;

    /* Glass Effect - Light (subtle shadow instead of blur) */
    --color-glass-bg: rgba(255, 255, 255, 0.9);
    --color-glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* Selection */
    --color-selection-bg: rgba(139, 92, 246, 0.2);
    --color-selection-text: #1e293b;

    /* Toast backgrounds */
    --color-toast-bg: rgba(255, 255, 255, 0.95);
    --color-toast-border: rgba(0, 0, 0, 0.1);

    /* Nav/Sidebar */
    --color-nav-text: #64748b;
    --color-nav-text-hover: #1e293b;
    --color-nav-bg-hover: rgba(0, 0, 0, 0.04);
    --color-nav-active-text: #7c3aed;
    --color-nav-active-bg: rgba(139, 92, 246, 0.08);

    /* Sidebar - Cake Equity Style */
    --color-sidebar-bg: #ffffff;
    --color-sidebar-border: #e5e7eb;
    --color-nav-item-radius: 0.5rem;
    --color-nav-section-text: #9ca3af;
    --color-whats-new-bg: #faf5ff;
    --color-whats-new-border: #e9d5ff;

    /* Accent - SAME for both themes */
    --color-accent: #8b5cf6;
    --color-accent-hover: #7c3aed;
    --color-accent-light: rgba(139, 92, 246, 0.1);
    --color-accent-glow: rgba(139, 92, 246, 0.3);
}

.dark {
    /* Dark Theme (current colors) */
    --color-bg-body: #020617;
    --color-bg-primary: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-card: rgba(17, 24, 39, 0.8);
    --color-bg-card-gradient-start: rgba(17, 24, 39, 0.8);
    --color-bg-card-gradient-end: rgba(17, 24, 39, 0.6);
    --color-bg-input: rgba(31, 41, 55, 0.5);
    --color-bg-hover: rgba(255, 255, 255, 0.05);
    --color-bg-overlay: rgba(0, 0, 0, 0.6);

    --color-text-primary: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;
    --color-text-inverse: #1e293b;

    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-subtle: rgba(255, 255, 255, 0.05);
    --color-border-input: rgba(255, 255, 255, 0.1);

    /* Scrollbar - Dark */
    --color-scrollbar-track: #0f172a;
    --color-scrollbar-thumb: #374151;
    --color-scrollbar-thumb-hover: #4b5563;

    /* Glass Effect - Dark */
    --color-glass-bg: linear-gradient(to bottom right, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    --color-glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Selection */
    --color-selection-bg: rgba(139, 92, 246, 0.3);
    --color-selection-text: white;

    /* Toast backgrounds */
    --color-toast-bg: rgba(17, 24, 39, 0.9);
    --color-toast-border: rgba(255, 255, 255, 0.1);

    /* Nav/Sidebar */
    --color-nav-text: #94a3b8;
    --color-nav-text-hover: #f1f5f9;
    --color-nav-bg-hover: rgba(255, 255, 255, 0.03);
    --color-nav-active-text: #a78bfa;
    --color-nav-active-bg: rgba(139, 92, 246, 0.15);

    /* Sidebar - Cake Equity Style (Dark) */
    --color-sidebar-bg: #111827;
    --color-sidebar-border: rgba(255, 255, 255, 0.1);
    --color-nav-item-radius: 0.5rem;
    --color-nav-section-text: #6b7280;
    --color-whats-new-bg: rgba(139, 92, 246, 0.1);
    --color-whats-new-border: rgba(139, 92, 246, 0.2);
}

/* ========================================
   THEME TRANSITIONS
   Smooth color transitions when toggling
   ======================================== */

body,
.liquid-glass-card,
.nav-item,
.form-input,
.btn-secondary,
.toast-success,
.toast-error,
.toast-warning,
.toast-info,
.chat-sidebar-panel,
.mobile-drawer,
.bottom-nav {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 0.5rem;
}

::-webkit-scrollbar-track {
  background: var(--color-scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-thumb-hover);
}

/* Selection */
::selection {
  background: var(--color-selection-bg);
  color: var(--color-selection-text);
}

/* ========================================
   LIQUID GLASS DESIGN SYSTEM
   ======================================== */

/* Base Glass Effect */
.liquid-glass {
  background: var(--color-glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-glass-border);
  border-radius: 1rem;
  box-shadow: var(--glass-shadow);
}

/* Glass Card Variants */
.liquid-glass-card {
  background: linear-gradient(to bottom right, var(--color-bg-card-gradient-start), var(--color-bg-card-gradient-end));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
}

/* Light mode: solid cards with subtle shadow */
:root:not(.dark) .liquid-glass-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.liquid-glass-first {
  background: linear-gradient(to bottom right, rgba(16, 185, 129, 0.1), rgba(17, 24, 39, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(16, 185, 129, 0.4);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.liquid-glass-first:hover {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.liquid-glass-last {
  background: linear-gradient(to bottom right, rgba(249, 115, 22, 0.1), rgba(17, 24, 39, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(249, 115, 22, 0.4);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.liquid-glass-last:hover {
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.liquid-glass-default {
  background: linear-gradient(to bottom right, var(--color-bg-card-gradient-start), var(--color-bg-card-gradient-end));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.liquid-glass-default:hover {
  border-color: var(--color-accent-light);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

:root:not(.dark) .liquid-glass-default {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.liquid-glass-dragging {
  background: linear-gradient(to bottom right, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(1.02);
  z-index: 50;
  border-radius: 1rem;
}

/* Glass Buttons */
.liquid-glass-btn {
  background: var(--color-bg-hover);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.liquid-glass-btn:hover {
  background: var(--color-nav-bg-hover);
  border-color: var(--color-accent-light);
}

:root:not(.dark) .liquid-glass-btn {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Position Badges */
.badge-position-first {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(to bottom right, rgb(16, 185, 129), rgb(5, 150, 105));
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.badge-position-last {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(to bottom right, rgb(249, 115, 22), rgb(239, 68, 68));
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.badge-position-default {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
  color: rgb(167, 139, 250);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-position-dragging {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(to bottom right, rgb(59, 130, 246), rgb(147, 51, 234));
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Drop Indicator Line */
.drop-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 0.25rem;
  border-radius: 9999px;
  background: linear-gradient(to right, rgb(59, 130, 246), rgb(147, 51, 234), rgb(236, 72, 153));
  transition: all 0.2s ease;
  opacity: 0;
  transform: scaleX(0);
}

.drop-indicator.active {
  opacity: 1;
  transform: scaleX(1);
}

.drop-indicator-top {
  top: -0.25rem;
}

.drop-indicator-bottom {
  bottom: -0.25rem;
}

/* Calendar Cell */
.calendar-cell {
  min-height: 100px;
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--color-bg-card);
}

.calendar-cell:hover {
  border-color: var(--color-accent-light);
}

.calendar-cell-today {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.05);
}

.calendar-cell-other-month {
  opacity: 0.4;
}

.calendar-cell-past {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-cell-drop-target {
  border: 2px dashed rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.1);
  transform: scale(0.98);
}

/* Scheduled Item in Calendar */
.calendar-item {
  padding: 0.25rem;
  border-radius: 0.25rem;
  background: rgba(147, 51, 234, 0.2);
  border: 1px solid rgba(147, 51, 234, 0.3);
  cursor: grab;
  transition: all 0.2s ease;
}

.calendar-item:hover {
  background: rgba(147, 51, 234, 0.3);
}

.calendar-item:active {
  cursor: grabbing;
}

/* Drag Handle */
.drag-handle {
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
  cursor: grab;
  transition: all 0.2s ease;
}

.drag-handle:hover {
  background: var(--color-nav-bg-hover);
  color: var(--color-text-primary);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle.dragging {
  background: var(--color-accent-light);
  color: var(--color-text-primary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Sortable States */
.sortable-ghost {
  opacity: 0.5;
}

.sortable-chosen {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.sortable-drag {
  opacity: 1 !important;
}

/* Fila Item Hover Actions */
.fila-item-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fila-item:hover .fila-item-actions {
  opacity: 1;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-success,
.toast-error,
.toast-warning,
.toast-info {
  background: var(--color-toast-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-toast-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 28rem;
  animation: slideIn 0.3s ease;
  color: var(--color-text-primary);
}

:root:not(.dark) .toast-success,
:root:not(.dark) .toast-error,
:root:not(.dark) .toast-warning,
:root:not(.dark) .toast-info {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
  border-left: 4px solid rgb(34, 197, 94);
}

.toast-error {
  border-left: 4px solid rgb(239, 68, 68);
}

.toast-warning {
  border-left: 4px solid rgb(234, 179, 8);
}

.toast-info {
  border-left: 4px solid rgb(59, 130, 246);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Form Components */
.form-input {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-input);
  border-radius: 0.5rem;
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
}

/* Theme-aware Form Fields (for content edit pages) */
.edit-input {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.edit-input::placeholder {
  color: var(--color-text-muted);
}

.edit-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

.edit-input-error {
  border-color: rgb(239, 68, 68);
}

.edit-input-error:focus {
  border-color: rgb(239, 68, 68);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.edit-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
}

.edit-label-error {
  color: rgb(239, 68, 68);
}

/* Edit page card styling */
.edit-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.edit-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.edit-card-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* ========================================
   LIGHT MODE OVERRIDES FOR DARK-HARDCODED CLASSES
   Fix dark mode classes that appear in templates
   ======================================== */

/* Override dark backgrounds in light mode */
:root:not(.dark) .bg-dark-800\/50,
:root:not(.dark) .bg-dark-800,
:root:not(.dark) .bg-dark-700\/50,
:root:not(.dark) .bg-dark-700,
:root:not(.dark) .bg-dark-900,
:root:not(.dark) .bg-dark-900\/80 {
  background-color: var(--color-bg-card) !important;
}

/* Override dark borders in light mode */
:root:not(.dark) .border-white\/10,
:root:not(.dark) .border-white\/20 {
  border-color: var(--color-border) !important;
}

/* Override light text colors in light mode - only for content areas, not buttons */
:root:not(.dark) .liquid-glass-card > .text-white:not(button):not(a),
:root:not(.dark) .liquid-glass-card h1.text-white,
:root:not(.dark) .liquid-glass-card h2.text-white,
:root:not(.dark) .liquid-glass-card h3.text-white,
:root:not(.dark) .liquid-glass-card p.text-white,
:root:not(.dark) .liquid-glass-card span.text-white:not([class*="bg-"]) {
  color: var(--color-text-primary) !important;
}

/* Ensure buttons with colored backgrounds keep white text */
:root:not(.dark) button.text-white,
:root:not(.dark) a.text-white,
:root:not(.dark) .bg-primary-600,
:root:not(.dark) .bg-primary-700,
:root:not(.dark) .bg-primary-500,
:root:not(.dark) [class*="bg-primary-"],
:root:not(.dark) [class*="bg-green-"],
:root:not(.dark) [class*="bg-red-"],
:root:not(.dark) [class*="bg-blue-"],
:root:not(.dark) [class*="bg-dark-700"],
:root:not(.dark) [class*="bg-dark-600"] {
  color: white !important;
}

:root:not(.dark) .text-gray-100,
:root:not(.dark) .text-gray-200 {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .text-gray-300 {
  color: var(--color-text-secondary) !important;
}

:root:not(.dark) .text-gray-400 {
  color: var(--color-text-muted) !important;
}

:root:not(.dark) .text-gray-500 {
  color: var(--color-text-muted) !important;
}

/* Override placeholder colors in light mode */
:root:not(.dark) .placeholder-gray-500::placeholder {
  color: var(--color-text-muted) !important;
}

/* Liquid glass cards in light mode - solid backgrounds */
:root:not(.dark) .liquid-glass-card {
  background: var(--color-bg-card) !important;
  border-color: var(--color-border) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Override backdrop blur backgrounds in light mode */
:root:not(.dark) .backdrop-blur-sm,
:root:not(.dark) .backdrop-blur-xl {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: var(--color-bg-card) !important;
}

/* Focus states - ensure they work in light mode */
:root:not(.dark) .focus\:border-primary-500:focus {
  border-color: var(--color-accent) !important;
}

:root:not(.dark) .focus\:ring-primary-500\/20:focus {
  box-shadow: 0 0 0 2px var(--color-accent-light) !important;
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: rgb(139, 92, 246);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: rgb(124, 58, 237);
}

.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-nav-bg-hover);
  border-color: var(--color-accent-light);
}

/* Badge Components */
.badge-success {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(34, 197, 94, 0.2);
  color: rgb(74, 222, 128);
}

/* Channel Status */
.channel-status-pendente {
  background: rgba(107, 114, 128, 0.2);
  color: rgb(156, 163, 175);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.channel-status-processando {
  background: rgba(59, 130, 246, 0.2);
  color: rgb(96, 165, 250);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.channel-status-sucesso {
  background: rgba(16, 185, 129, 0.2);
  color: rgb(52, 211, 153);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.channel-status-erro {
  background: rgba(239, 68, 68, 0.2);
  color: rgb(248, 113, 113);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Hide cloak elements until Alpine loads */
[x-cloak] {
  display: none !important;
}

/* ========================================
   SIDEBAR NAVIGATION - Cake Equity Style
   ======================================== */

/* Nav Item Styles */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: var(--color-nav-text);
  border-radius: var(--color-nav-item-radius);
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--color-nav-bg-hover);
  color: var(--color-nav-text-hover);
}

/* Active state - full-width rounded background (Cake Equity style) */
.nav-item-active {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-text);
  font-weight: 500;
}

.nav-item-active:hover {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-text);
}

/* Nav Icon - simplified, no wrapper background */
.nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Nav Label */
.nav-label {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

/* What's New Card */
.whats-new-card {
  margin: 0.75rem;
  padding: 0.75rem;
  background: var(--color-whats-new-bg);
  border: 1px solid var(--color-whats-new-border);
  border-radius: 0.75rem;
}

.whats-new-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.whats-new-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  transition: color 0.15s ease;
}

.whats-new-item:hover {
  color: var(--color-accent);
}

/* Sidebar Version Footer */
.sidebar-version {
  padding: 0.5rem 1rem 1rem;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ========================================
   TOGGLE SWITCH COMPONENT
   ======================================== */

/* Base Toggle Switch */
.toggle-switch {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  transition: all 0.3s ease;
  background: rgba(107, 114, 128, 0.3);
}

.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.toggle-switch.active .toggle-switch-thumb {
  transform: translateX(1.5rem);
}

/* Toggle Switch Variants - WordPress (Blue) */
.toggle-switch-wordpress .toggle-switch-track {
  background: rgba(59, 130, 246, 0.3);
}

.toggle-switch-wordpress.active .toggle-switch-track {
  background: #3b82f6;
}

/* Toggle Switch Variants - Instagram (Gradient) */
.toggle-switch-instagram .toggle-switch-track {
  background: rgba(236, 72, 153, 0.3);
}

.toggle-switch-instagram.active .toggle-switch-track {
  background: linear-gradient(45deg, #f59e0b, #ec4899, #8b5cf6);
}

/* Toggle Switch Variants - Facebook (Dark Blue) */
.toggle-switch-facebook .toggle-switch-track {
  background: rgba(37, 99, 235, 0.3);
}

.toggle-switch-facebook.active .toggle-switch-track {
  background: #2563eb;
}

/* Toggle Switch Variants - WhatsApp (Green) */
.toggle-switch-whatsapp .toggle-switch-track {
  background: rgba(34, 197, 94, 0.3);
}

.toggle-switch-whatsapp.active .toggle-switch-track {
  background: #22c55e;
}

/* Toggle Switch Variants - Generic (Purple) */
.toggle-switch-generic .toggle-switch-track {
  background: rgba(139, 92, 246, 0.3);
}

.toggle-switch-generic.active .toggle-switch-track {
  background: #8b5cf6;
}

/* ========================================
   INTEGRATION CARDS
   ======================================== */

.integration-card {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border-width: 1px;
  transition: all 0.2s ease;
}

.integration-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Integration Card Variants */
.integration-card-wordpress {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.05);
}

.integration-card-wordpress:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.1);
}

.integration-card-instagram {
  border-color: rgba(236, 72, 153, 0.3);
  background: rgba(236, 72, 153, 0.05);
}

.integration-card-instagram:hover {
  border-color: rgba(236, 72, 153, 0.5);
  background: rgba(236, 72, 153, 0.1);
}

.integration-card-facebook {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.05);
}

.integration-card-facebook:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.1);
}

.integration-card-whatsapp {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.05);
}

.integration-card-whatsapp:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.1);
}

/* ========================================
   LOGO UPLOAD COMPONENT
   ======================================== */

.logo-upload-container {
  position: relative;
  width: 6rem;
  height: 6rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--color-bg-input);
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.logo-upload-container:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.logo-upload-container.has-image {
  border-style: solid;
  border-color: var(--color-border);
}

.logo-upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-upload-remove {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: rgb(239, 68, 68);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 600;
}

.logo-upload-remove:hover {
  background: rgb(220, 38, 38);
  transform: scale(1.1);
}

/* Auto-save Indicator */
.auto-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: var(--color-bg-hover);
}

.auto-save-indicator.saving {
  color: rgb(251, 191, 36);
}

.auto-save-indicator.saved {
  color: rgb(74, 222, 128);
}

.auto-save-indicator.error {
  color: rgb(248, 113, 113);
}

/* Pulse Animation for Saving */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.auto-save-indicator.saving svg {
  animation: pulse 1s infinite;
}

/* ========================================
   CHAT SIDEBAR
   ======================================== */

/* Floating Action Button */
.chat-sidebar-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.5),
              0 4px 6px -2px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  z-index: 100;
  border: none;
}

.chat-sidebar-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 30px -5px rgba(139, 92, 246, 0.6),
              0 6px 10px -2px rgba(0, 0, 0, 0.3);
}

.chat-sidebar-fab:active {
  transform: scale(0.98);
}

.chat-sidebar-fab.open {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

/* Chat Sidebar Panel */
.chat-sidebar-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--color-bg-primary);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--color-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 101;
  display: flex;
  flex-direction: column;
}

:root:not(.dark) .chat-sidebar-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

/* Chat Header */
.chat-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.chat-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-sidebar-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.chat-sidebar-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.9375rem;
}

.chat-sidebar-status {
  font-size: 0.75rem;
  color: rgb(34, 197, 94);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-sidebar-status::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgb(34, 197, 94);
}

/* Chat Header Actions */
.chat-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-sidebar-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.chat-sidebar-btn:hover {
  background: var(--color-nav-bg-hover);
  color: var(--color-text-primary);
}

/* Messages Area */
.chat-sidebar-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Message Bubble */
.chat-message {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.user .chat-message-content {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant .chat-message-content {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-bottom-left-radius: 0.25rem;
  border: 1px solid var(--color-border-subtle);
}

.chat-message-time {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding: 0 0.25rem;
}

.chat-message.user .chat-message-time {
  text-align: right;
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-secondary);
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  width: fit-content;
  border: 1px solid var(--color-border-subtle);
}

.chat-typing-indicator span {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-text-muted);
  border-radius: 9999px;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.chat-typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.chat-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-0.5rem);
  }
}

/* Input Area */
.chat-sidebar-input {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-input);
  border-radius: 1rem;
  padding: 0.5rem;
  transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  padding: 0.5rem;
  resize: none;
  max-height: 6rem;
  line-height: 1.5;
}

.chat-input-field::placeholder {
  color: var(--color-text-muted);
}

.chat-input-field:focus {
  outline: none;
}

.chat-send-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty State */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
}

.chat-empty-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.chat-empty-title {
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.chat-empty-text {
  font-size: 0.875rem;
  max-width: 18rem;
}

/* Agent Selector */
.chat-agent-selector {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-secondary);
}

.chat-agent-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-input);
  border-radius: 0.5rem;
  color: var(--color-text-primary);
  font-size: 0.8125rem;
  cursor: pointer;
}

.chat-agent-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Overlay - closes chat when clicking outside */
.chat-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  z-index: 100;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 640px) {
  .chat-sidebar-panel {
    width: 100%;
  }

  .chat-sidebar-fab {
    bottom: 1rem;
    right: 1rem;
  }
}

/* ========================================
   MASKED INPUT
   ======================================== */

.masked-value {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  letter-spacing: 0.05em;
}

/* ========================================
   MOBILE RESPONSIVE SYSTEM
   ======================================== */

/* Mobile Breakpoint Variables */
@media (max-width: 1023px) {
  :root {
    --mobile-active: 1;
  }

  /* Reduce Glass Blur for Performance */
  .liquid-glass,
  .liquid-glass-card,
  .liquid-glass-default,
  aside[class*="sidebar"],
  header {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  /* Hardware Acceleration for Animations */
  aside, .modal, .dropdown-menu, .chat-sidebar-panel {
    will-change: transform;
    transform: translateZ(0);
  }

  /* Touch Target Minimums (44x44px) */
  .nav-item,
  button,
  a.btn,
  .chat-sidebar-fab {
    min-height: 44px;
    min-width: 44px;
  }

  /* Responsive Typography */
  body {
    font-size: 16px; /* Prevent iOS zoom on input focus */
  }

  .form-input,
  .chat-input-field,
  input[type="text"],
  input[type="email"],
  textarea {
    font-size: 16px !important; /* Prevent iOS zoom */
    min-height: 56px; /* Touch-friendly */
  }

  /* Toast Positioning for Mobile */
  .toast-container {
    top: var(--safe-area-inset-top, 1rem);
    right: 0.5rem;
    left: 0.5rem;
  }

  .toast-success,
  .toast-error,
  .toast-warning,
  .toast-info {
    min-width: auto;
    max-width: 100%;
  }
}

/* ========================================
   MOBILE DRAWER OVERLAY
   ======================================== */

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 39;
  cursor: pointer;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-sidebar-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 40;
  display: flex;
  flex-direction: column;
  /* Alpine.js x-transition handles transforms, no CSS transition needed */
}

.dark .mobile-drawer {
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

/* Prevent scroll when drawer is open */
body.drawer-open {
  overflow: hidden;
}

/* ========================================
   BOTTOM NAVIGATION BAR
   ======================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-area-inset-bottom));
  padding-bottom: var(--safe-area-inset-bottom);
  background: var(--color-bg-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  z-index: 30;
  display: none; /* Hidden by default */
}

:root:not(.dark) .bottom-nav {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1023px) {
  .bottom-nav {
    display: flex;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--color-nav-text);
  padding: 0.5rem;
  min-height: 56px;
  transition: all 0.2s ease;
  position: relative;
}

.bottom-nav-item:active {
  background: var(--color-bg-hover);
  transform: scale(0.95);
}

.bottom-nav-item.active {
  color: var(--color-accent);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
}

.bottom-nav-label {
  font-size: 0.6875rem;
  font-weight: 500;
}

/* Badge on bottom nav icon */
.bottom-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 6px;
  height: 6px;
  background: rgb(239, 68, 68);
  border-radius: 50%;
}

/* ========================================
   MOBILE SEARCH OVERLAY
   ======================================== */

.mobile-search-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: var(--safe-area-inset-top, 1rem) 1rem 1rem;
}

:root:not(.dark) .mobile-search-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.mobile-search-input {
  flex: 1;
  padding: 0.875rem 1rem 0.875rem 3rem;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-input);
  border-radius: 0.75rem;
  color: var(--color-text-primary);
  font-size: 16px;
  position: relative;
}

.mobile-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

.mobile-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-text-muted);
}

.mobile-search-close {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-search-close:active {
  background: var(--color-nav-bg-hover);
  transform: scale(0.95);
}

.mobile-search-results {
  flex: 1;
  overflow-y: auto;
}

/* ========================================
   RESPONSIVE LAYOUT ADJUSTMENTS
   ======================================== */

@media (max-width: 1023px) {
  /* Main content without sidebar margin */
  .mobile-main-content {
    margin-left: 0 !important;
    padding-bottom: calc(56px + var(--safe-area-inset-bottom) + 1rem);
  }

  /* Header adjustments */
  header {
    padding-left: max(1rem, var(--safe-area-inset-left));
    padding-right: max(1rem, var(--safe-area-inset-right));
    padding-top: var(--safe-area-inset-top, 0);
  }

  /* Chat FAB positioning with safe area */
  .chat-sidebar-fab {
    bottom: calc(56px + var(--safe-area-inset-bottom) + 1rem);
    right: max(1rem, var(--safe-area-inset-right));
  }

  /* Chat Sidebar full width on mobile */
  .chat-sidebar-panel {
    width: 100%;
    max-width: 100vw;
  }
}

/* Hamburger Menu Button */
.hamburger-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: var(--color-bg-hover);
  transition: all 0.2s ease;
}

.hamburger-btn:active {
  background: var(--color-nav-bg-hover);
  transform: scale(0.95);
}

.hamburger-line {
  width: 1.25rem;
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hide desktop sidebar on mobile */
@media (max-width: 1023px) {
  aside[class*="sidebar"]:not(.mobile-drawer) {
    display: none;
  }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   PROSEMIRROR/NOVEL EDITOR - LIGHT MODE FIXES
   Fix text visibility in light mode
   ======================================== */

:root:not(.dark) .ProseMirror {
  color: var(--color-text-primary);
}

:root:not(.dark) .ProseMirror h1 {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .ProseMirror h2 {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .ProseMirror h3 {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .ProseMirror p {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .ProseMirror ul,
:root:not(.dark) .ProseMirror ol {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .ProseMirror li {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .ProseMirror blockquote {
  color: var(--color-text-secondary) !important;
  border-left-color: var(--color-accent) !important;
}

:root:not(.dark) .ProseMirror a {
  color: var(--color-accent) !important;
}

:root:not(.dark) .ProseMirror a:hover {
  color: var(--color-accent-hover) !important;
}

:root:not(.dark) .ProseMirror pre {
  background-color: var(--color-bg-secondary) !important;
}

:root:not(.dark) .ProseMirror pre code,
:root:not(.dark) .ProseMirror code {
  color: #be185d !important; /* Pink for code - visible on light */
  background-color: var(--color-bg-secondary) !important;
}

:root:not(.dark) .ProseMirror hr {
  border-color: var(--color-border) !important;
}

:root:not(.dark) .ProseMirror mark {
  background-color: rgba(234, 179, 8, 0.3) !important;
  color: var(--color-text-primary) !important;
}

/* Placeholder text in light mode */
:root:not(.dark) .ProseMirror p.is-editor-empty:first-child:before {
  color: var(--color-text-muted) !important;
}

/* Selection in light mode */
:root:not(.dark) .ProseMirror ::selection {
  background-color: rgba(139, 92, 246, 0.2) !important;
}

/* Editor toolbar and menus in light mode */
:root:not(.dark) .bubble-menu {
  background-color: var(--color-bg-card) !important;
  border-color: var(--color-border) !important;
}

:root:not(.dark) .bubble-menu button {
  color: var(--color-text-secondary) !important;
}

:root:not(.dark) .bubble-menu button:hover {
  background-color: var(--color-bg-hover) !important;
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .bubble-menu button.is-active {
  background-color: var(--color-accent) !important;
  color: white !important;
}

:root:not(.dark) .slash-command-menu {
  background-color: var(--color-bg-card) !important;
  border-color: var(--color-border) !important;
}

:root:not(.dark) .slash-command-item:hover {
  background-color: var(--color-bg-hover) !important;
}

:root:not(.dark) .slash-command-item.is-selected {
  background-color: rgba(139, 92, 246, 0.15) !important;
}

:root:not(.dark) .slash-command-item-icon {
  background-color: var(--color-bg-secondary) !important;
}

:root:not(.dark) .slash-command-item-title {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .slash-command-item-description {
  color: var(--color-text-muted) !important;
}

:root:not(.dark) .editor-toolbar {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

:root:not(.dark) .editor-toolbar button {
  color: #9ca3af !important;
}

:root:not(.dark) .editor-toolbar button:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

:root:not(.dark) .editor-toolbar button.is-active {
  background-color: rgba(139, 92, 246, 0.3) !important;
  color: #a78bfa !important;
}

:root:not(.dark) .editor-toolbar .separator {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

:root:not(.dark) .node-selector-trigger {
  color: var(--color-text-secondary) !important;
}

:root:not(.dark) .node-selector-trigger:hover {
  background-color: var(--color-bg-hover) !important;
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .node-selector-menu {
  background-color: var(--color-bg-card) !important;
  border-color: var(--color-border) !important;
}

:root:not(.dark) .node-selector-item:hover {
  background-color: var(--color-bg-hover) !important;
}

:root:not(.dark) .node-selector-item.is-active {
  background-color: rgba(139, 92, 246, 0.15) !important;
}

:root:not(.dark) .link-input {
  background-color: var(--color-bg-card) !important;
  border-color: var(--color-border) !important;
}

:root:not(.dark) .link-input input {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .link-input input::placeholder {
  color: var(--color-text-muted) !important;
}

/* Editor note boxes in light mode */
:root:not(.dark) .editor-note {
  background-color: rgba(251, 191, 36, 0.1) !important;
  border-color: rgb(245, 158, 11) !important;
}

:root:not(.dark) .editor-note p {
  color: #92400e !important;
}

:root:not(.dark) .info-box {
  background-color: rgba(59, 130, 246, 0.1) !important;
  border-color: rgb(59, 130, 246) !important;
}

:root:not(.dark) .info-box p {
  color: #1e40af !important;
}

:root:not(.dark) .warning-box {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: rgb(239, 68, 68) !important;
}

:root:not(.dark) .warning-box p {
  color: #991b1b !important;
}

/* HTML code view in light mode */
:root:not(.dark) .html-code-view {
  background-color: var(--color-bg-secondary) !important;
}

:root:not(.dark) .html-code-textarea {
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .html-code-textarea::placeholder {
  color: var(--color-text-muted) !important;
}

/* Character count in light mode */
:root:not(.dark) .character-count {
  color: var(--color-text-muted) !important;
}

/* ========================================
   BOTTOM ACTION BAR - LIGHT MODE FIXES
   ======================================== */

/* Bottom action bar container */
:root:not(.dark) .fixed.bottom-6[class*="bg-dark-800"] {
  background-color: var(--color-bg-card) !important;
  border-color: var(--color-border) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1), 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Divider line in action bar */
:root:not(.dark) .fixed.bottom-6 .bg-white\/20 {
  background-color: var(--color-border) !important;
}

/* Save button in bottom bar - keep dark style for contrast */
:root:not(.dark) .fixed.bottom-6 button[class*="bg-dark-700"] {
  background-color: #374151 !important;
  color: white !important;
}

:root:not(.dark) .fixed.bottom-6 button[class*="bg-dark-700"]:hover {
  background-color: #4b5563 !important;
}

/* Keyboard shortcuts in buttons */
:root:not(.dark) .fixed.bottom-6 kbd {
  background-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--color-text-muted) !important;
}

:root:not(.dark) .fixed.bottom-6 button[class*="bg-primary"] kbd,
:root:not(.dark) .fixed.bottom-6 button[class*="bg-green"] kbd,
:root:not(.dark) .fixed.bottom-6 button[class*="bg-dark-700"] kbd {
  background-color: rgba(0, 0, 0, 0.2) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

/* ========================================
   LIVE EDITOR INPUTS - LIGHT MODE FIXES
   ======================================== */

/* Input fields with dark background */
:root:not(.dark) .live-editor-input,
:root:not(.dark) input[class*="bg-dark-800"],
:root:not(.dark) textarea[class*="bg-dark-800"],
:root:not(.dark) .live-editor-wrapper input,
:root:not(.dark) .live-editor-wrapper textarea {
  background-color: var(--color-bg-input) !important;
  border-color: var(--color-border-input) !important;
  color: var(--color-text-primary) !important;
}

:root:not(.dark) .live-editor-input::placeholder,
:root:not(.dark) input[class*="bg-dark-800"]::placeholder,
:root:not(.dark) textarea[class*="bg-dark-800"]::placeholder,
:root:not(.dark) .live-editor-wrapper input::placeholder,
:root:not(.dark) .live-editor-wrapper textarea::placeholder {
  color: var(--color-text-muted) !important;
}

/* Mobile tabs bar - dark style for contrast */
:root:not(.dark) .live-editor-mobile-tabs {
  background-color: #1e293b !important;
}

:root:not(.dark) .live-editor-mobile-tabs button:not(.bg-primary-500) {
  color: #9ca3af !important;
}

:root:not(.dark) .live-editor-mobile-tabs button:not(.bg-primary-500):hover {
  color: #ffffff !important;
}

/* Novel editor container */
:root:not(.dark) #novel-editor-container {
  background-color: var(--color-bg-input) !important;
  border-color: var(--color-border-input) !important;
}

/* Format toggle and theme selection panels */
:root:not(.dark) .live-editor-wrapper [class*="bg-dark-800\/50"],
:root:not(.dark) .live-editor-wrapper [class*="bg-dark-800\/30"] {
  background-color: var(--color-bg-secondary) !important;
}

/* Image upload zone */
:root:not(.dark) .live-editor-wrapper [class*="border-dashed"] {
  border-color: var(--color-border) !important;
  background-color: var(--color-bg-secondary) !important;
}

:root:not(.dark) .live-editor-wrapper [class*="border-dashed"]:hover {
  border-color: var(--color-accent) !important;
  background-color: var(--color-accent-light) !important;
}

/* Labels */
:root:not(.dark) .live-editor-wrapper label.text-gray-300 {
  color: var(--color-text-secondary) !important;
}

/* Button tabs in format toggle */
:root:not(.dark) .live-editor-wrapper button.text-gray-400 {
  color: var(--color-text-muted) !important;
}

:root:not(.dark) .live-editor-wrapper button.text-gray-400:hover {
  color: var(--color-text-primary) !important;
}

/* ========================================
   EDIT PAGE - LIGHT MODE FIXES
   General fixes for content editing pages
   ======================================== */

/* All inputs and textareas with dark backgrounds on edit pages */
:root:not(.dark) input.text-gray-100,
:root:not(.dark) textarea.text-gray-100,
:root:not(.dark) input[class*="bg-dark-800"],
:root:not(.dark) textarea[class*="bg-dark-800"],
:root:not(.dark) select[class*="bg-dark-800"] {
  background-color: var(--color-bg-input) !important;
  border-color: var(--color-border-input) !important;
  color: var(--color-text-primary) !important;
}

:root:not(.dark) input.text-gray-100::placeholder,
:root:not(.dark) textarea.text-gray-100::placeholder,
:root:not(.dark) input[class*="bg-dark-800"]::placeholder,
:root:not(.dark) textarea[class*="bg-dark-800"]::placeholder {
  color: var(--color-text-muted) !important;
}

/* Labels in edit forms */
:root:not(.dark) label.text-gray-300,
:root:not(.dark) .form-label.text-gray-300,
:root:not(.dark) .edit-label {
  color: var(--color-text-secondary) !important;
}

/* Error state labels */
:root:not(.dark) label.text-red-400 {
  color: rgb(248, 113, 113) !important;
}

/* Modals with dark backgrounds */
:root:not(.dark) .bg-black\/70,
:root:not(.dark) .bg-black\/50 {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

:root:not(.dark) div[class*="bg-dark-700"]:not(button),
:root:not(.dark) div[class*="bg-dark-800"]:not(button) {
  background-color: var(--color-bg-secondary) !important;
}

/* Modal content */
:root:not(.dark) .modal-content,
:root:not(.dark) div.liquid-glass-card p.text-gray-400 {
  color: var(--color-text-muted) !important;
}

/* Textarea inside modals */
:root:not(.dark) .liquid-glass-card textarea {
  background-color: var(--color-bg-input) !important;
  border-color: var(--color-border-input) !important;
  color: var(--color-text-primary) !important;
}

/* Secondary/Cancel buttons in modals */
:root:not(.dark) button.text-gray-300[class*="bg-dark-700"],
:root:not(.dark) button[class*="bg-dark-700"].text-gray-300 {
  background-color: var(--color-bg-secondary) !important;
  color: var(--color-text-primary) !important;
  border: 1px solid var(--color-border) !important;
}

:root:not(.dark) button.text-gray-300[class*="bg-dark-700"]:hover,
:root:not(.dark) button[class*="bg-dark-700"].text-gray-300:hover {
  background-color: var(--color-bg-hover) !important;
}

/* Preview area text */
:root:not(.dark) .text-gray-200,
:root:not(.dark) p.text-gray-200,
:root:not(.dark) span.text-gray-200 {
  color: var(--color-text-primary) !important;
}

/* Muted helper text */
:root:not(.dark) span.text-gray-500,
:root:not(.dark) p.text-gray-500 {
  color: var(--color-text-muted) !important;
}

/* Back link styling */
:root:not(.dark) a.text-gray-400 {
  color: var(--color-text-muted) !important;
}

:root:not(.dark) a.text-gray-400:hover {
  color: var(--color-text-primary) !important;
}

/* Image preview badges */
:root:not(.dark) span[class*="bg-dark-900"] {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Loading states */
:root:not(.dark) div.text-gray-400,
:root:not(.dark) div.text-gray-500 {
  color: var(--color-text-muted) !important;
}
