/* 3PaneApp Styles - Core Framework & Basic UI */

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

body {
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== APP WRAPPER ===== */

.threepane-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===== HEADER ===== */

.threepane-header {
  background-color: #5a5a5a;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  padding: calc(40px * var(--header-height-factor, 1)) 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
  position: relative;
  --header-height-factor: 1;
}

/* Semi-transparent overlay for text readability */
.threepane-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 1;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.header-logo {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  background: white;
  padding: 8px;
}

.header-text {
  flex: 1;
}

.header-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 5px;
}

.header-subtitle {
  font-size: 16px;
  opacity: 0.95;
}

/* ===== NAVBAR (PAGES NAVIGATION) ===== */

.navbar {
  display: flex;
  gap: 0;
  background: white;
  border-bottom: 2px solid #888;
  padding: 0;
  overflow-x: auto;
}

.navbar.borderless {
  background: transparent;
  border-bottom: none;
}

.nav-link {
  flex: 1;
  min-width: 120px;
  padding: 16px 20px;
  border: none;
  background: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.nav-link:hover {
  background: #f5f5f5;
  color: #666;
}

.nav-link.active {
  color: #555;
  border-bottom-color: #888;
  background: #f9f9f9;
}

/* ===== PAGE CONTENT ===== */

.page-content {
  display: none;
  flex: 1;
  padding: var(--right-pane-padding, 80px);
  overflow-y: auto;
  background: white;
  height: 100%;
}

.page-content .content-block {
  margin-bottom: 24px;
}

.page-content .content-block:first-child {
  margin-top: 0;
}

.page-content .iframe-container {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}


/* ===== MAIN CONTENT ===== */

.threepane-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: white;
}

