    :root {
      --bg-primary: #ffffff;
      --bg-secondary: #f8f9fa;
      --bg-tertiary: #e9ecef;
      --input: #FFFFFF;
      --text-primary: #212529;
      --text-secondary: #6c757d;
      --text-muted: #adb5bd;
      --border-color: #dee2e6;
      --user-message:#e9ecef;
      --accent-color: #B9DCFF;
      --codeHeader:#B9DCFF;
      --success-color: #28a745;
      --error-color: #dc3545;
      --warning-color: #ffc107;
      --info-color: #17a2b8;
      --shadow: 0 2px 10px rgba(0,0,0,0.1);
      --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
      --border-radius: 8px;
      --transition: all 0.2s ease;
    }

    [data-theme="dark"] {
      --bg-primary: #1a1a1a;
      --bg-secondary: #2d2d2d;
      --bg-tertiary: #404040;
      --user-message:#404040;
      --text-primary: #ffffff;
      --text-secondary: #cccccc;
      --text-muted: #888888;
      --border-color: #404040;
      --accent-color:#4da6ff;
      --success-color: #40c057;
      --codeHeader: #375A7D;
      --error-color: #fa5252;
      --warning-color: #fd7e14;
      --info-color: #339af0;
      --shadow: 0 2px 10px rgba(0,0,0,0.3);
      --shadow-hover: 0 4px 20px rgba(0,0,0,0.4);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: var(--bg-primary);
      color: var(--text-primary);
      transition: var(--transition);
      overflow-x: hidden;
    }

    .container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      height: 100vh;
      gap: 20px;
      padding: 20px;
    }

    .panel {
      background: var(--bg-secondary);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .panel-header {
      background: var(--bg-tertiary);
      padding: 15px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      max-height: 50px;
    }

    .panel-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .package-badge {
      background: var(--accent-color);
      color: white;
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 500;
    }

    .controls {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .btn {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      border: none;
      border-radius: 6px;
      background: var(--accent-color);
      color: white;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: var(--transition);
      text-decoration: none;
    }

    .btn:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow-hover);
    }

    .btn.secondary {
      background: var(--bg-tertiary);
      color: var(--text-primary);
      border: 1px solid var(--border-color);
    }

    .btn.rendering {
      background: var(--warning-color);
      cursor: not-allowed;
    }

    .btn .icon {
      width: 16px;
      height: 16px;
    }

    .editor-container {
      flex: 1;
      position: relative;
      overflow: hidden;
    }

    .editor-wrapper {
      position: relative;
      height: 100%;
      overflow: hidden;
    }

    #dslInput {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      padding: 20px;
      margin: 0;
      border: none;
      outline: none;
      background: transparent;
      color: transparent !important;
      font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.6;
      letter-spacing: 0;
      word-spacing: 0;
      resize: none;
      z-index: 2;
      caret-color: var(--text-primary) !important;
      white-space: pre-wrap;
      word-wrap: break-word;
      overflow: auto;
      box-sizing: border-box;
    }

    #syntax-highlight {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      padding: 20px;
      margin: 0;
      font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.6;
      letter-spacing: 0;
      word-spacing: 0;
      white-space: pre-wrap;
      word-wrap: break-word;
      pointer-events: none;
      z-index: 1;
      overflow: auto;
      color: var(--text-primary);
      box-sizing: border-box;
    }

    /* ============= SYNTAX HIGHLIGHTING STYLES ============= */
    body #syntax-highlight span.syntax-keyword,
    html body div#syntax-highlight .syntax-keyword {
      color: #7C3AED !important;
      font-weight: 800 !important;
      text-shadow: 0 0 1px rgba(124, 58, 237, 0.3) !important;
    }

    body #syntax-highlight span.syntax-name,
    html body div#syntax-highlight .syntax-name {
      color: #DC2626 !important;
      font-weight: 800 !important;
      text-shadow: 0 0 1px rgba(220, 38, 38, 0.3) !important;
    }

    body #syntax-highlight span.syntax-property,
    html body div#syntax-highlight .syntax-property {
      color: #047857 !important;
      font-weight: 700 !important;
      text-shadow: 0 0 1px rgba(4, 120, 87, 0.3) !important;
    }

    body #syntax-highlight span.syntax-comment,
    html body div#syntax-highlight .syntax-comment {
      color: #6B7280 !important;
      font-style: italic !important;
      opacity: 0.8 !important;
    }

    body #syntax-highlight span.syntax-brace,
    html body div#syntax-highlight .syntax-brace {
      color: #1D4ED8 !important;
      font-weight: 700 !important;
      text-shadow: 0 0 1px rgba(29, 78, 216, 0.3) !important;
    }

    body #syntax-highlight span.syntax-style,
    html body div#syntax-highlight .syntax-style {
      color: #B45309 !important;
      font-weight: 700 !important;
      text-shadow: 0 0 1px rgba(180, 83, 9, 0.3) !important;
    }

    body #syntax-highlight span.syntax-value,
    html body div#syntax-highlight .syntax-value {
      color: #A16207 !important;
      font-weight: 700 !important;
      text-shadow: 0 0 1px rgba(161, 98, 7, 0.3) !important;
    }

    body #syntax-highlight span.syntax-number,
    html body div#syntax-highlight .syntax-number {
      color: #0284C7 !important;
      font-weight: 700 !important;
      text-shadow: 0 0 1px rgba(2, 132, 199, 0.3) !important;
    }

    body #syntax-highlight span.syntax-operator,
    html body div#syntax-highlight .syntax-operator {
      color: #374151 !important;
      font-weight: 700 !important;
    }

    body #syntax-highlight span.syntax-error,
    html body div#syntax-highlight .syntax-error {
      color: #dc3545 !important;
      background-color: rgba(220, 53, 69, 0.1) !important;
      text-decoration: underline wavy #dc3545 !important;
      font-weight: 700 !important;
    }

    /* Dark theme syntax colors */
    body[data-theme="dark"] #syntax-highlight span.syntax-keyword,
    body[data-theme="dark"] #syntax-highlight .syntax-keyword {
      color: #E4B1F5 !important;
      text-shadow: 0 0 1px rgba(232, 121, 249, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-name,
    body[data-theme="dark"] #syntax-highlight .syntax-name {
      color: #FB7185 !important;
      text-shadow: 0 0 1px rgba(251, 113, 133, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-property,
    body[data-theme="dark"] #syntax-highlight .syntax-property {
      color: #99FADD !important;
      text-shadow: 0 0 1px rgba(74, 222, 128, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-comment,
    body[data-theme="dark"] #syntax-highlight .syntax-comment {
      color: #A3A3A3 !important;
      opacity: 0.8 !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-brace,
    body[data-theme="dark"] #syntax-highlight .syntax-brace {
      color: #60A5FA !important;
      text-shadow: 0 0 1px rgba(96, 165, 250, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-style,
    body[data-theme="dark"] #syntax-highlight .syntax-style {
      color: #FACC15 !important;
      text-shadow: 0 0 1px rgba(250, 204, 21, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-value,
    body[data-theme="dark"] #syntax-highlight .syntax-value {
      color: #FCD34D !important;
      text-shadow: 0 0 1px rgba(252, 211, 77, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-number,
    body[data-theme="dark"] #syntax-highlight .syntax-number {
      color: #38BDF8 !important;
      text-shadow: 0 0 1px rgba(56, 189, 248, 0.4) !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-operator,
    body[data-theme="dark"] #syntax-highlight .syntax-operator {
      color: #E5E7EB !important;
    }

    body[data-theme="dark"] #syntax-highlight span.syntax-error,
    body[data-theme="dark"] #syntax-highlight .syntax-error {
      color: #fa5252 !important;
      background-color: rgba(250, 82, 82, 0.1) !important;
      text-decoration: underline wavy #fa5252 !important;
    }

    .validation-panel {
      background: var(--bg-primary);
      border-top: 1px solid var(--border-color);
      max-height: 200px;
      overflow-y: auto;
      display: none;
    }

    .validation-panel.show {
      display: block;
    }

    .validation-item {
      padding: 8px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 13px;
    }

    .validation-item:last-child {
      border-bottom: none;
    }

    .validation-icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .validation-error {
      color: var(--error-color);
    }

    .validation-warning {
      color: var(--warning-color);
    }

    .validation-success {
      color: var(--success-color);
    }

    .validation-info {
      color: var(--info-color);
    }

    .canvas-container {
      flex: 1;
      padding: 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: var(--bg-primary);
    }

    .render-stats {
      padding: 10px 0;
      font-size: 12px;
      color: var(--text-secondary);
      text-align: center;
    }

    #canvas {
      max-width: 100%;
      max-height: calc(100% - 40px);
      border: 1px solid var(--border-color);
      border-radius: var(--border-radius);
      background: white;
      box-shadow: var(--shadow);
    }

    .status {
      position: fixed;
      top: 20px;
      right: 20px;
      padding: 12px 20px;
      border-radius: var(--border-radius);
      color: white;
      font-weight: 500;
      box-shadow: var(--shadow);
      z-index: 1000;
      display: none;
      animation: slideIn 0.3s ease;
    }

    .status-success { background: var(--success-color); }
    .status-error { background: var(--error-color); }
    .status-warning { background: var(--warning-color); }
    .status-info { background: var(--info-color); }

    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
      opacity: 0;
      visibility: hidden;
      transition: var(--transition);
    }

    .modal-overlay.show {
      opacity: 1;
      visibility: visible;
    }

    .modal {
      background: var(--bg-secondary);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow-hover);
      max-width: 600px;
      width: 90%;
      max-height: 80vh;
      overflow: auto;
    }

    .modal-header {
      padding: 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-title {
      font-size: 20px;
      font-weight: 600;
    }

    .modal-close {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: var(--text-secondary);
      padding: 0;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: var(--transition);
    }

    .modal-close:hover {
      background: var(--bg-tertiary);
    }

    .modal-content {
      padding: 20px;
    }

    .setting-group {
      margin-bottom: 25px;
    }

    .setting-label {
      display: block;
      font-weight: 600;
      margin-bottom: 10px;
      color: var(--text-primary);
    }

    .setting-options {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .setting-option {
      padding: 8px 16px;
      border: 2px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-primary);
      cursor: pointer;
      transition: var(--transition);
      font-size: 14px;
    }

    .setting-option:hover {
      border-color: var(--accent-color);
    }

    .setting-option.active {
      border-color: var(--accent-color);
      background: var(--accent-color);
      color: white;
    }

    .input-group {
      display: flex;
      gap: 15px;
      align-items: center;
    }

    .input-group label {
      min-width: 60px;
      font-weight: 500;
    }

    .input-group input {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 14px;
    }

    .package-info {
      background: var(--bg-tertiary);
      padding: 15px;
      border-radius: var(--border-radius);
      margin-bottom: 20px;
    }

    .package-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 15px;
    }

    .package-card {
      background: var(--bg-primary);
      padding: 15px;
      border-radius: var(--border-radius);
      border: 1px solid var(--border-color);
    }

    .package-name {
      font-weight: 600;
      font-size: 16px;
      margin-bottom: 5px;
      color: var(--accent-color);
    }

    .package-description {
      font-size: 14px;
      color: var(--text-secondary);
      margin-bottom: 10px;
    }

    .package-example {
      background: var(--bg-secondary);
      padding: 8px;
      border-radius: 4px;
      font-family: monospace;
      font-size: 12px;
      color: var(--text-primary);
      border-left: 3px solid var(--accent-color);
    }

    @keyframes slideIn {
      from { transform: translateX(100%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    @media (max-width: 768px) {
      .container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
      }
      
      .controls {
        flex-wrap: wrap;
      }
      
      .btn {
        padding: 6px 12px;
        font-size: 12px;
      }
    }
    
    
    .example-selector {
  display: flex;
  align-items: center;
  margin: 0 15px;
}

.example-dropdown {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.2s ease;
}

.example-dropdown:hover {
  border-color: #4da6ff;
}

.example-dropdown:focus {
  outline: none;
  border-color: #4da6ff;  
  box-shadow: 0 0 0 2px rgba(77, 166, 255, 0.2);
}

.example-dropdown optgroup {
  font-weight: bold;
  color: #666;
  font-size: 11px;
}

.example-dropdown option {
  font-weight: normal;
  color: #333;
  padding: 4px;
  font-size: 12px;
}

/* Dark theme support */
[data-theme="dark"] .example-dropdown {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .example-dropdown optgroup {
  color: #a0aec0;
}

[data-theme="dark"] .example-dropdown option {
  color: #e2e8f0;
}

    /* 🔍 SEARCH MODAL STYLES */
    .search-modal-overlay {
      z-index: 2000;
    }

    .search-modal {
      width: 90vw;
      max-width: 1000px;
      height: 80vh;
      max-height: 700px;
      background: var(--bg-primary);
      border-radius: 16px;
      box-shadow: 0 25px 50px rgba(0,0,0,0.25);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      position: relative;
    }

    .search-header {
      padding: 24px 24px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--bg-secondary);
    }

    .search-input-container {
      position: relative;
      display: flex;
      align-items: center;
      background: white;
      border: 2px solid #e0e0e0;
      border-radius: 12px;
      padding: 0 16px;
      transition: all 0.3s ease;
    }

    .search-input-container:focus-within {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(77,166,255,0.1);
    }

    .search-icon {
      width: 20px;
      height: 20px;
      color: #999;
      margin-right: 12px;
      flex-shrink: 0;
    }

    #searchInput {
      flex: 1;
      padding: 16px 0;
      border: none;
      outline: none;
      font-size: 16px;
      color: #333
      background: transparent;
    }

    #searchInput::placeholder {
      color: #999;
    }

    .search-close {
      background: none;
      border: none;
      font-size: 24px;
      color: #999;
      cursor: pointer;
      padding: 4px;
      border-radius: 4px;
      transition: all 0.2s ease;
    }

    .search-close:hover {
      background: #f0f0f0;
      color: var(--text-primary);
    }

    .search-hint {
      margin-top: 12px;
      font-size: 14px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .search-content {
      flex: 1;
      display: flex;
      min-height: 0;
    }

    .search-sidebar {
      width: 400px;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
    }

    .search-results {
      flex: 1;
      overflow-y: auto;
      padding: 8px;
    }

    .search-placeholder, .detail-placeholder {
      text-align: center;
      padding: 60px 40px;
      color: var(--text-secondary);
    }

    .search-placeholder-icon, .detail-placeholder-icon {
      font-size: 48px;
      margin-bottom: 16px;
      opacity: 0.5;
    }

    .search-placeholder h3, .detail-placeholder h3 {
      margin-bottom: 8px;
      color: var(--text-primary);
      font-size: 18px;
    }

    .search-placeholder p, .detail-placeholder p {
      line-height: 1.5;
      max-width: 300px;
      margin: 0 auto;
    }

    .search-result-item {
      padding: 16px;
      border-radius: 10px;
      margin-bottom: 4px;
      cursor: pointer;
      transition: all 0.2s ease;
      border: 0px solid transparent;
    }

    .search-result-item:hover, .search-result-item.selected {
      background: var(--bg-secondary);
      border-color: var(--primary);
    }

    .search-result-item.selected {
      background: rgba(77,166,255,0.1);
    }

    .result-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
    }

    .result-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: bold;
      font-size: 14px;
      flex-shrink: 0;
    }

    .result-title {
      font-weight: 600;
      color: var(--text-primary);
      font-size: 16px;
    }

    .result-package {
      background: var(--bg-secondary);
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 12px;
      color: var(--text-secondary);
      margin-left: auto;
    }

    .result-description {
      color: var(--text-secondary);
      font-size: 14px;
      line-height: 1.4;
      margin-left: 44px;
    }

    .search-detail {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
    }

    .detail-header {
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border);
    }

    .detail-title {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 12px;
    }

    .detail-title h2 {
      color: var(--text-primary);
      font-size: 24px;
      font-weight: 700;
    }

    .detail-package-badge {
      background: var(--primary);
      color: white;
      padding: 4px 12px;
      border-radius: 16px;
      font-size: 14px;
      font-weight: 500;
    }

    .detail-description {
      color: var(--text-secondary);
      font-size: 16px;
      line-height: 1.5;
    }

    .detail-section {
      margin-bottom: 32px;
    }

    .detail-section h3 {
      color: var(--text-primary);
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .examples-grid {
      display: grid;
      gap: 12px;
    }

    .example-item {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px;
      cursor: pointer;
      transition: all 0.2s ease;
      position: relative;
    }

    .example-item:hover {
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .example-code {
      font-family: 'Courier New', monospace;
      font-size: 14px;
      color: var(--text-primary);
      background: var(--bg-primary);
      padding: 12px;
      border-radius: 6px;
      border: 0px solid #e0e0e0;
      margin-bottom: 8px;
      position: relative;
    }

    .example-code::after {
      content: '📋';
      position: absolute;
      top: 8px;
      right: 8px;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .example-item:hover .example-code::after {
      opacity: 0.5;
    }

    .example-note {
      color: var(--text-secondary);
      font-size: 13px;
    }

    .properties-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 16px;
    }

    .property-card {
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px;
    }

    .property-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 8px;
    }

    .property-name {
      font-weight: 600;
      color: var(--text-primary);
      font-family: 'Courier New', monospace;
    }

    .property-type {
      background: var(--bg-secondary);
      color: var(--text-secondary);
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 12px;
    }

    .property-required {
      background: #ff6b6b;
      color: white;
    }

    .property-details {
      color: var(--text-secondary);
      background: var(--bg-tertiary);
      font-size: 14px;
      line-height: 1.4;
    }

    .insert-button {
      position: relative;
      bottom: 0px !important;
      background: var(--bg-primary);
      color: var(--text-secondary);
      border: none;
      padding: 14px 24px;
      border-radius: 10px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 4px 12px rgba(77,166,255,0.3);
      width: 100%;
    }

    .insert-button:hover {
      
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(77,166,255,0.4);
    }

    .search-footer {
      padding: 16px 24px;
      border-top: 1px solid var(--border);
      background: var(--bg-secondary);
    }

    .search-shortcuts {
      display: flex;
      gap: 16px;
      font-size: 14px;
      color: var(--text-secondary);
      align-items: center;
    }

    .shortcut-key {
      background: white;
      padding: 4px 8px;
      border-radius: 4px;
      border: 1px solid var(--border);
      font-family: 'Courier New', monospace;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-primary);
    }

    /* Syntax highlighting for examples */
    .syntax-keyword { color: #569cd6; }
    .syntax-string { color: #ce9178; }
    .syntax-number { color: #b5cea8; }
    .syntax-comment { color: #6a9955; }

    /* Responsive design */
    @media (max-width: 768px) {
      .search-modal {
        width: 95vw;
        height: 90vh;
      }
      
      .search-content {
        flex-direction: column;
      }
      
      .search-sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--border);
      }
      
      .search-detail {
        height: 60%;
      }
    }
    
            .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 70px;
    height: 50px;
    transition: transform 0.3s ease;
    margin-right: 5px !important;
}

.logo:hover .logo-icon {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

#editorFontSize {
    display: block !important;
    visibility: visible !important;
}
.setting-group:last-child {
    display: block !important;
}


/* ===========================================
   AI CHAT INTERFACE - CLEAN VERSION
   =========================================== */

/* --- Variables --- */
:root {
  --ai-primary: #4da6ff;
  --ai-primary-dark: #2d8cff;
  --ai-primary-light: rgba(77, 166, 255, 0.1);
  --ai-border: #e2e8f0;
  --ai-bg-light: #F8F7F6;
  --ai-text: #2d3748;
  --ai-text-muted: #718096;
  --ai-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --ai-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --ai-radius: 12px;
  --ai-radius-small: 8px;
}

/* --- Toggle Button --- */
.ai-chat-toggle {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(77, 166, 255, 0.25);
  letter-spacing: 0.3px;
}

.ai-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(77, 166, 255, 0.35);
}

