:root {
  --bg-1: #f8f9fa;
  --bg-2: #ffffff;
  --glass-1: rgba(248, 250, 251, 0.85);
  --glass-2: rgba(248, 250, 251, 0.8);
  --accent: rgba(33, 37, 41, 0.06);
  --accent-hover: rgba(33, 37, 41, 0.08);
  --muted: rgba(33, 37, 41, 0.7);
  --text-primary: #212529;
  --border-light: rgba(33, 37, 41, 0.03);
  --border-default: rgba(33, 37, 41, 0.06);
  --card-radius: 12px;
  --navbar-height: 72px;
  --red-accent: #ff6b6b;
  --blue-accent: #4dabf7;
  --green-accent: #51cf66;
  --orange-accent: #ff922b;
  --purple-accent: #9775fa;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
  margin: 0;
  background: linear-gradient(180deg, var(--bg-1) 0%, #e9ecef 100%);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Scrollbar */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Typography */
.small-muted {
  color: var(--muted);
  font-size: 0.85rem;
}

h4.section-title {
  font-size: 1.25rem;
  margin: 0 0 12px 0;
  font-weight: 700;
  color: var(--text-primary);
}

h5.subsection-title {
  font-size: 1rem;
  margin: 0 0 10px 0;
  font-weight: 600;
  color: var(--text-primary);
}

/* Glass backdrop */
.glass-backdrop {
  backdrop-filter: blur(22px) saturate(110%);
  -webkit-backdrop-filter: blur(22px) saturate(110%);
}

/* Topbar - FIXED */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1450;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(248, 250, 251, 0.95),
    rgba(248, 250, 251, 0.9)
  );
  border-bottom: 1px solid rgba(248, 250, 251, 0.04);
  
}

.topbar .logo {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}

.topbar .logo i {
  font-size: 1.35rem;
  color: var(--text-primary);
}

.topbar .nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.icon-btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
}

.icon-btn {
  width: 40px;
  height: 40px;
  color: var(--muted);
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--accent);
  border-color: var(--border-light);
}

.btn-ghost {
  border-color: var(--border-light);
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
  background: var(--accent);
}

/* Top Nav Links */
.top-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  background: var(--accent);
  border: 1px solid var(--border-default);
  cursor: pointer;
}

.top-nav-link:hover,
.top-nav-link:focus {
  background: var(--accent-hover);
  border-color: rgba(33, 37, 41, 0.1);
  outline: none;
}

.top-nav-link.active {
  background: var(--accent-hover);
  border-bottom: 2px solid var(--red-accent);
}

.top-nav-link .nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.top-nav-link .dropdown-arrow {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: 4px;
}

.software-link {
  color: var(--red-accent);
}

/* Dropdown */
.dropdown-menu {
  background: var(--bg-2);
  border: 1px solid rgba(33, 37, 41, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
}

.dropdown-item {
  color: var(--text-primary);
  padding: 8px 16px;
  transition: background 0.2s;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--accent);
  color: var(--text-primary);
}

.dropdown-divider {
  border-color: rgba(33, 37, 41, 0.1);
}

/* Content wrapper */
.content-wrapper {
  position: relative;
  width: 100%;
  min-height: 400px;
  isolation: isolate;
  margin-bottom: 0;
}

/* Main content and tab content sections */
.main-content-section,
#tab-content-container {
  width: 100%;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.main-content-section.active,
#tab-content-container.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  pointer-events: auto;
}

/* Section anchors - scroll padding for sticky header */
.content-section {
  scroll-margin-top: calc(var(--navbar-height) + 20px);
  margin-bottom: 20px;
}

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

