/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import Theme CSS Variables */
@import url("/assets/theme-4f93cdc2.css");

/* Import Block Editor Styles */
@import url("/assets/block_editor-c4b05d2e.css");

/* Import Turbo Native Styles */
@import url("/assets/turbo_native-f26f02de.css");

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f7f7f8;
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ========================================
   ChatGPT Style Sidebar
   ======================================== */

.sidebar {
  width: 260px;
  background-color: #ffffff;
  color: #0d0d0d;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid #e5e5e5;
  transition: width 0.2s ease;
  position: relative;
}

.sidebar.collapsed {
  width: 52px;
}

/* Expanded Content - shown when not collapsed */
.sidebar-expanded-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar.collapsed .sidebar-expanded-content {
  display: none;
}

/* Collapsed Content - shown when collapsed */
.sidebar-collapsed-content {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 12px 8px;
}

.sidebar.collapsed .sidebar-collapsed-content {
  display: flex;
}

/* Header */
.sidebar-header {
  padding: 12px 12px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo .logo-icon {
  color: #0d0d0d;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #6e6e80;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.sidebar-toggle:hover {
  background-color: #f0f0f0;
}

/* Menu Items */
.sidebar-menu {
  padding: 4px 8px 8px;
  border-bottom: 1px solid #e5e5e5;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #0d0d0d;
  text-decoration: none;
  transition: background-color 0.15s;
  font-size: 14px;
  gap: 12px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 8px;
}

.sidebar-item:hover {
  background-color: #f0f0f0;
}

.sidebar-item svg {
  flex-shrink: 0;
  color: #0d0d0d;
}

.item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-shortcut {
  font-size: 12px;
  color: #8e8e8e;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* History Section */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.sidebar-history::-webkit-scrollbar {
  width: 6px;
}

.sidebar-history::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-history::-webkit-scrollbar-thumb {
  background: #d1d1d1;
  border-radius: 3px;
}

.sidebar-history::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

.history-item {
  display: block;
  padding: 10px 12px;
  color: #0d0d0d;
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: background-color 0.15s;
  cursor: pointer;
}

.history-item:hover {
  background-color: #f0f0f0;
}

.history-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer / User Profile */
.sidebar-footer {
  border-top: 1px solid #e5e5e5;
  padding: 8px;
  margin-top: auto;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background-color 0.15s;
}

.user-profile:hover {
  background-color: #f0f0f0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: #0d0d0d;
}

.user-plan {
  font-size: 12px;
  color: #10a37f;
}

/* ========================================
   Collapsed Sidebar Styles
   ======================================== */

.collapsed-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 12px;
}

.collapsed-logo .logo-icon {
  color: #0d0d0d;
}

.collapsed-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.collapsed-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #0d0d0d;
  text-decoration: none;
  transition: background-color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
}

.collapsed-item:hover {
  background-color: #f0f0f0;
}

.collapsed-item svg {
  color: #0d0d0d;
}

.collapsed-footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
}

.collapsed-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
}

.collapsed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========================================
   History Item Hover Menu
   ======================================== */

.history-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.history-item-wrapper .history-item {
  flex: 1;
  min-width: 0;
}

/* 더보기 버튼 - 기본적으로 숨김, 호버시 표시 */
.history-menu-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: linear-gradient(to right, transparent, #ffffff 20%);
  padding-left: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 4px;
}

.history-item-wrapper:hover .history-menu-btn {
  opacity: 1;
}

.history-menu-btn:hover {
  background: linear-gradient(to right, transparent, #f0f0f0 20%);
}

.history-menu-btn svg {
  color: #6e6e80;
}

/* 컨텍스트 메뉴 */
.history-context-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  width: 200px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  z-index: 100;
}

.history-context-menu.hidden {
  display: none;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: #0d0d0d;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s;
}

.context-menu-item:hover {
  background-color: #f7f7f8;
}

.context-menu-item svg {
  flex-shrink: 0;
  color: #6e6e80;
}

/* 서브메뉴 화살표 */
.context-menu-item-submenu {
  justify-content: flex-start;
}

.context-menu-item-submenu .submenu-arrow {
  margin-left: auto;
  color: #6e6e80;
}

