/**
 * Mode Container Styles
 * Handles visibility and transitions between different app modes
 */

/* Multi-mode layout */
.multi-mode-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Content row with sidebar and main content */
.content-row {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Mode containers */
.mode-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.mode-container.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
  position: relative;
}

.mode-container.hidden {
  opacity: 0;
  transform: translateX(-20px);
  z-index: 0;
  pointer-events: none;
}

/* Bottom toolbar */
.bottom-toolbar-container {
  display: flex;
  height: calc(var(--toolbar-height) + var(--toolbar-margin) * 2);
  background: var(--dark-blue);
  border-top: none;
}

.mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: var(--toolbar-height);
  padding: 0 20px;
  margin: var(--toolbar-margin);
  background: var(--header-blue);
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.mode-toolbar.active {
  opacity: 1;
}

.mode-toolbar.hidden {
  display: none;
}

/* Zoom Control (shared across modes) */
.zoom-control {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-left: 16px;
}

.zoom-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.zoom-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.zoom-control span:not(.zoom-btn span) {
  color: white;
  font-size: 12px;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

/* Show border and pointer only when zoom can be reset (not at 100%) */
.zoom-control span:not(.zoom-btn span).can-reset {
  cursor: pointer;
  border-color: rgba(255, 255, 255, 0.2);
}

.zoom-control span:not(.zoom-btn span).can-reset:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* View Toggle (shared across modes) */
.view-toggle-group {
  display: flex;
  gap: 0;
  background: var(--header-blue-40);
  border-radius: 6px;
  padding: 3px;
}

.view-toggle-segment {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.view-toggle-segment:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.view-toggle-segment.active {
  background: white;
  color: #333;
  font-weight: 600;
}

/* Sidebar base styles */
.nav-sidebar {
  width: var(--sidebar-width);
  background: var(--header-blue);
  overflow-y: auto;
  flex-shrink: 0;
}

/* Main content base styles */
.main-content {
  flex: 1;
  background: #f5f5f5;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Resources Mode Layout */
.resources-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--header-blue);
}

.resources-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.resources-sidebar-header h3 {
  color: white;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.resources-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.resources-content {
  display: flex;
  flex-direction: column;
  position: relative;
}

.resources-iframe-container {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.resources-iframe-container.active {
  display: flex;
}

.resources-link-bar {
  background: var(--dark-blue);
  padding: 8px 16px;
  flex-shrink: 0;
}

.resources-link-bar a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.resources-link-bar a:hover {
  text-decoration: underline;
}

.resources-link-bar a::after {
  content: '\2197';
  font-size: 12px;
}

#resources-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

#resources-iframe.hidden {
  display: none;
}

.resources-external-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  padding: 40px;
}

.resources-external-card.hidden {
  display: none;
}

.external-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 60px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.external-card-link:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.external-card-link .card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark-blue);
  text-align: center;
}

.external-card-link .card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--dark-blue);
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.external-card-link .card-action::after {
  content: '\2197';
  font-size: 12px;
}

.resources-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  font-size: 16px;
}

.resources-placeholder.hidden {
  display: none;
}

/* Teach Mode Layout */
.teach-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Teach Bookmarks Wrapper */
.teach-bookmarks-wrapper {
  flex: 1;
  background: var(--dark-blue);
  padding: 30px 60px;
  display: flex;
  min-height: 0;
}

.teach-bookmarks-wrapper community-bookmarks-list {
  background: white;
  display: block;
  border-radius: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Calendar Mode Layout */
.calendar-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Calendar Mode Toolbar */
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 16px 50px;
  background: var(--header-blue);
  flex-shrink: 0;
}

/* Calendar Mode Toggle Group */
.calendar-toggle-group {
  display: flex;
  gap: 0;
  background: var(--header-blue-40);
  border-radius: 8px;
  padding: 4px;
}

.calendar-toggle-segment {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 140px;
  text-align: center;
}