/* Mobile view: panes stack vertically at full width */
.pane-container.mobile-view {
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.pane-container.mobile-view .right-pane {
  width: 100%;
  border-right: none;
  border-top: 3px solid #667eea;
}

/* ===== PANES ===== */

.pane {
  display: flex;
  flex-direction: column;
  border-right: 3px solid #667eea;
  background: #fafafa;
  overflow: hidden;
  transition: width 0.3s ease;
}

.pane.borderless {
  background: transparent;
  border-right: none;
}

.pane.borderless .content-block {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 16px;
}

.pane.borderless .block-title {
  color: #333;
  font-size: 16px;
}

.pane:last-child {
  border-right: none;
}

/* Left and center panes are collapsible */
.left-pane,
.center-pane {
  flex-shrink: 0;
  position: relative;
}

.left-pane.collapsed,
.center-pane.collapsed {
  width: 50px !important;
  cursor: pointer;
  background: linear-gradient(135deg, #9cddb5 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.left-pane.collapsed:hover,
.center-pane.collapsed:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.left-pane.collapsed .category-list,
.center-pane.collapsed .item-list {
  display: none;
}

.collapsed-label {
  color: white;
  font-weight: 600;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 14px;
  letter-spacing: 2px;
  user-select: none;
  padding: 10px 0;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Right pane expands to fill available space */
.right-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.collapse-btn-top {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #667eea;
  padding: 4px 8px;
  border-radius: 3px;
  transition: all 0.2s ease;
  z-index: 10;
  display: block;
  font-weight: 600;
}

.collapse-btn-top:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #764ba2;
}

.collapse-btn-top:focus {
  outline: 2px solid #667eea;
  outline-offset: -2px;
}

.pane-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ===== COLLAPSED PANE VIEW ===== */

.collapsed-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
}

.collapsed-item {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: #f0f0f0;
  color: #667eea;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.collapsed-item:hover {
  background: #e0e0e0;
  border-color: #667eea;
}

.collapsed-item.active {
  background: #667eea;
  color: white;
  font-weight: 700;
}

/* ===== LEFT PANE (Categories) ===== */

.left-pane {
  flex-shrink: 0;
  flex-basis: auto;
}

.category-list {
  display: flex;
  flex-direction: column;
}

.category-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
  transition: all 0.2s ease;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 500;
}

.category-item:hover {
  background: #f0f0f0;
  border-left-color: #888;
}

.category-item.active {
  background: white;
  border-left-color: #888;
  color: #555;
  font-weight: 600;
}

/* ===== CENTER PANE (Items) ===== */

.center-pane {
  flex-shrink: 0;
  flex-basis: auto;
}

.item-list {
  display: flex;
  flex-direction: column;
}

.item-list-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
  transition: all 0.2s ease;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.item-list-item:hover {
  background: #f0f0f0;
  border-left-color: #888;
}

.item-list-item.active {
  background: white;
  border-left-color: #888;
  color: #555;
  font-weight: 600;
}

/* ===== RIGHT PANE (Content) ===== */

.right-pane {
  flex: 1;
  background: white;
  overflow-y: auto;
  padding: var(--right-pane-padding, 80px);
  min-height: 0;
}

.content-block {
  margin-bottom: 24px;
  padding: 16px;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.block-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #667eea;
}

.block-content {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* ===== FOOTER ===== */

.threepane-footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 0;
  text-align: center;
  flex-shrink: 0;
  border-top: 1px solid #1a252f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-text {
  margin: 0;
  font-size: 13px;
}

.footer-links {
  font-size: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.footer-link {
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ===== SCROLLBAR ===== */

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

.pane-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.pane-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.pane-content::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ===== CONTENT BLOCK STYLES ===== */

.content-blocks {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 24px;
}

.content-block {
  margin-bottom: 24px;
  padding: 16px;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.content-block:last-child {
  margin-bottom: 0;
}

.block-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #667eea;
}

.block-content {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* ===== CODE BLOCK ===== */

.content-block-code pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
}

.content-block-code code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ===== PLAIN TEXT BLOCK ===== */

.plain-text {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* ===== MARKDOWN BLOCK ===== */

.content-block-markdown h1,
.content-block-markdown h2,
.content-block-markdown h3,
.content-block-markdown h4,
.content-block-markdown h5,
.content-block-markdown h6 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.content-block-markdown h1 { font-size: 28px; }
.content-block-markdown h2 { font-size: 24px; }
.content-block-markdown h3 { font-size: 20px; }
.content-block-markdown h4 { font-size: 18px; }
.content-block-markdown h5 { font-size: 16px; }
.content-block-markdown h6 { font-size: 14px; }

.content-block-markdown p {
  margin-bottom: 12px;
}

.content-block-markdown ul,
.content-block-markdown ol {
  margin-bottom: 12px;
  margin-left: 20px;
}

.content-block-markdown li {
  margin-bottom: 6px;
}

.content-block-markdown blockquote {
  margin: 12px 0;
  padding-left: 12px;
  border-left: 4px solid #667eea;
  color: #666;
  font-style: italic;
}

.content-block-markdown code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.content-block-markdown a {
  color: #667eea;
  text-decoration: none;
  border-bottom: 1px solid #667eea;
}

.content-block-markdown a:hover {
  color: #764ba2;
}

/* ===== IMAGE BLOCK ===== */

.content-block-image {
  text-align: center;
}

.responsive-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== VIDEO BLOCK ===== */

.content-block-video,
.content-block-video-m3u8,
.content-block-audio,
.content-block-audio-m3u8 {
  display: block;
  width: 100%;
}

.content-block-video video,
.content-block-video-m3u8 video,
.content-block-audio audio,
.content-block-audio-m3u8 audio {
  max-width: 100%;
  width: 100%;
  border-radius: 6px;
  display: block;
  margin-top: 12px;
}

/* ===== YOUTUBE BLOCK ===== */

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 45%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px;
}

/* ===== GALLERY BLOCK ===== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

/* ===== IFRAME BLOCK ===== */

.content-block-iframe {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-height: 100%;
}

.content-block-iframe .block-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.iframe-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== PDF BLOCK ===== */

.pdf-container {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pdf-container embed {
  border: none;
  border-radius: 6px;
}

.pdf-fallback {
  padding: 12px;
  background: #f0f0f0;
  text-align: center;
  border-radius: 6px;
}

.pdf-fallback a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #667eea;
}

.pdf-fallback a:hover {
  color: #764ba2;
}

/* ===== RSS BLOCK ===== */

.rss-container {
  padding: 12px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
}

.rss-info a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #667eea;
}

.rss-info a:hover {
  color: #764ba2;
}

.rss-note {
  margin-top: 8px;
  color: #999;
}

/* ===== DOWNLOAD BLOCK ===== */

.download-container {
  padding: 12px;
  background: #f7f7f5;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
}

.download-link {
  display: inline-block;
  padding: 10px 16px;
  background: #303030;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.download-link:hover {
  background: #555555;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-description {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* ===== RSS FEED BLOCK ===== */

.rss-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rss-loading {
  padding: 20px;
  text-align: left;
  color: #999;
  font-style: italic;
  font-size: 14px;
}

.rss-error {
  padding: 16px;
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
  border-radius: 6px;
  font-size: 14px;
}

.rss-header {
  padding: 16px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rss-channel-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-align: left;
  line-height: 1.3;
}

.rss-channel-description {
  margin: 0;
  font-size: 13px;
  color: #666;
  text-align: left;
}

.rss-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rss-item {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  text-align: left;
}

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

.rss-item:hover {
  background: transparent;
}

.rss-item-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  text-align: left;
}

.rss-item-date {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #999;
  text-align: left;
}

.rss-item-description {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  word-break: break-word;
  text-align: left;
}

/* Rich HTML support in RSS descriptions */
.rss-item-description p {
  margin: 8px 0;
  text-align: left;
}

.rss-item-description strong,
.rss-item-description b {
  font-weight: 600;
  color: #333;
}

.rss-item-description em,
.rss-item-description i {
  font-style: italic;
  color: #666;
}

.rss-item-description a {
  color: #555;
  text-decoration: underline;
  word-break: break-word;
}

.rss-item-description a:hover {
  color: #333;
}

.rss-item-description img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.rss-item-description ul,
.rss-item-description ol {
  margin: 8px 0 8px 20px;
  text-align: left;
}

.rss-item-description li {
  margin: 4px 0;
}

.rss-item-description blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 2px solid #ddd;
  color: #777;
}

.rss-item-description code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 12px;
  color: #555;
}