.ai-chat-toggle.active {
  background: linear-gradient(135deg, var(--ai-primary-dark) 0%, #1a73e8 100%);
}

/* --- Chat Panel --- */
.ai-chat-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #F8F7F6;
  border: 1px solid var(--ai-border);
  border-top: none;
  border-radius: 0 0 var(--ai-radius) var(--ai-radius);
  box-shadow: var(--ai-shadow);
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.ai-chat-panel.expanded {
  max-height: var(--dynamic-height, calc(100vh - 80px));
  opacity: 1;
}

.ai-chat-content {
  padding: 24px;
  height: calc(var(--dynamic-height, calc(100vh - 80px)) - 40px);
  display: flex;
  flex-direction: column;
 
}

/* --- Messages Area --- */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
  
}

.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* --- Individual Messages --- */
.ai-message {
  margin-bottom: 16px;
  animation: slideInMessage 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.ai-message.user {
  text-align: left;
}



.ai-message-content {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Remove spacing around code blocks in messages */
.ai-message-content .ai-code-block {
  margin: 25px 25px 25px 25px;
}

.ai-message-content .ai-code-block:first-child {
  margin-top: 10px;
}

.ai-message-content .ai-code-block:last-child {
  margin-bottom: 10px;
}

/* Clean up text spacing around code */
.ai-message-content p + .ai-code-block {
  margin-top: 6px;
}

.ai-message-content .ai-code-block + p {
  margin-top: 8px;
}

.ai-message.user .ai-message-content {
  background: var(--user-message);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
 /* box-shadow: 0 2px 10px rgba(77, 166, 255, 0.2);*/
}

.ai-message.assistant .ai-message-content {
  background: var(--ai-bg-light);
  color: var(--ai-text);
  border-bottom-left-radius: 2px;
  border: 0px solid var(--ai-border);
  text-align: left;
}

/* --- Welcome Message --- */
.ai-welcome {
  text-align: center;
  color: var(--ai-text-muted);
  font-size: 15px;
  margin-top: 80px;
  font-weight: 500;
}

/* --- Typing Indicator --- */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ai-bg-light);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  border: 1px solid var(--ai-border);
  max-width: 80px;
}