/* 삭제 버튼 - 빨간색 */
.context-menu-item-danger {
  color: #ef4444;
}

.context-menu-item-danger svg {
  color: #ef4444;
}

.context-menu-item-danger:hover {
  background-color: #fef2f2;
}

/* 구분선 */
.context-menu-divider {
  height: 1px;
  background-color: #e5e5e5;
  margin: 4px 0;
}

/* ========================================
   Profile Dropdown Menu
   ======================================== */

.sidebar-footer {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  margin-bottom: 8px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  z-index: 100;
}

.profile-dropdown.hidden {
  display: none;
}

.profile-menu-email {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: #0d0d0d;
}

.profile-menu-email svg {
  color: #6e6e80;
  flex-shrink: 0;
}

.profile-menu-divider {
  height: 1px;
  background-color: #e5e5e5;
  margin: 4px 0;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: #0d0d0d;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s;
}

.profile-menu-item:hover {
  background-color: #f7f7f8;
}

.profile-menu-item svg {
  flex-shrink: 0;
  color: #6e6e80;
}

.profile-menu-item-with-arrow {
  justify-content: flex-start;
}

.profile-menu-item-with-arrow .menu-arrow {
  margin-left: auto;
  color: #6e6e80;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid #e5e5e5;
  background-color: #ffffff;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.chat-version {
  font-size: 12px;
  color: #666;
  background-color: #f0f0f0;
  padding: 2px 8px;
  border-radius: 4px;
}

.dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #666;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: none;
  border: 1px solid #d0d0d0;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background-color: #f5f5f5;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.message-area {
  max-width: 800px;
  margin: 0 auto;
}

.chat-message {
  margin-bottom: 32px;
}

.message-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.message-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.tag {
  background-color: #f0f0f0;
  color: #666;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
}

.edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  padding: 4px 8px;
}

.message-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e5e5;
  overflow-x: auto;
}

.tab {
  background: none;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab:hover {
  color: #1a1a1a;
  background-color: #f5f5f5;
}

.tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
  font-weight: 500;
}

.message-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px 0;
  color: #1a1a1a;
}

.message-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 12px 0;
  color: #1a1a1a;
}

.message-content p {
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 16px;
}

.message-content ul {
  margin: 16px 0;
  padding-left: 24px;
}

.message-content li {
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 8px;
}

.message-image {
  margin: 24px 0;
}

.image-placeholder {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.dashboard-preview {
  color: #999;
  font-size: 14px;
}

.chat-input-area {
  border-top: 1px solid #e5e5e5;
  padding: 16px 24px;
  background-color: #ffffff;
}

.input-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: #f7f7f8;
  border: 1px solid #d0d0d0;
  border-radius: 24px;
  padding: 8px 12px;
}

.message-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  outline: none;
  padding: 4px 8px;
}

.send-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #10a37f;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.send-button:hover {
  background-color: #0e8c6d;
}

/* Chatbot Widget Styles */
.chatbot-widget {
  width: 320px;
  background-color: #ffffff;
  border-left: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: visible;
  position: relative;
}

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  position: relative;
}

.chatbot-close .close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  text-decoration: none;
}

.chatbot-actions {
  display: flex;
  gap: 8px;
}

.chatbot-actions .action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  padding: 4px;
}

.chatbot-title {
  padding: 8px 16px;
  text-align: center;
}

.chatbot-title h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.chatbot-character {
  padding: 24px;
  text-align: center;
}

