/**
 * Blog / Notes Page Styles
 * 
 * Features:
 * - List view with card-based layout
 * - 3D Graph view container
 * - Dual view (both) layout
 * - Search and filter controls
 * - Modal for Thought Session preview
 * - Responsive breakpoints
 * - Accessibility: focus states, reduced motion
 * - Fixed media controls
 */

/* ==========================================================================
   Media Controls (Fixed Bottom Center)
   ========================================================================== */

.media-controls {
  display: none;
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  align-items: center;
  gap: 0.5rem;
}

.media-controls-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.media-control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
  padding: 0;
}

.media-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(190, 255, 242, 0.5);
  transform: scale(1.05);
}

.media-control-btn:active {
  transform: scale(0.95);
}

.media-control-btn svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Blog Section Container
   ========================================================================== */

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.page-wrapper {
  overflow-x: hidden;
  max-width: 100vw;
}

.main-wrapper {
  overflow-x: hidden;
  max-width: 100vw;
}

.section_blog {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  max-width: 100%;
}

.padding-global {
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
  padding-left: clamp(1rem, 4vw, 1.5rem);
  padding-right: clamp(1rem, 4vw, 1.5rem);
}

.container-large {
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Ensure padding-section doesn't cause overflow */
.padding-section-large {
  box-sizing: border-box;
}

/* ==========================================================================
   Blog Header
   ========================================================================== */

.blog_header {
  margin-bottom: 3rem;
}

.blog_header-content {
  margin-bottom: 2rem;
}

.blog_description {
  max-width: 600px;
  color: var(--text-color-muted, #888);
}

.blog_auth-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Subtle collaborator sign-in button - hidden in corner */
.blog_collaborator-access {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
}

.blog_collaborator-signin-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  opacity: 0.4;
}

.blog_collaborator-signin-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  opacity: 1;
  transform: scale(1.1);
}

.blog_sign-out-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_sign-out-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ==========================================================================
   Blog Controls (Search + View Toggle)
   ========================================================================== */