.ai-typing-dots {
  display: flex;
  gap: 4px;
}

.ai-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ai-primary);
  animation: typingDot 1.4s infinite;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* --- REDESIGNED CODE BLOCKS (SUPER CLEAN CARD STYLE) --- */
.ai-code-block {
  background: white;
  border: 1px solid #e8ecef;
  border-radius: 16px;
  margin: 6px auto;
  overflow: hidden;
  /*box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);*/
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  padding: 0;
  box-sizing: border-box;
  font-size: 0; /* Collapses whitespace and br elements */
}

/* Remove any br elements inside code blocks */
.ai-code-block br {
  display: none;
}

/* Reset font-size for actual content */
.ai-code-block > * {
  font-size: initial;
}

/*.ai-code-block:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}*/

.ai-code-header {
  background: var(--codeHeader);
  color: var(--text-primary);
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background-attachment: fixed;
  position: relative;
  margin: 0 !important;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  border-radius: 16px 16px 0 0;
}

.ai-code-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
}

.ai-code-content {
  padding: 20px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 16px;
  line-height: 1.6;
  color: #2d3748;
  /*background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);*/
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
  position: relative;
}

.ai-code-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
 /* background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);*/
  border-radius: 0 2px 2px 0;
}

.ai-insert-btn {
  
  border: 0px solid rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
  padding: 8px;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
 
}