.rss-item-description pre {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.4;
}

.rss-item-link {
  display: block;
  width: fit-content;
  padding: 6px 12px;
  background: #f0f0f0;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.rss-item-link:hover {
  background: #e0e0e0;
  color: #333;
}

.rss-no-items {
  padding: 24px 0;
  text-align: left;
  color: #999;
  font-style: italic;
}

/* ===== ERROR STATE ===== */

.block-error {
  padding: 12px;
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.threepane-error {
  padding: 20px;
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
  border-radius: 4px;
  margin: 20px;
  font-family: monospace;
}

/* ===== SEARCH & FILTER ===== */

.search-container {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  background: white;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.3);
}

.search-results {
  display: flex;
  flex-direction: column;
}

.search-header {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  background: #f9f9f9;
  border-bottom: 1px solid #f0f0f0;
  margin-top: 12px;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
  transition: all 0.2s ease;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
  background: #f0f0f0;
  border-left-color: #667eea;
}

.result-title {
  display: block;
  font-weight: 500;
  color: #333;
}

.result-category {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.search-no-results {
  padding: 20px 16px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* ===== FLOATING SEARCH ===== */

.floating-search {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.floating-search .search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.floating-search .search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.3);
}

.floating-search .keyboard-hint {
  margin: 0;
  font-size: 11px;
  padding: 8px;
}

/* ===== KEYBOARD NAVIGATION HINTS ===== */

.keyboard-hint {
  padding: 8px 12px;
  background: #f0f9ff;
  border-left: 3px solid #3498db;
  font-size: 12px;
  color: #2c3e50;
  margin-bottom: 12px;
}

.keyboard-hint kbd {
  background: white;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 6px;
  font-family: monospace;
  font-weight: bold;
  display: inline-block;
  margin: 0 2px;
}

/* ===== ACCESSIBILITY FOCUS INDICATORS ===== */

[tabindex]:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.category-item[tabindex]:focus,
.item-list-item[tabindex]:focus {
  outline-offset: -2px;
}

/* Skip to content link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #667eea;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* ===== LAZY LOADING ===== */

.content-block.lazy-loading {
  opacity: 0.5;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.content-block.lazy-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== BREADCRUMB NAVIGATION (MOBILE) ===== */

.breadcrumbs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
}

.breadcrumb-item {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.breadcrumb-item:hover {
  background: rgba(102, 126, 234, 0.1);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #333;
  font-weight: 600;
  cursor: default;
}

.breadcrumb-separator {
  color: #999;
}

/* ===== SEARCH MODAL ===== */

.floating-search {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 500;
}

.search-icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-icon-btn:hover {
  background: #764ba2;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

.search-icon-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

/* Corner popup variant */
.search-modal.search-modal-corner {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  top: auto;
  left: auto;
  bottom: 100px;
  right: auto;
  width: auto;
  height: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.search-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

/* Corner popup content */
.search-modal-content.search-modal-content-corner {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 350px;
  max-width: calc(100vw - 40px);
  max-height: 60vh;
  border-radius: 8px;
  animation: slideUpCorner 0.3s ease;
}

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

@keyframes slideUpCorner {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

.search-modal-input {
  margin: 16px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  width: calc(100% - 32px);
  box-sizing: border-box;
}

.search-modal-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

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

@media (max-width: 1024px) {
  .left-pane,
  .center-pane {
    width: 180px;
  }
  
  .category-item,
  .item-list-item {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .right-pane {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  /* Show breadcrumbs on mobile */
  .breadcrumbs {
    display: flex;
  }
  
  /* Hide collapse buttons on mobile */
  .collapse-btn-top {
    display: none;
  }
  
  /* Stack panes vertically on mobile */
  .pane-container {
    flex-direction: column;
    border-right: none;
  }
  
  .left-pane,
  .center-pane {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    max-height: auto;
  }
  
  .category-list,
  .item-list {
    flex-direction: row;
    overflow-x: auto;
  }
  
  .category-item,
  .item-list-item {
    border-left: none;
    border-bottom: none;
    border-right: 1px solid #e0e0e0;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
  }
  
  .right-pane {
    flex: 1;
    padding: 12px;
  }
  
  .threepane-header {
    background-attachment: scroll;
    padding: 6px 12px !important;
  }
  
  .header-content {
    gap: 12px;
    padding: 0 !important;
  }
  
  .header-logo {
    width: 50px;
    height: 50px;
  }
  
  .header-title {
    font-size: 16px;
    margin: 0;
  }
  
  .header-subtitle {
    font-size: 12px;
    margin: 0;
  }
  
  .navbar {
    gap: 0;
  }
  
  .nav-link {
    min-width: 80px;
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .threepane-header {
    padding: 4px 8px !important;
  }
  
  .header-content {
    gap: 8px;
    padding: 0 !important;
  }
  
  .header-logo {
    width: 40px;
    height: 40px;
  }
  
  .header-title {
    font-size: 14px;
  }
  
  .header-subtitle {
    font-size: 11px;
  }
  
  .nav-link {
    min-width: 70px;
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .right-pane {
    padding: 8px;
  }
  
  .content-block {
    margin-bottom: 16px;
    padding: 12px;
  }
  
  .block-title {
    font-size: 16px;
  }
}

/* ===== FILE VIEWERS ===== */

/* CSV Table Styles */
.csv-table,
.excel-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.csv-table thead,
.excel-table thead {
  background-color: #f0f0f0;
  color: #333;
}

.csv-table th,
.excel-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.csv-table th:hover,
.excel-table th:hover {
  background-color: #e8e8e8;
}

.csv-table td,
.excel-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.csv-table tbody tr:hover,
.excel-table tbody tr:hover {
  background-color: #f5f5f5;
}

.csv-table tbody tr:last-child td,
.excel-table tbody tr:last-child td {
  border-bottom: none;
}

/* PDF Viewer Styles - Modern PDF.js Implementation */
.pdf-container {
  background: white;
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pdf-viewer-modern {
  display: flex;
  flex-direction: column;
  height: 800px;
  background: #f5f5f5;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: #6b6b6b;
  flex-wrap: wrap;
  min-height: 50px;
}

.pdf-btn {
  background: white;
  color: #333;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pdf-btn:hover:not(:disabled) {
  background: #f0f0f0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.pdf-btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.pdf-btn-nav {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.pdf-btn-zoom {
  min-width: 36px;
  padding: 8px 10px;
}

.pdf-btn-download {
  margin-left: auto;
}

.pdf-page-counter {
  color: white;
  font-size: 13px;
  font-weight: 500;
  min-width: 140px;
  text-align: center;
}

.pdf-separator {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
}

.pdf-zoom-level {
  color: white;
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

.pdf-canvas-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 16px;
  background: #f5f5f5;
}

.pdf-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pdf-loading {
  padding: 40px;
  text-align: center;
  color: #667eea;
  font-size: 16px;
}

.pdf-loading p {
  margin: 0;
}

.pdf-error {
  padding: 24px;
  text-align: center;
  background: #ffebee;
}

.pdf-error-message {
  color: #c62828;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.pdf-download-btn,
.pdf-fallback a {
  display: inline-block;
  background: linear-gradient(to right, #667eea, #764ba2);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

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

.pdf-fallback {
  padding: 24px;
  text-align: center;
  background: #f5f5f5;
}

.pdf-fallback p {
  margin: 0 0 16px 0;
  color: #666;
}

/* EPUB Viewer Styles */
.epub-container {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  margin: 16px 0;
}

.epub-controls {
  /* Styling handled via inline styles - controls look like PDF toolbar */
}

.epub-page-info {
  /* Styling handled via inline styles */
}

.epub-iframe {
  width: 100%;
  height: 600px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Generic File Viewer Styles */
.csv-container,
.excel-container,
.epub-container,
.pdf-viewer-container {
  margin: 16px 0;
}

.viewer-error {
  background-color: #ffebee;
  border: 1px solid #ef5350;
  border-radius: 4px;
  padding: 16px;
  color: #c62828;
  margin: 16px 0;
}

.viewer-error a {
  color: #c62828;
  text-decoration: underline;
  font-weight: 500;
}

.viewer-error a:hover {
  text-decoration: none;
}