.calendar-toggle-segment:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.calendar-toggle-segment.active {
  background: white;
  color: #333;
}

.calendar-toggle-segment:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.calendar-toggle-segment:disabled:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
}

/* Calendar Bookmarks Wrapper */
.calendar-bookmarks-wrapper {
  flex: 1;
  background: var(--dark-blue);
  padding: 30px 60px;
  display: flex;
  min-height: 0;
}

.calendar-bookmarks-wrapper community-bookmarks-list {
  background: white;
  display: block;
  border-radius: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Calendar Subscribe Button */
.calendar-subscribe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-subscribe-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.calendar-subscribe-btn.active {
  background: white;
  color: var(--header-blue);
}

.calendar-subscribe-btn svg {
  width: 20px;
  height: 20px;
}

/* Calendar Subscribe Dropdown */
.calendar-subscribe-dropdown {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.calendar-subscribe-dropdown:not(.hidden) {
  max-height: 600px;
  opacity: 1;
  padding: 0 50px 20px 50px;
}

.calendar-subscribe-dropdown.hidden {
  display: none;
}

.calendar-subscribe-dropdown calendar-subscription {
  display: block;
}

/* Customize Mode Layout */
.customize-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Customize Mode Toolbar */
.customize-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px;
  background: var(--header-blue);
  flex-shrink: 0;
  gap: 16px;
  position: relative;
}

/* Bookmark nav in toolbar - hidden by default, shown for Phrase Colors tab */
.customize-toolbar .phrase-bookmark-nav {
  display: none;
  /* Center over the preview area (right of sidebar) */
  position: absolute;
  left: var(--sidebar-width);
  right: 0;
  justify-content: center;
}

.customize-toolbar .phrase-bookmark-nav.visible {
  display: flex;
}

/* Customize Mode Toggle Group */
.customize-toggle-group {
  display: flex;
  gap: 0;
  background: var(--header-blue-40);
  border-radius: 8px;
  padding: 4px;
}

.customize-toggle-segment {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 140px;
  text-align: center;
}

.customize-toggle-segment:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.customize-toggle-segment.active {
  background: white;
  color: #333;
}

/* Customize Content Wrapper */
.customize-content-wrapper {
  flex: 1;
  background: var(--dark-blue);
  padding: 0;
  display: flex;
  min-height: 0;
}

/* Customize Placeholder */
.customize-placeholder {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  color: #666;
  font-size: 16px;
}

/* Customize Tab Panels */
.customize-tab-panel {
  display: none;
  background: white;
  border-radius: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.customize-tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* Avatar Upload Container */
.avatar-upload-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

/* Avatar Upload Section */
.avatar-upload-section {
  margin-bottom: 20px;
}

.avatar-drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafafa;
}

.avatar-drop-zone:hover,
.avatar-drop-zone.dragover {
  border-color: #667eea;
  background: #f0f4ff;
}

.avatar-drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.avatar-drop-zone-text {
  color: #666;
  margin-bottom: 16px;
}

.avatar-drop-zone-text strong {
  color: #667eea;
}

.avatar-file-input {
  display: none;
}

.avatar-browse-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.avatar-browse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Avatar Cropper Section */
.avatar-cropper-section {
  display: none;
  margin-bottom: 20px;
}

.avatar-cropper-section.active {
  display: block;
}

.avatar-cropper-section h2 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 18px;
}

.avatar-cropper-container-wrapper {
  max-height: 400px;
  margin-bottom: 20px;
}

#avatar-image-to-crop {
  max-width: 100%;
  display: block;
}

.avatar-cropper-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.avatar-cropper-controls button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.avatar-cropper-controls button:hover {
  background: #f0f0f0;
  border-color: #bbb;
}

/* Avatar Preview Section */
.avatar-preview-section {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.avatar-preview-label {
  font-weight: 500;
  color: #666;
}

.avatar-preview-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #667eea;
  background: #f0f0f0;
}

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