/*.ai-insert-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}*/

.ai-insert-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* --- Input Container --- */
.ai-input-container {
  display: flex;
  flex-direction: column;
  background: var(--input);
  border-radius: 25px;
  border: 2px solid rgba(77, 166, 255, 0.15);
  overflow: hidden;
  backdrop-filter: blur(10px);
  min-height: 120px; /* Changed from fixed height to min-height */
  max-height: 350px; /* Add max-height to prevent infinite growth */
}

.ai-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 5px,5px,5px,5px;
}

.ai-input {
  flex: 1;
  min-height: 44px;
  max-height: 350px;
  padding: 16px 20px;
  border: 0px solid rgba(77, 166, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255);
  resize: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.ai-input:focus {
  border-color: var(--ai-primary);
  /*box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);*/
  background: white;
}

.ai-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(77, 166, 255, 0.3);
}

.ai-send-btn:hover {
  background: linear-gradient(135deg, var(--ai-primary-dark) 0%, #1a73e8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(77, 166, 255, 0.4);
}

.ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Button Row --- */
.ai-button-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 15px 10px 10px;
  border-top: 0px solid rgba(77, 166, 255, 0.1);
  
}

.ai-row-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 0px solid rgba(77, 166, 255, 0.15);
  border-radius: 8px;
  color: #667;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  backdrop-filter: blur(10px);
}