.character-container {
  background: linear-gradient(135deg, #e0f7e9 0%, #b8e6d5 100%);
  border-radius: 50%;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-emoji {
  font-size: 64px;
}

.chatbot-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.greeting-card {
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.greeting-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.greeting-image {
  background-color: #d4ff7a;
  border-radius: 8px;
  padding: 24px;
  margin-top: 16px;
}

.pointer-illustration svg {
  width: 100%;
  height: auto;
}

.chatbot-input {
  padding: 12px 16px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: #f7f7f8;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  padding: 8px 12px;
}

.chat-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  outline: none;
}

.voice-btn,
.send-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  padding: 4px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .chatbot-widget {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .item-text,
  .item-shortcut,
  .section-title,
  .user-name {
    display: none;
  }

  .sidebar-item {
    justify-content: center;
  }
}

/* Active Chatbot Widget Styles */
.chatbot-content-chat {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.chatbot-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.user-message,
.assistant-message {
  display: flex;
  margin-bottom: 8px;
}

.user-message {
  justify-content: flex-end;
}

.assistant-message {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.user-message .message-bubble {
  background-color: #10a37f;
  color: white;
  border-radius: 16px 16px 4px 16px;
}

.assistant-message .message-bubble {
  background-color: #f0f0f0;
  color: #1a1a1a;
  border-radius: 16px 16px 16px 4px;
}

/* Active widget hidden by default */
#chatbot-widget-active {
  display: none;
}

.chatbot-widget.active {
  display: flex !important;
}

/* Settings Dropdown Styles */
.chatbot-settings-dropdown {
  position: absolute;
  top: 100%;
  right: 16px;
  margin-top: 8px;
  z-index: 1000;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-dropdown-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 280px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
}

.settings-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  background-color: #f9fafb;
}

.settings-dropdown-title {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.character-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid #f0f0f0;
}

.character-option:last-child {
  border-bottom: none;
}

.character-option:hover {
  background-color: #f5f5f5;
}

.character-option.selected {
  background-color: #f0fdf4;
}

.character-option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.character-option-icon {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
}

.character-option-text {
  flex: 1;
}

.character-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.character-option-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}

.character-option-check {
  font-size: 18px;
  color: #10a37f;
  font-weight: bold;
  display: none;
  margin-left: 8px;
}

/* Tab Interaction Styles */
.tab {
  position: relative;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab[draggable="true"] {
  cursor: move;
}

.tab.drag-over {
  background-color: #e5e5e5;
  border-left: 2px solid #10a37f;
}

.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 16px;
  color: #999;
  transition: all 0.2s;
  opacity: 0;
  margin-left: 4px;
}

.tab:hover .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background-color: #e5e5e5;
  color: #1a1a1a;
}

.tab[contenteditable="true"] {
  outline: 2px solid #10a37f;
  outline-offset: 2px;
  background-color: #f9f9f9;
}

.tab.more,
.tab.add {
  cursor: pointer;
}

.tab.add {
  color: #10a37f;
  font-weight: 500;
}

.tab.add:hover {
  background-color: #f0fdf4;
}