.blog_controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Search Input */
.blog_search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.blog_search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 0.875rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.blog_search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.blog_search-input:focus {
  outline: none;
  border-color: var(--primary-color, #BEFFF2);
  background: rgba(255, 255, 255, 0.08);
}

.blog_search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* View Toggle Buttons */
.blog_view-toggle {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem;
  border-radius: 4px;
}

.blog_view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.blog_view-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.blog_view-btn.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.blog_view-btn:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

.blog_view-btn svg {
  flex-shrink: 0;
}

/* Hide "Both" button on mobile */
.blog_view-btn--both {
  display: none;
}

@media (min-width: 1024px) {
  .blog_view-btn--both {
    display: flex;
  }
}

/* ==========================================================================
   Sort Controls
   ========================================================================== */

.blog_sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog_sort-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.blog_sort-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.blog_sort-select:focus {
  border-color: var(--primary-color, #BEFFF2);
}

/* Clear Filters Button */
.blog_clear-filters-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  white-space: nowrap;
}

.blog_clear-filters-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.blog_clear-filters-btn:focus {
  border-color: var(--primary-color, #BEFFF2);
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

/* ==========================================================================
   Tag Filters
   ========================================================================== */

.blog_tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog_tag-btn {
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_tag-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.blog_tag-btn.is-active {
  background: var(--primary-color, #BEFFF2);
  border-color: var(--primary-color, #BEFFF2);
  color: #fff;
}

.blog_tag-btn:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

/* ==========================================================================
   Author Filters
   ========================================================================== */

.blog_authors-filter {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog_filter-section-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
}

.blog_author-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog_author-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_author-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.blog_author-btn.is-active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-color, #BEFFF2);
  color: var(--primary-color, #BEFFF2);
}

.blog_author-btn:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

.blog_filter-empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.875rem;
  font-style: italic;
  margin: 0;
}

/* ==========================================================================
   Blog Content Area
   ========================================================================== */

.blog_content {
  display: grid;
  gap: 2rem;
  min-height: 500px;
}

/* Desktop: Split View (both visible side-by-side) */
@media (min-width: 1024px) {
  .blog_content {
    grid-template-columns: 1fr 1fr;
    display: grid;
    gap: 2rem;
  }
  
  /* Force both views to be visible on desktop, even if hidden attribute is present */
  .blog_content .blog_list-view,
  .blog_content .blog_graph-view {
    display: block !important;
    visibility: visible !important;
  }
  
  /* Remove hidden attribute styling on desktop */
  .blog_content .blog_list-view[hidden],
  .blog_content .blog_graph-view[hidden] {
    display: block !important;
    visibility: visible !important;
  }
  
  /* Ensure both views take equal space */
  .blog_content .blog_list-view {
    min-height: 77svh;
    overflow-y: auto;
  }
  
  .blog_content .blog_graph-view {
    min-height: 77svh;
    position: relative;
  }
  
  /* Hide view toggle buttons on desktop */
  .blog_view-toggle {
    display: none;
  }
}

/* Mobile: Toggle View (one at a time) */
@media (max-width: 1023px) {
  .blog_content {
    grid-template-columns: 1fr;
  }
  
  /* List view - single column, continuous scroll */
  .blog_content[data-view="list"] .blog_list-view {
    display: block;
    width: 100%;
  }
  .blog_content[data-view="list"] .blog_graph-view {
    display: none !important;
  }
  
  /* Mind map view - full width, max 60vh */
  .blog_content[data-view="mind-map"] .blog_list-view,
  .blog_content[data-view="graph"] .blog_list-view {
    display: none !important;
  }
  .blog_content[data-view="mind-map"] .blog_graph-view,
  .blog_content[data-view="graph"] .blog_graph-view {
    display: block;
    width: 100%;
    max-height: 60vh;
    overflow: hidden;
  }
  
  /* Ensure list is single column on mobile with continuous scroll */
  .blog_content[data-view="list"] .blog_list-view {
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .blog_list {
    grid-template-columns: 1fr !important;
    display: grid;
    gap: 1rem;
    padding: 1rem 0;
    width: 100%;
  }
  
  /* Mind map container height constraint on mobile */
  .blog_content[data-view="mind-map"] .blog_graph-layout,
  .blog_content[data-view="graph"] .blog_graph-layout {
    max-height: 60vh;
    overflow: hidden;
  }
  
  .blog_content[data-view="mind-map"] .blog_graph-main,
  .blog_content[data-view="graph"] .blog_graph-main {
    max-height: 60vh;
    overflow: hidden;
  }
  
  .blog_content[data-view="mind-map"] .blog_graph-container,
  .blog_content[data-view="graph"] .blog_graph-container {
    max-height: 60vh;
    height: 60vh;
  }
}

/* ==========================================================================
   List View
   ========================================================================== */

.blog_list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Blog Card */
.blog_card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.blog_card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.blog_card:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

.blog_card.is-highlighted {
  background: rgba(190, 255, 242, 0.1);
  border-color: var(--primary-color, #BEFFF2);
}

.blog_card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.blog_card-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.blog_card-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.blog_card-excerpt {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog_card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.blog_card-tag {
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.blog_card-links-count {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.blog_card-links-count svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Graph View (Hidden - kept for structure)
   ========================================================================== */

.blog_graph-view {
  display: none; /* Hidden by default, shown when data-view="graph" */
}

/* ==========================================================================
   Graph Modal (Full-Screen)
   ========================================================================== */

.blog_graph-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog_graph-modal[hidden] {
  display: none !important;
}

.blog_graph-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.blog_graph-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 1;
  pointer-events: auto;
}

.blog_graph-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1002;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
}

.blog_graph-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: scale(1.05);
}

.blog_graph-modal-close:focus-visible {
  outline: 2px solid #BEFFF2;
  outline-offset: 2px;
}

/* Graph Layout with Sidebar */
.blog_graph-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 500px;
  position: relative;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Sidebar positioning - overlay on all screens when visible */
.blog_graph-sidebar:not([hidden]) {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: min(85vw, 280px);
  z-index: 200;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Adjust graph main when sidebar is visible */
.blog_graph-layout.sidebar-visible .blog_graph-main {
  margin-left: 280px;
}

@media (max-width: 767px) {
  .blog_graph-layout.sidebar-visible .blog_graph-main {
    margin-left: 0;
  }
  
  .blog_graph-sidebar:not([hidden]) {
    width: min(280px, 85vw);
    max-width: min(85vw, 280px);
  }
}

/* Ensure graph layout doesn't overflow */
.blog_graph-layout {
  max-width: 100%;
  overflow-x: hidden;
}

.blog_graph-view {
  max-width: 100%;
  overflow-x: hidden;
  height: 100%;
  min-height: 77svh;
}

/* Ensure graph layout fills container on desktop */
@media (min-width: 1024px) {
  .blog_graph-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 77svh;
  }
  
  .blog_graph-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  
  .blog_graph-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  
  .blog_graph-container {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden; /* Ensure canvas stays within container */
  }
  
  /* Ensure canvas stays within graph container */
  .blog_graph-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
  }
}

.blog_content {
  max-width: 100%;
  overflow-x: hidden;
}

.blog_graph-sidebar {
  width: 280px;
  min-width: 280px;
  background: rgba(20, 20, 30, 0.8);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 100;
}

/* Ensure sidebar is visible when not hidden */
.blog_graph-sidebar:not([hidden]) {
  display: flex !important;
}

/* Hide sidebar when hidden attribute is present */
.blog_graph-sidebar[hidden] {
  display: none !important;
}

.blog_graph-sidebar-header {
  margin-bottom: 0.5rem;
}

.blog_graph-sidebar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.blog_graph-sidebar-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1rem;
}

.blog_graph-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.blog_graph-section-toggle:hover {
  color: #fff;
}

.blog_graph-section-icon {
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: rgba(255, 255, 255, 0.6);
}

.blog_graph-section-toggle[aria-expanded="true"] .blog_graph-section-icon {
  transform: rotate(0deg);
}

.blog_graph-section-toggle[aria-expanded="false"] .blog_graph-section-icon {
  transform: rotate(-90deg);
}

.blog_graph-section-content {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog_graph-search-wrapper {
  margin-bottom: 0.5rem;
}

.blog_graph-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.blog_graph-search-input:focus {
  outline: none;
  border-color: rgba(190, 255, 242, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.blog_graph-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.blog_graph-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog_graph-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.blog_graph-toggle input[type="checkbox"] {
  display: none;
}

.blog_graph-toggle-slider {
  position: relative;
  width: 40px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: background 0.3s;
  flex-shrink: 0;
}

.blog_graph-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  top: 2px;
  left: 2px;
  transition: transform 0.3s, background 0.3s;
}

.blog_graph-toggle input[type="checkbox"]:checked + .blog_graph-toggle-slider {
  background: rgba(93, 173, 226, 0.6);
}

.blog_graph-toggle input[type="checkbox"]:checked + .blog_graph-toggle-slider::before {
  transform: translateX(20px);
  background: #BEFFF2;
}

.blog_graph-toggle-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.blog_graph-button {
  padding: 0.5rem 1rem;
  background: rgba(93, 173, 226, 0.2);
  border: 1px solid rgba(93, 173, 226, 0.4);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_graph-button:hover {
  background: rgba(93, 173, 226, 0.3);
  border-color: rgba(93, 173, 226, 0.6);
  color: #fff;
}

.blog_graph-button:focus-visible {
  outline: 2px solid #BEFFF2;
  outline-offset: 2px;
}

.blog_graph-toggle:hover .blog_graph-toggle-label {
  color: #fff;
}

.blog_graph-slider-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog_graph-slider-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog_graph-slider-label span {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.blog_graph-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.blog_graph-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BEFFF2;
  cursor: pointer;
  transition: background 0.2s;
}

.blog_graph-slider::-webkit-slider-thumb:hover {
  background: #7DB8E8;
}

.blog_graph-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BEFFF2;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.blog_graph-slider::-moz-range-thumb:hover {
  background: #7DB8E8;
}

.blog_graph-color-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog_graph-color-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.blog_graph-color-label span {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.blog_graph-color-input {
  width: 50px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
  background: transparent;
}

.blog_graph-color-input:hover {
  border-color: rgba(190, 255, 242, 0.5);
}

.blog_graph-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog_graph-select-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog_graph-select-label span {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.blog_graph-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_graph-select:focus {
  outline: none;
  border-color: rgba(190, 255, 242, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* Legend */
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #e6e6e6;
  font-size: 13px;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-block;
}
.legend-label {
  flex: 1;
}

.blog_graph-select option {
  background: rgba(20, 20, 30, 0.98);
  color: #fff;
}

.blog_graph-main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Graph control buttons when directly in blog_graph-main */
.blog_graph-main > .blog_graph-control-btn {
  position: absolute;
  top: 1rem;
  z-index: 10;
}

.blog_graph-main > .blog_graph-control-btn:first-of-type {
  right: calc(1rem + 140px); /* Position first button (settings) to the left */
}

.blog_graph-main > .blog_graph-control-btn:nth-of-type(2) {
  right: calc(1rem + 70px); /* Position second button (reset) in middle */
}

.blog_graph-main > .blog_graph-control-btn:nth-of-type(3) {
  right: 1rem; /* Position third button (fit) at right */
}

.blog_graph-container {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 500px;
  max-width: 100%;
  overflow: hidden; /* Changed from overflow-x: hidden to overflow: hidden */
  box-sizing: border-box;
  position: relative; /* Ensure canvas positioning is relative to this container */
}

/* Graph Placeholder */
.blog_graph-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.blog_graph-placeholder-content {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
}

.blog_graph-placeholder p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.blog_graph-hint {
  font-size: 0.75rem !important;
  opacity: 0.6;
}

/* Graph Controls */
.blog_graph-controls {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
}

.blog_graph-control-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.blog_graph-control-label {
  display: inline-block;
}

@media (max-width: 767px) {
  .blog_graph-control-label {
    display: none;
  }
  
  /* Keep Settings label visible on mobile */
  #graph-settings-toggle .blog_graph-control-label {
    display: inline-block;
  }
  
  .blog_graph-control-btn {
    padding: 0.5rem;
    min-width: 44px;
    justify-content: center;
  }
  
  /* Settings button needs more width on mobile to accommodate text */
  #graph-settings-toggle {
    min-width: auto;
    padding: 0.5rem 0.75rem;
  }
}

.blog_graph-control-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

.blog_graph-control-btn:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.blog_loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: rgba(255, 255, 255, 0.5);
  grid-column: 1 / -1;
}

.blog_loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color, #BEFFF2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.blog_empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.blog_empty p {
  margin: 1rem 0;
}

.blog_empty-reset {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_empty-reset:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   No Notes Message (Graph View)
   ========================================================================== */

.blog_no-notes-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  width: 100%;
  padding: 2rem;
}

.blog_no-notes-content {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.blog_no-notes-content svg {
  margin: 0 auto 1.5rem;
  display: block;
  color: rgba(255, 255, 255, 0.3);
}

.blog_no-notes-content h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.75rem 0;
}

.blog_no-notes-content p {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* ==========================================================================
   Graph Unavailable Notice
   ========================================================================== */

.blog_graph-unavailable {
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.blog_modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.blog_modal[hidden] {
  display: none;
}

.blog_modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.blog_modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  cursor: default;
  z-index: 1;
}

.blog_modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog_modal-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: #fff;
  margin: 0;
  padding-right: 1rem;
}

.blog_modal-close {
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s;
}

.blog_modal-close:hover {
  color: #fff;
}

.blog_modal-close:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

.blog_modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: calc(80vh - 120px);
  overflow: hidden;
}

.blog_modal-content-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  margin-bottom: 1.5rem;
  max-height: 50vh;
}

.blog_modal-content-scrollable::-webkit-scrollbar {
  width: 8px;
}

.blog_modal-content-scrollable::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.blog_modal-content-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.blog_modal-content-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.blog_modal-content-scrollable p,
.blog_modal-content-scrollable h1,
.blog_modal-content-scrollable h2,
.blog_modal-content-scrollable h3,
.blog_modal-content-scrollable h4,
.blog_modal-content-scrollable h5,
.blog_modal-content-scrollable h6,
.blog_modal-content-scrollable ul,
.blog_modal-content-scrollable ol,
.blog_modal-content-scrollable pre,
.blog_modal-content-scrollable code {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.blog_modal-content-scrollable h1,
.blog_modal-content-scrollable h2,
.blog_modal-content-scrollable h3 {
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.blog_modal-content-scrollable code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875em;
}

.blog_modal-content-scrollable pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.blog_modal-content-scrollable pre code {
  background: transparent;
  padding: 0;
}

/* Message rendering styles */
.blog-message {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-message:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.blog-message-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.blog-message-date {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.blog-message-content {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.blog-message-content p {
  margin-bottom: 0.75rem;
}

.blog-message-content p:last-child {
  margin-bottom: 0;
}

.blog-message-content a {
  color: #BEFFF2;
  text-decoration: underline;
}

.blog-message-content a:hover {
  color: #85C1E9;
}

.blog-message-attachments {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-attachment-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.blog-attachment-audio,
.blog-attachment-video {
  width: 100%;
}

.blog-attachment-audio audio,
.blog-attachment-video video {
  width: 100%;
}

.blog-view-transcript-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(93, 173, 226, 0.1);
  border: 1px solid rgba(93, 173, 226, 0.3);
  border-radius: 6px;
  color: #BEFFF2;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.blog-view-transcript-btn:hover {
  background: rgba(93, 173, 226, 0.2);
  border-color: rgba(190, 255, 242, 0.5);
}

/* PDF-like Transcript Modal */
.blog-transcript-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-transcript-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 0;
  cursor: pointer; /* Show pointer cursor to indicate clickable */
}

.blog-transcript-modal-container {
  position: relative;
  width: 90vw;
  max-width: 900px;
  height: 90vh;
  max-height: 800px;
  background: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto; /* Ensure container can receive clicks */
  z-index: 1;
}

.blog-transcript-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #252525;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.blog-transcript-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-transcript-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.blog-transcript-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-transcript-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-transcript-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 1);
}

.blog-transcript-document-container {
  flex: 1;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.blog-transcript-document {
  width: 100%;
  max-width: 700px;
  background: #ffffff;
  color: #1a1a1a;
  padding: 3rem 4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.125rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.blog-transcript-document::-webkit-scrollbar {
  width: 10px;
}

.blog-transcript-document::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.blog-transcript-document::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 5px;
}

.blog-transcript-document::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.blog-transcript-document p {
  margin: 0 0 1.5rem 0;
  text-align: justify;
  text-indent: 0;
}

.blog-transcript-document p:last-child {
  margin-bottom: 0;
}

.blog-transcript-document h1,
.blog-transcript-document h2,
.blog-transcript-document h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.blog-transcript-document h1:first-child,
.blog-transcript-document h2:first-child,
.blog-transcript-document h3:first-child {
  margin-top: 0;
}

.blog-transcript-document a {
  color: #2563eb;
  text-decoration: underline;
}

.blog-transcript-document code {
  background: #f5f5f5;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Menlo', monospace;
}

.blog-transcript-document pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.blog-transcript-document blockquote {
  border-left: 4px solid #e5e5e5;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: #666;
  font-style: italic;
}

.blog-transcript-formatted {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.blog-transcript-formatted p {
  margin-bottom: 1.5rem;
}

.blog-transcript-formatted p:last-child {
  margin-bottom: 0;
}

.blog-transcription {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.blog-message-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.blog-message-tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.blog_keyword-highlight {
  background: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-weight: 500;
}

.blog_modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.blog_modal-date {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.blog_modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog_modal-tag {
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.blog_modal-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
}

.blog_modal-links h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.75rem;
}

.blog_modal-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog_modal-link {
  padding: 0.375rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 4px;
  color: var(--primary-color, #BEFFF2);
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_modal-link:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Related Notes Section
   ========================================================================== */

.blog_modal-related {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blog_modal-related-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog_modal-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.blog_related-note-tile {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.blog_related-note-tile:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.blog_related-note-tile:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

.blog_related-note-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.blog_related-note-excerpt {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.5rem 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog_related-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.blog_related-note-tag {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.blog_keyword-highlight {
  background: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-weight: 500;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 767px) {
  .blog_controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .blog_search-wrapper {
    max-width: none;
  }
  
  .blog_view-toggle {
    justify-content: center;
  }
  
  /* List view - single column, continuous scroll */
  .blog_list {
    grid-template-columns: 1fr !important;
    display: grid;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  /* Mind map on mobile - max 60vh, full width */
  .blog_graph-view {
    max-height: 60vh;
    min-height: auto;
    width: 100%;
  }
  
  .blog_graph-layout {
    max-height: 60vh;
    overflow: hidden;
  }
  
  .blog_graph-main {
    max-height: 60vh;
    overflow: hidden;
  }
  
  .blog_graph-container {
    max-height: 60vh;
    height: 60vh;
    min-height: auto;
  }
  
  .blog_modal-related-list {
    grid-template-columns: 1fr;
  }
  
  .blog_modal-content-scrollable {
    max-height: 40vh;
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .blog_card {
    transition: none;
  }
  
  .blog_card:hover {
    transform: none;
  }
  
  .blog_loading-spinner {
    animation: none;
  }
  
  .blog_view-btn,
  .blog_tag-btn,
  .blog_author-btn,
  .blog_graph-control-btn,
  .blog_modal-close,
  .blog_search-input {
    transition: none;
  }
}

/* ==========================================================================
   Focus Within for Accessibility
   ========================================================================== */

.blog_card:focus-within {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .blog_graph-view,
  .blog_view-toggle,
  .blog_search-wrapper,
  .blog_tags-filter,
  .blog_authors-filter {
    display: none !important;
  }
  
  .blog_content {
    display: block !important;
  }
  
  .blog_card {
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   Edit Modal & Form
   ========================================================================== */

.blog_edit-form {
  padding: 1.5rem;
}

.blog_edit-field {
  margin-bottom: 1.5rem;
}

.blog_edit-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.blog_edit-input,
.blog_edit-textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.blog_edit-input:focus,
.blog_edit-textarea:focus {
  outline: none;
  border-color: var(--primary-color, #BEFFF2);
  background: rgba(255, 255, 255, 0.08);
}

.blog_edit-textarea {
  resize: vertical;
  min-height: 200px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  line-height: 1.6;
}

.blog_edit-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blog_edit-btn-cancel,
.blog_edit-btn-save {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.blog_edit-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.blog_edit-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.blog_edit-btn-save {
  background: var(--primary-color, #BEFFF2);
  color: #fff;
}

.blog_edit-btn-save:hover {
  background: var(--primary-color-hover, #A8FFE8);
}

.blog_edit-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Card Action Buttons
   ========================================================================== */

.blog_card-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.blog_edit-btn,
.blog_delete-btn {
  padding: 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog_edit-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
}

.blog_delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.blog_edit-btn:focus-visible,
.blog_delete-btn:focus-visible {
  outline: 2px solid var(--primary-color, #BEFFF2);
  outline-offset: 2px;
}

/* ==========================================================================
   Mind Map Settings Modal
   ========================================================================== */

.blog_mindmap-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.blog_mindmap-modal[hidden] {
  display: none !important;
}

.blog_mindmap-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.blog_mindmap-modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}

.blog_mindmap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.blog_mindmap-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.blog_mindmap-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s;
  padding: 0;
}

.blog_mindmap-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.blog_mindmap-modal-close:focus-visible {
  outline: 2px solid #BEFFF2;
  outline-offset: 2px;
}

.blog_mindmap-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .blog_mindmap-modal {
    padding: 0;
  }
  
  .blog_mindmap-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .blog_mindmap-modal-header {
    padding: 1rem;
  }
  
  .blog_mindmap-modal-body {
    padding: 1rem;
  }
}

/* Hide sidebar when using modal */
.blog_graph-sidebar {
  display: none !important;
}

/* Ensure graph main takes full width */
.blog_graph-main {
  width: 100%;
}
