/* =========================================================================
   AuditDesk — Unified Resource Center (Minimal Custom Layout Styles)
   ========================================================================= */

/* 1. Sticky Search Header Block */
.resources-sticky-header {
  position: sticky;
  top: 70px; /* Flush below main navbar */
  z-index: 100;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--line);
}

/* 2. Left Navigation Panel (Sticky) */
.resources-sidebar-sticky {
  position: sticky;
  top: 170px; /* Sits below search block */
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: none;
}
.resources-sidebar-sticky::-webkit-scrollbar {
  display: none;
}

.category-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  transition: transform 0.2s ease;
}

.category-nav-btn:hover .sidebar-icon {
  transform: scale(1.2);
}

.category-nav-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 4px;
  background: #2563eb; /* Blue vertical indicator */
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}

/* 3. Mobile Category Chip Slider */
.mobile-category-slider {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.mobile-category-slider::-webkit-scrollbar {
  display: none;
}

/* Highlight Matching Text inside Cards */
mark.search-highlight {
  background: rgba(253, 224, 71, 0.6);
  color: #000000;
  padding: 0 2px;
  border-radius: 3px;
}

/* Category Targets - Highlight active card block */
.target-section-block {
  scroll-margin-top: 190px;
}

.module-group-title svg.chevron-icon {
  transition: transform 0.2s ease;
}

.module-group-title.collapsed svg.chevron-icon {
  transform: rotate(-90deg);
}

.module-group-block.collapsed .resource-items-list {
  display: none !important;
}

/* 4. Collapsible Sidebar (Tablet/Mobile Media Queries) */
@media (max-width: 1199px) {
  .resources-sidebar-sticky {
    position: static;
    max-height: none;
  }
  .category-nav-btn.active::before {
    display: none; /* Hide vertical indicator */
  }
}

@media (max-width: 767px) {
  .resources-sidebar-sticky {
    display: none;
  }
  .mobile-category-slider {
    display: flex;
  }
  .resources-sticky-header {
    top: 56px;
  }
  .target-section-block {
    scroll-margin-top: 240px;
  }
}

/* =========================================================================
   5. Premium File Explorer Styling & Thumbnails
   ========================================================================= */

.address-bar-back-btn {
  background: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  transition: all 0.25s ease;
}

.address-bar-back-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.segment-link {
  cursor: pointer;
  transition: color 0.2s;
}
.segment-link:hover {
  color: #2563eb;
}

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
  min-height: 250px;
  transition: all 0.3s ease;
}

.explorer-item {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.explorer-title-wrapper {
  height: 44px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explorer-item:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18) !important;
}

.explorer-item:active {
  background: rgba(37, 99, 235, 0.14);
}

.explorer-icon-container {
  width: 52px;
  height: 52px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* File explorer thumbnails styling */
.file-thumbnail-doc {
  width: 34px;
  height: 46px;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
}

.explorer-item:hover .file-thumbnail-doc {
  border-color: #2563eb;
  box-shadow: 0 3px 6px rgba(37, 99, 235, 0.12);
}

/* Custom styled thumbnails details */
.thumbnail-mvt-explanation {
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
  border-color: #fca5a5;
  padding: 2px;
}
.thumbnail-mvt-explanation::before {
  content: "MVT";
  font-size: 4.5px;
  font-weight: 900;
  color: #b91c1c;
  line-height: 1;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1px;
}
.thumbnail-mvt-explanation::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  height: 24px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ef4444"><circle cx="6" cy="12" r="3"/><rect x="12" y="6" width="10" height="12" rx="2"/></svg>')
    no-repeat center;
  background-size: contain;
}

.thumbnail-mvt-cover {
  background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
  border-color: #93c5fd;
  padding: 2px;
}
.thumbnail-mvt-cover::before {
  content: "MVT ARCH";
  font-size: 4px;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.1;
  text-align: center;
  display: block;
  margin-top: 1px;
}
.thumbnail-mvt-cover::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  height: 18px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232563eb"><circle cx="12" cy="12" r="8"/></svg>')
    no-repeat center;
  background-size: contain;
}

.thumbnail-fullstack {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border-color: #86efac;
  padding: 2px;
}
.thumbnail-fullstack::before {
  content: "FULLSTACK";
  font-size: 3.5px;
  font-weight: 800;
  color: #166534;
  text-align: center;
  display: block;
}
.thumbnail-fullstack::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 1px;
  right: 1px;
  height: 20px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2316a34a"><rect x="4" y="4" width="16" height="16" rx="2"/></svg>')
    no-repeat center;
  background-size: contain;
}

.thumbnail-general {
  background: linear-gradient(135deg, #fbfbfe 0%, #fff 100%);
  border-color: #cbd5e1;
}

/* File icon badges */
.file-badge-word {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 15px;
  height: 15px;
  background: #2563eb;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 7px;
  font-family: "Arial", sans-serif;
  border: 1px solid white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.file-badge-download {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #0e7c66;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 1px solid white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Make file/folder names wrap up to 3 lines and handle word breaks gracefully */
.explorer-item-name {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.25;
}