/* Tab Contents Styles */
.tab-contents {
  margin-top: 24px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.editable-content {
  outline: none;
  min-height: 200px;
  padding: 16px;
  border: none;
  border-radius: 8px;
  transition: all 0.2s;
}

.editable-content:hover {
  background-color: transparent;
}

.editable-content:focus {
  background-color: transparent;
}

.editable-content h2,
.editable-content h3 {
  margin-top: 20px;
  margin-bottom: 12px;
}

.editable-content h2:first-child,
.editable-content h3:first-child {
  margin-top: 0;
}

.editable-content p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.editable-content ul,
.editable-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.editable-content li {
  margin-bottom: 8px;
}

/* Notion-style Editor Toolbar */
.editor-toolbar {
  position: absolute;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 6px;
  display: none;
  gap: 2px;
  align-items: center;
  z-index: 10000;
  flex-wrap: nowrap;
  animation: fadeInToolbar 0.15s ease-out;
}

@keyframes fadeInToolbar {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toolbar-btn {
  background: white;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.toolbar-btn:hover {
  background: #f3f4f6;
  border-color: #e5e5e5;
}

.toolbar-btn:active {
  background: #e5e7eb;
}

.toolbar-btn strong,
.toolbar-btn em,
.toolbar-btn u,
.toolbar-btn s {
  font-size: 14px;
  font-weight: 600;
}

.toolbar-select {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  outline: none;
  min-width: 70px;
  height: 28px;
}

.toolbar-select:hover {
  background: #f9fafb;
}

.toolbar-select:focus {
  border-color: #10a37f;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: #e5e5e5;
  margin: 0 2px;
}

/* Bookmark Styles */
.bookmark-btn {
  position: relative;
}

.bookmark-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 320px;
  max-height: 400px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 10002;
  margin-top: 5px;
}

.bookmark-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.bookmark-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.bookmark-clear-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  color: #999;
  transition: all 0.2s;
}

.bookmark-clear-btn:hover {
  background: #fee;
  color: #e74c3c;
}

.bookmark-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.bookmark-empty {
  padding: 24px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.bookmark-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
}

.bookmark-item:hover {
  background: #f0f0f0;
  transform: translateX(2px);
}

.bookmark-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bookmark-preview {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bookmark-date {
  font-size: 11px;
  color: #999;
}

.bookmark-delete {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 8px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.bookmark-delete:hover {
  color: #e74c3c;
}

/* Bookmark Toast Notification */
.bookmark-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10003;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.bookmark-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Color Picker */
.color-picker-wrapper {
  position: relative;
  display: inline-flex;
}

.color-picker-dropdown {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: none;
  z-index: 10001;
}

.color-picker-dropdown[style*="block"] {
  animation: fadeInUp 0.15s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.color-picker-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

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

.color-option {
  width: 24px;
  height: 24px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s;
  padding: 0;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: #10a37f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Enhanced editable content styling */
.editable-content blockquote {
  border-left: 4px solid #10a37f;
  padding-left: 16px;
  margin-left: 0;
  color: #666;
  font-style: italic;
  margin: 16px 0;
}

.editable-content pre {
  margin: 16px 0;
}

.editable-content code {
  display: block;
  background-color: #f5f5f5;
  padding: 12px;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  overflow-x: auto;
  line-height: 1.5;
}

.editable-content hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 24px 0;
}

.editable-content a {
  color: #10a37f;
  text-decoration: underline;
  cursor: pointer;
}

.editable-content a:hover {
  color: #0e8c6d;
}

/* Collapsed Chatbot Widget - Bookmark Style */
.chatbot-collapsed {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  z-index: 1000;
  transition: all 0.3s ease;
}

.bookmark-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bookmark-main {
  width: 40px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: none;
  border-radius: 8px 0 0 0;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border-left: 2px solid #10a37f;
}

.bookmark-main:hover {
  transform: translateX(-3px);
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
}

.bookmark-main:active {
  transform: translateX(-1px);
}

.bookmark-icon {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bookmark-tail {
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 12px solid #f8f9fa;
  filter: drop-shadow(-1px 2px 3px rgba(0, 0, 0, 0.1));
  position: relative;
  right: 0.5px;
}

/* ================================================
   TAILWIND-LIKE UTILITY CLASSES
   ================================================ */

/* Display & Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }
.block { display: block; }

/* Flex Direction */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }

/* Flex Properties */
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Justify & Align */
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }

/* Sizing */
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.min-h-0 { min-height: 0; }
.min-w-0 { min-width: 0; }
.max-w-2xl { max-width: 42rem; }

/* Spacing - Margin */
.ml-64 { margin-left: 16rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mt-auto { margin-top: auto; }
.mt-1 { margin-top: 0.25rem; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }

/* Spacing - Padding */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pb-3 { padding-bottom: 0.75rem; }
.p-1\.5 { padding: 0.375rem; }

/* Gap */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-900 { background-color: #111827; }
.bg-transparent { background-color: transparent; }

/* Text Colors */
.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-red-600 { color: #dc2626; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

/* Additional spacing */
.pr-2 { padding-right: 0.5rem; }
.w-48 { width: 12rem; }
.min-h-\[60px\] { min-height: 60px; }

/* Shadows */
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.left-2 { left: 0.5rem; }
.right-0 { right: 0; }
.right-2 { right: 0.5rem; }
.bottom-0 { bottom: 0; }
.bottom-full { bottom: 100%; }
.top-full { top: 100%; }

/* Z-Index */
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }

/* Transitions */
.transition-colors { transition-property: background-color, border-color, color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Transform */
.transform { transform: translateX(0); }
.scale-95 { transform: scale(0.95); }
.origin-bottom { transform-origin: bottom; }
.origin-bottom-right { transform-origin: bottom right; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-80 { opacity: 0.8; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Outline */
.outline-none { outline: none; }

/* Focus Within */
.focus-within\:border-gray-400:focus-within { border-color: #9ca3af; }
.focus-within\:bg-white:focus-within { background-color: #ffffff; }

/* Hover States */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-gray-300:hover { background-color: #d1d5db; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:opacity-80:hover { opacity: 0.8; }

/* Group Hover */
.group:hover .group-hover\:text-white { color: #ffffff; }

/* Placeholder */
.placeholder-gray-500::placeholder { color: #6b7280; }

/* Space Between */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }

/* ========================================
   Active Chatbot Widget Styles
   ======================================== */

.chatbot-widget-active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chatbot-widget-active .chatbot-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
  gap: 12px;
}

.chatbot-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.chatbot-header-emoji {
  font-size: 20px;
}

.chatbot-header-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Messages Container */
.chatbot-widget-active .chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
}

.welcome-message {
  display: flex;
  justify-content: flex-start;
}

.welcome-message .message-bubble {
  background-color: #f0f0f0;
  color: #1a1a1a;
  border-radius: 16px 16px 16px 4px;
}

/* Greeting Subtitle */
.greeting-subtitle {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

/* Collapsed Chatbot */
.chatbot-collapsed {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #10a37f 0%, #0d8a6a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 1000;
}

.chatbot-collapsed:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(16, 163, 127, 0.5);
}

.chatbot-collapsed-icon {
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-collapsed-icon i {
  font-size: 24px;
}

/* Send Button Styling */
.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #10a37f;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.send-btn:hover {
  background: #0d8a6a;
}

.send-btn i {
  font-size: 16px;
}

/* ========================================
   Chart Container Styles
   ======================================== */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 250px;
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Analysis content 내부 차트 스타일 */
.analysis-content .chart-container {
  background: var(--color-neutral-white, #ffffff);
  border: 1px solid var(--color-neutral-gray, #e5e5e5);
}

/* Prose 내부 차트가 텍스트 스타일 상속받지 않도록 */
.prose .chart-container {
  font-size: 14px;
  color: var(--color-text-primary, #0d0d0d);
}

/* ========================================
   Section Selector Mode (마우스 포인터)
   ======================================== */

/* 섹션 선택 버튼 */
.section-selector-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  margin-top: 16px;
  background: var(--color-accent-main, #d4ff7a);
  border: none;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-secondary-main, #1a1a2e);
  transition: all 0.15s ease;
}

.section-selector-btn:hover {
  background: var(--color-accent-dark, #c4ef6a);
  transform: translateY(-1px);
}

.section-selector-btn:active {
  transform: translateY(0);
}

.section-selector-btn i {
  font-size: 18px;
}

/* 모드 인디케이터 (상단 중앙) */
.section-selector-indicator {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-accent-main, #d4ff7a);
  color: var(--color-secondary-main, #1a1a2e);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.section-selector-indicator.visible {
  opacity: 1;
  visibility: visible;
}

.section-selector-indicator i {
  font-size: 16px;
}

.section-selector-indicator__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.section-selector-indicator__close:hover {
  background: rgba(0, 0, 0, 0.2);
}

.section-selector-indicator__close i {
  font-size: 12px;
}

/* 섹션 선택 모드 활성화 시 호버 효과 */
.section-selector-active .prose h2,
.section-selector-active .prose h3,
.section-selector-active .prose h4,
.section-selector-active .prose p,
.section-selector-active .prose ul,
.section-selector-active .prose ol,
.section-selector-active .prose li,
.section-selector-active .prose table,
.section-selector-active .prose blockquote {
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 4px;
}

.section-selector-active .prose h2:hover,
.section-selector-active .prose h3:hover,
.section-selector-active .prose h4:hover,
.section-selector-active .prose p:hover,
.section-selector-active .prose ul:hover,
.section-selector-active .prose ol:hover,
.section-selector-active .prose li:hover,
.section-selector-active .prose table:hover,
.section-selector-active .prose blockquote:hover {
  background: var(--color-neutral-light-gray, #f0f0f0);
}

/* 차트 영역은 호버 효과 제외 */
.section-selector-active .prose .chart-container,
.section-selector-active .prose canvas {
  cursor: default;
  pointer-events: none;
}

.section-selector-active .prose .chart-container:hover {
  background: transparent;
}