.avatar-preview-circle.avatar-preview-large {
  width: 120px;
  height: 120px;
}

/* Avatar Action Buttons */
.avatar-action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.avatar-action-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.avatar-action-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.avatar-action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.avatar-action-btn.secondary {
  background: #f0f0f0;
  color: #333;
}

.avatar-action-btn.secondary:hover {
  background: #e0e0e0;
}

.avatar-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Avatar Status Messages */
.avatar-status {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  display: none;
}

.avatar-status.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.avatar-status.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.avatar-status.info {
  display: block;
  background: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

/* Avatar Result Section */
.avatar-result-section {
  display: none;
  margin-bottom: 20px;
}

.avatar-result-section.active {
  display: block;
}

.avatar-result-section h2 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 18px;
}

.avatar-result-info {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.avatar-result-info code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Cropper.js circular mask override for avatar */
.avatar-cropper-section .cropper-view-box,
.avatar-cropper-section .cropper-face {
  border-radius: 50%;
}

/* ===========================
   Avatar Modal Styles
   =========================== */

.avatar-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.avatar-modal-overlay.active {
  display: flex;
}

.avatar-modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.2s ease-out;
}

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

.avatar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.avatar-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.avatar-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #666;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.avatar-modal-close:hover {
  color: #333;
}

.avatar-modal-content {
  padding: 24px;
}

/* Adjust avatar styles for modal context */
.avatar-modal .avatar-drop-zone {
  padding: 30px;
}

.avatar-modal .avatar-cropper-container-wrapper {
  max-height: 300px;
  margin-bottom: 16px;
}

.avatar-modal .avatar-cropper-controls {
  justify-content: center;
}

.avatar-modal .avatar-cropper-controls {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.avatar-modal .avatar-cropper-controls button {
  background-color: #7889C5;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.avatar-modal .avatar-cropper-controls button:hover {
  background-color: #5a6ba8;
}

.avatar-modal .avatar-cropper-controls button:active {
  background-color: #4a5a98;
}

.avatar-modal .avatar-preview-section {
  justify-content: center;
  padding-top: 16px;
}

.avatar-modal .avatar-action-buttons {
  justify-content: center;
  margin-top: 16px;
}

/* ===========================
   My Info Tab Styles
   =========================== */

.my-info-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 32px;
  width: 100%;
}

/* Avatar Preview Section */
.my-info-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.my-info-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #4E619B;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  border: 3px solid #667eea;
}

.my-info-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-info-avatar-initials {
  color: white;
  font-size: 32px;
  font-weight: 600;
}

.my-info-change-avatar-btn {
  background: transparent;
  color: #667eea;
  border: 1px solid #667eea;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.my-info-change-avatar-btn:hover {
  background: #667eea;
  color: white;
}

/* Form Section */
.my-info-form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.my-info-form-row {
  display: flex;
  gap: 20px;
}

.my-info-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.my-info-field.full-width {
  flex: 1;
}

.my-info-field label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.my-info-field input {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.my-info-field input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.my-info-field input:disabled {
  background: #f5f5f5;
  color: #666;
  cursor: not-allowed;
}

.my-info-readonly-value {
  padding: 12px 14px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 15px;
  color: #666;
}

/* Actions */
.my-info-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.my-info-save-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.my-info-save-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.my-info-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Status Messages */
.my-info-status {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
}

.my-info-status.success {
  background: #d4edda;
  color: #155724;
}

.my-info-status.error {
  background: #f8d7da;
  color: #721c24;
}

.my-info-status.info {
  background: #cce5ff;
  color: #004085;
}

/* Responsive */
@media (max-width: 600px) {
  .my-info-container {
    padding: 20px;
  }

  .my-info-form-row {
    flex-direction: column;
  }
}

/* ===========================
   Phrase Colors Tab Styles
   =========================== */

.phrase-colors-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--dark-blue);
  overflow: hidden;
}