/* Panels */
.panel-base {
  position: fixed;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  padding: 22px;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 251, 0.95),
    rgba(248, 250, 251, 0.9)
  );
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Left Sidebar */
.sidebar-panel {
  left: 0;
  width: 280px;
  max-width: 85%;
  transform: translateX(-110%);
  z-index: 1400;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.sidebar-logo {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.sidebar-panel .nav-link {
  color: var(--muted);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-panel .nav-link i {
  width: 26px;
  text-align: center;
  font-size: 1.15rem;
}

.sidebar-panel .nav-link:hover,
.sidebar-panel .nav-link:focus {
  background: var(--accent);
  color: var(--text-primary);
  outline: none;
}

.sidebar-panel .nav-link.active {
  background: var(--accent-hover);
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-panel .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--red-accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-section-title {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 8px 10px;
  margin: 10px 0 5px 0;
  border-bottom: 1px solid var(--border-light);
}

/* Right Panel */
.right-panel {
  right: 0;
  width: 345px;
  max-width: 90%;
  border-left: 1px solid var(--border-light);
  z-index: 1375;
}

.right-panel .glass-card {
  margin-bottom: 14px;
}

.right-panel.mobile-hidden {
  transform: translateX(110%);
}

.right-panel.mobile-open {
  transform: translateX(0);
}

@media (max-width: 991.98px) {
  .right-panel {
    width: 320px;
    right: 0;
    position: fixed;
  }
}

/* Overlay */
.overlay {
  position: fixed;
  inset: var(--navbar-height) 0 0 0;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1350;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Main content */
main.content {
  min-height: calc(100vh - var(--navbar-height));
  padding: 26px 22px 10px;
  max-width: calc(100% - 340px);
  margin-right: 320px;
}

@media (max-width: 991.98px) {
  main.content {
    max-width: 100%;
    margin-right: 0;
    padding-bottom: 10px;
  }
}

/* Glass cards */
.glass-card {
  background: var(--glass-1);
  border: 1px solid var(--border-default);
  border-radius: var(--card-radius);
  padding: 14px;
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  margin-bottom: 0;
}

.glass-card.hoverable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  background: var(--glass-2);
}

.glass-card-sm {
  border-radius: 8px;
  background: var(--glass-2);
}

/* Platform card */
.platform-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: var(--glass-2);
  border: 1px solid var(--border-default);
  transition: all 0.2s ease;
  cursor: pointer;
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: rgba(33, 37, 41, 0.12);
}

.platform-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: white;
}

.platform-info {
  flex: 1;
  min-width: 0;
}

.platform-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.platform-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.platform-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-verified {
  background: rgba(81, 207, 102, 0.15);
  color: var(--green-accent);
}

.badge-hot {
  background: rgba(255, 107, 107, 0.15);
  color: var(--red-accent);
}

.badge-new {
  background: rgba(77, 171, 247, 0.15);
  color: var(--blue-accent);
}

/* Stats card */
.stat-card {
  text-align: center;
  padding: 16px;
  border-radius: 10px;
  background: var(--glass-2);
  border: 1px solid var(--border-default);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Avatar */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Footer Styles */
.main-footer {
  padding: 20px 0 30px;
  margin-top: 0;
  background: transparent;
}

.main-footer .glass-card {
  background: var(--glass-1);
  border: 1px solid var(--border-default);
}

.footer-logo {
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-logo:hover {
  opacity: 0.8;
}

.footer-links {
  width: 100%;
}

.footer-link {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
}

.footer-link:hover {
  color: var(--text-primary);
  transform: translateX(4px);
}

.footer-link i {
  font-size: 0.85rem;
  opacity: 0.7;
}

.footer-qr-section .qr-container {
  max-width: 120px;
}

.footer-brand-link {
  color: var(--red-accent);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-brand-link:hover {
  opacity: 0.8;
}

.footer-copyright {
  color: var(--muted);
}

/* Bottom nav */
.bottom-nav {
  display: none;
}

@media (max-width: 576px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: linear-gradient(
      180deg,
      rgba(248, 250, 251, 0.95),
      rgba(248, 250, 251, 0.9)
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    z-index: 1250;
    border-top: 1px solid var(--border-light);
  }
  main.content {
    padding-bottom: 10px;
  }
  .main-footer {
    padding-bottom: 80px;
  }
}

/* Fix for tab content being covered by header */
#tab-content-container {
  padding-top: 50px; /* Adjust based on your header height */
}

#tab-content-container.active {
  padding-top: 50px;
}



/* Responsive adjustments for footer */
@media (max-width: 991.98px) {
  .main-footer {
    padding-bottom: 90px;
  }
}

@media (max-width: 767.98px) {
  .main-footer .glass-card {
    padding: 24px 16px !important;
  }
  
  .footer-qr-section .qr-container {
    margin-top: 20px;
  }
}

/* Utilities */
.btn-light-custom {
  background: var(--accent);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.btn-light-custom:hover {
  background: var(--accent-hover);
}

.btn-primary-custom {
  background: var(--red-accent);
  border: 1px solid var(--red-accent);
  color: white;
  transition: all 0.2s ease;
}

.btn-primary-custom:hover {
  background: #ff5252;
  border-color: #ff5252;
}

/* Focus states */
.icon-btn:focus,
.btn:focus,
.nav-link:focus,
.top-nav-link:focus {
  outline: 2px solid rgba(33, 37, 41, 0.1);
  outline-offset: 2px;
}

/* Rating stars */
.rating {
  color: #ffd43b;
  font-size: 0.9rem;
}

/* Tag */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  background: var(--accent);
  margin-right: 6px;
  margin-bottom: 6px;
}


 .main-content-section,
  #tab-content-container {
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .main-content-section.active,
  #tab-content-container.active {
    display: block;
    opacity: 1;
  }

  /* Remove min-height constraints */
  .content-wrapper {
    min-height: 0 !important;
    height: auto !important;
  }

  #tab-content-container {
    min-height: 0 !important;
  }

  /* Ensure proper spacing */
  .content {
    padding-top: 70px;
  }

  @media (max-width: 768px) {
    .content {
      padding-top: 60px;
    }
  }