.ai-row-btn:hover {
  background: var(--ai-primary-light);
  border-color: var(--ai-primary);
  color: var(--ai-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(77, 166, 255, 0.1);
}

.ai-row-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.ai-row-btn.clear-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.ai-row-btn.save-btn:hover {
  background: rgba(76, 175, 80, 0.1);
  border-color: #4caf50;
  color: #4caf50;
}

.ai-row-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.message-count {
  margin-left: auto;
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

/* --- Animations --- */
@keyframes slideInMessage {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

@keyframes rowBtnSuccess {
  0% { 
    transform: scale(1); 
    background: rgba(255, 255, 255, 0.9);
  }
  50% { 
    transform: scale(1.05); 
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
    color: #4caf50;
  }
  100% { 
    transform: scale(1); 
    background: rgba(255, 255, 255, 0.9);
  }
}

.ai-row-btn.success {
  animation: rowBtnSuccess 0.6s ease;
}

/* ===========================================
   DARK THEME SUPPORT
   =========================================== */

[data-theme="dark"] {
  --ai-border: #404040;
  --ai-bg-light: #2a2d35;
  --ai-text: #e2e8f0;
  --ai-text-muted: #a0aec0;
}

[data-theme="dark"] .ai-chat-panel {
  background: #262624;
  border-color: var(--ai-border);
}

[data-theme="dark"] .ai-message.assistant .ai-message-content {
  background: #262624;
  color: var(--ai-text);
 
}

[data-theme="dark"] .ai-message-content .user {
  background: #262624;
  color: var(--ai-text);
 
}

[data-theme="dark"] .ai-typing-indicator {
  background: #2a2d35;
 
}

[data-theme="dark"] .ai-code-block {
  background: #262624;
  border-color: #404040;
}

[data-theme="dark"] .ai-code-content {
  background: #262624;
  color: #e0e0e0;
}

[data-theme="dark"] .ai-input-container {
  background: #1E1E1E;
  border-color: rgba(77, 166, 255, 0.3);
}

[data-theme="dark"] .ai-input-wrapper {
  background: #1E1E1E;
}

[data-theme="dark"] .ai-input {
  background:#1E1E1E;
  border-color: rgba(77, 166, 255, 0.3);
  color: var(--ai-text);
}

[data-theme="dark"] .ai-input:focus {
  background: #1E1E1E;
  border-color: var(--ai-primary);
}

[data-theme="dark"] .ai-button-row {
  background:#1E1E1E;
  border-top-color: rgba(77, 166, 255, 0.2);
}

[data-theme="dark"] .ai-row-btn {
  background: #1E1E1E;
  border-color: rgba(77, 166, 255, 0.2);
  color: #b0b0b0;
}

[data-theme="dark"] .ai-row-btn:hover {
  background: #1E1E1E;
  border-color: var(--ai-primary);
  color: var(--ai-primary);
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 768px) {
  .ai-chat-content {
    padding: 16px;
  }
  
  .ai-input-wrapper {
    padding: 12px;
    gap: 8px;
  }
  
  .ai-button-row {
    padding: 8px 12px 12px;
    gap: 8px;
  }
  
  .ai-row-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .ai-row-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .ai-code-content {
    padding: 16px;
    font-size: 12px;
  }
  
  .ai-code-header {
    padding: 12px 16px;
  }
}

.panel-header {
  position: relative;
}
