/* ====================================================
   SHEERPME WIKI - CATEGORY INDEX PAGE STYLES
   Shared styles for PRO, CRM, B2C, and B2B index pages
   ==================================================== */

/* CSS Variables for category customization */
:root {
  --category-primary: #4f46e5;
  --category-secondary: #7c3aed;
  --category-primary-dark: #4338ca;
  --category-hover-bg: #f1f5f9;
  --category-hover-color: #4f46e5;
}

/* Base reset and body styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: #f8fafc;
  overflow-x: hidden;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--category-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: none;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: var(--category-primary-dark);
  transform: scale(1.05);
}

.mobile-menu-toggle .icon {
  width: 24px;
  height: 24px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: white;
  border-right: 1px solid #e2e8f0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(135deg, var(--category-primary) 0%, var(--category-secondary) 100%);
  color: white;
}

.sidebar-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-header .category-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.search-container {
  position: relative;
}

.search-box {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.1);
  color: white;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-box::placeholder {
  color: rgba(255,255,255,0.7);
}

.search-box:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.1);
}

/* Sidebar menu */
.sidebar-menu {
  padding: 1.5rem 0;
}

.nav-item {
  margin: 0.25rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.9rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--category-hover-bg);
  color: var(--category-hover-color);
  transform: translateX(4px);
  border-color: rgba(79, 70, 229, 0.1);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--category-primary) 0%, var(--category-secondary) 100%);
  color: white;
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Main content */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 24px;
}

.footer {
  background: #1e293b;
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .container {
    padding: 1rem 16px;
  }

  /* Overlay for mobile sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(4px);
  }

  .sidebar-overlay.active {
    display: block;
  }
}

.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.back-link {
  margin: 0.5rem 1rem 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 12px;
  color: #64748b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: #f1f5f9;
  color: var(--category-primary);
  transform: translateX(-4px);
}

/* Welcome Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

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

@keyframes fadeOut {
  to { opacity: 0; }
}

.popup-content {
  background: white;
  border-radius: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  position: relative;
  transform: scale(0.9);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
  to { transform: scale(1); }
}

.popup-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #64748b;
}

.popup-close:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: rotate(90deg);
}

.popup-header {
  text-align: center;
  margin-bottom: 2rem;
}

.popup-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--category-primary) 0%, var(--category-secondary) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.popup-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--category-primary) 0%, var(--category-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popup-subtitle {
  font-size: 1rem;
  color: #64748b;
  font-weight: 500;
}

.popup-body {
  margin-bottom: 2rem;
}

.popup-section {
  margin-bottom: 1.5rem;
}

.popup-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--category-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.popup-text {
  color: #475569;
  line-height: 1.7;
  font-size: 0.95rem;
}

.popup-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.popup-btn {
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.popup-btn-primary {
  background: linear-gradient(135deg, var(--category-primary) 0%, var(--category-secondary) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.popup-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.popup-btn-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.popup-btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Small mobile - 320px to 480px */
@media (max-width: 480px) {
  .popup-content {
    padding: 1.25rem 1rem;
    max-height: 75vh;
    margin: 1rem;
    overflow-y: auto;
  }

  .popup-icon {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .popup-header {
    margin-bottom: 1.25rem;
  }

  .popup-title {
    font-size: 1.3rem;
  }

  .popup-description {
    font-size: 0.9rem;
  }

  .popup-body {
    margin-bottom: 1.25rem;
  }

  .popup-section {
    margin-bottom: 1rem;
  }

  .popup-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .popup-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Large mobile - 481px to 767px */
@media (min-width: 481px) and (max-width: 767px) {
  .popup-content {
    padding: 1.5rem 1.25rem;
    max-height: 80vh;
  }

  .popup-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .popup-title {
    font-size: 1.5rem;
  }

  .popup-actions {
    flex-direction: column;
  }

  .popup-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Tablets - 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .popup-content {
    padding: 2rem 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .popup-title {
    font-size: 1.5rem;
  }

  .popup-actions {
    flex-direction: column;
  }

  .popup-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Small laptops (11-13 inches) - 1024px to 1366px */
@media (min-width: 1024px) and (max-width: 1366px) {
  .sidebar {
    width: 240px;
  }

  .main-content {
    margin-left: 240px;
  }

  .container {
    padding: 1.5rem 20px;
  }

  .popup-content {
    max-width: 520px;
    max-height: 80vh;
    padding: 1.5rem 1.5rem;
    overflow-y: auto;
    margin: 1rem;
  }

  .popup-icon {
    width: 55px;
    height: 55px;
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .popup-title {
    font-size: 1.4rem;
  }

  .popup-subtitle {
    font-size: 0.9rem;
  }

  .popup-header {
    margin-bottom: 1.25rem;
  }

  .popup-body {
    margin-bottom: 1.25rem;
  }

  .popup-section {
    margin-bottom: 1rem;
  }

  .popup-section-title {
    font-size: 0.85rem;
  }

  .popup-text {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .popup-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }

  .popup-close {
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
  }
}

/* Medium laptops (13-14 inches) - 1367px to 1599px */
@media (min-width: 1367px) and (max-width: 1599px) {
  .sidebar {
    width: 260px;
  }

  .main-content {
    margin-left: 260px;
  }

  .container {
    padding: 1.75rem 22px;
  }

  .popup-content {
    max-width: 600px;
    padding: 2.25rem 1.85rem;
  }

  .popup-icon {
    width: 75px;
    height: 75px;
    font-size: 2.35rem;
  }

  .popup-title {
    font-size: 1.85rem;
  }

  .popup-btn {
    padding: 0.95rem 1.85rem;
    font-size: 0.975rem;
  }
}

/* Larger laptops (15-16 inches) */
@media (min-width: 1600px) {
  .popup-content {
    max-width: 650px;
    padding: 2.5rem 2rem;
  }
}

/* Additional popup features for different categories */
.popup-features {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.popup-feature {
  display: flex;
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  border-left: 3px solid var(--category-primary);
}

.popup-feature-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--category-secondary);
}

.popup-feature-text {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
}

/* ====================================================
   CROSS-FILE SEARCH RESULTS DROPDOWN
   ==================================================== */

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
}

.search-result-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.search-result-item:hover {
  background: #f8fafc;
  transform: translateX(4px);
}

.search-result-page {
  font-size: 0.75rem;
  color: var(--category-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.search-result-section {
  font-size: 0.9rem;
  color: #1e293b;
  font-weight: 500;
}

.search-result-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Responsive search dropdown */
@media (max-width: 480px) {
  .search-results-dropdown {
    max-height: 300px;
  }

  .search-result-item {
    padding: 0.75rem 0.875rem;
  }

  .search-result-page {
    font-size: 0.7rem;
  }

  .search-result-section {
    font-size: 0.85rem;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  .search-results-dropdown {
    max-height: 350px;
  }
}

@media (min-width: 1024px) and (max-width: 1366px) {
  .search-results-dropdown {
    max-height: 360px;
  }

  .search-result-item {
    padding: 0.8rem 0.95rem;
  }
}