/* Fixed Header Row */
.phrase-colors-header-row {
  display: flex;
  flex-shrink: 0;
  background: var(--dark-blue);
}

.phrase-colors-settings-header {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background-color: var(--header-blue);
  padding: 10px;
  box-sizing: border-box;
}

/* Content Area - sidebar and preview scroll independently */
.phrase-colors-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.phrase-colors-settings {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background-color: var(--header-blue);
  color: white;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
}

.phrase-colors-preview {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  background: var(--dark-blue);
  padding: 10px;
  overflow-y: auto;
}

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

.phrase-colors-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.phrase-colors-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.phrase-colors-btn.primary {
  background: var(--sidebar-accent-blue);
  border-color: var(--sidebar-accent-blue);
  color: #222;
}

.phrase-colors-btn.primary:hover {
  background: #b9c7f5;
  border-color: #b9c7f5;
}

/* Phrase Colors List */
.phrase-colors-list {
  flex: 1;
  overflow-y: auto;
  padding: 5px 10px 10px 10px;
  background: transparent;
}

.phrase-color-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
  gap: 10px;
}

.phrase-color-name {
  flex: 1;
  font-size: 15px;
  color: #ccc;
}

/* Color Dropdown */
.phrase-color-dropdown {
  position: relative;
}

.phrase-color-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
}

.phrase-color-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.phrase-color-trigger .phrase-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.phrase-color-name {
  color: #ccc;
  font-size: 13px;
  min-width: 90px;
  text-align: left;
}

.phrase-color-chevron {
  color: #888;
  font-size: 12px;
  margin-left: auto;
}

.phrase-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}

.phrase-color-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
  min-width: 160px;
  max-height: 340px;
  overflow-y: auto;
}

.phrase-color-dropdown.open .phrase-color-menu {
  display: block;
}

.phrase-color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

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

.phrase-color-option.selected {
  background: #e3f2fd;
}

.phrase-color-option .phrase-color-swatch {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.phrase-color-option .phrase-color-swatch.rainbow {
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

.phrase-color-option-name {
  flex: 1;
  color: #333;
}

.phrase-color-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Bookmark selector with navigation */
.phrase-bookmark-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phrase-bookmark-select {
  flex: 0 1 auto;
  min-width: 180px;
  max-width: 300px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

.phrase-bookmark-select:focus {
  outline: none;
  border-color: var(--link-blue, #7889C5);
  box-shadow: 0 0 0 2px rgba(120, 137, 197, 0.3);
}

.phrase-bookmark-select option {
  background: #2a3a6a;
  color: white;
  padding: 8px;
}

.phrase-nav-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
}

.phrase-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.phrase-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
}

.phrase-preview-wrapper {
  container-type: inline-size;
  container-name: tikkun-area;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.phrase-preview-wrapper .tikkun-container {
  background: white;
  border-radius: 8px;
}

/* Phrase highlighting in preview */
.phrase-preview-wrapper [phrase-group] {
  border-radius: 3px;
  padding: 0 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .phrase-colors-settings-header {
    width: 100%;
    flex: none;
  }
  .phrase-colors-content {
    flex-direction: column;
  }
  .phrase-colors-settings {
    width: 100%;
    flex: none;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-sidebar {
    position: absolute;
    left: -320px;
    transition: left 0.3s ease;
    z-index: 100;
    height: 100%;
  }

  .nav-sidebar.open {
    left: 0;
  }

  .bottom-toolbar-container {
    height: auto;
    padding: 8px;
  }
}

/* ===========================
   Chat Mode Styles
   =========================== */

.chat-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background: var(--dark-blue);
  box-sizing: border-box;
}

.chat-content chatbot-panel {
  width: 100%;
  max-width: 600px;
  height: 80%;
  max-height: 700px;
}
