@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Work+Sans:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Light Mode Colors */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --bg-color: #f8fafc;
  --text-color: #1e293b;
  --sidebar-bg: #ffffff;
  --border-color: #e2e8f0;
  --heading-color: #0f172a;
  --accent-color: #f97316;
  --card-bg: #ffffff;
  --breadcrumb-color: #64748b;

  --transition-speed: 0.3s;
  --border-radius: 0.75rem;
  --sidebar-width: 280px;
  --navbar-height: 72px;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-primary: 0 8px 15px -3px rgba(59, 130, 246, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f172a;
    --text-color: #cbd5e1;
    --sidebar-bg: #1e293b;
    --border-color: #334155;
    --heading-color: #f8fafc;
    --card-bg: #1e293b;
    --breadcrumb-color: #94a3b8;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--heading-color);
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--primary-hover);
}

/* Site Layout Styles */
.site-navbar {
  height: var(--navbar-height);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: all var(--transition-speed);
  box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
  .site-navbar {
    background: rgba(30, 41, 59, 0.8);
  }
}

.nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-menu-toggle {
  display: flex;
  background: rgba(59, 130, 246, 0.03);
  border: none;
  color: var(--text-color);
  padding: 0.6rem;
  cursor: pointer;
  border-radius: 10px;
  transition: all var(--transition-speed);
}

.mobile-menu-toggle:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.nav-logo h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--primary-color);
  white-space: nowrap;
}


.site-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--navbar-height));
}

/* Sidebar Responsive Layout */
#sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.95);
  /* Refined glass base */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  z-index: 900;
  transform: translateX(-100%);
  transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

@media (prefers-color-scheme: dark) {
  #sidebar {
    background: rgba(15, 23, 42, 0.95);
  }
}

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

.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  /* Deep but transparent */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 850;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

#sidebar h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

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

/* Premium Language Selector */
.custom-lang-selector {
  position: relative;
  min-width: 140px;
}

.selector-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.85rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-align: left;
}

.selector-trigger:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.icon-globe {
  color: var(--primary-color);
  margin-right: 0.75rem;
  opacity: 0.9;
}

.current-lang {
  flex: 1;
}

.icon-chevron {
  opacity: 0.5;
  transition: transform var(--transition-speed);
}

.custom-lang-selector.is-open .icon-chevron {
  transform: rotate(180deg);
}

.selector-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-lang-selector.is-open .selector-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.selector-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  font-size: 0.875rem;
  transition: background var(--transition-speed);
}

.selector-option:hover {
  background: rgba(59, 130, 246, 0.05);
  color: var(--primary-color);
}

.selector-option.is-active {
  color: var(--primary-color);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
}

.icon-check {
  color: var(--primary-color);
}

/* Refined Sidebar Navigation */
.nav-item-level {
  margin-bottom: 0.25rem;
}

.nav-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  transition: all var(--transition-speed);
  margin: 0.25rem;
  padding: 0.25rem;
}

.nav-item-header:hover {
  background: rgba(59, 130, 246, 0.05);
}

.nav-item-header.is-active {
  background: var(--primary-color);
}

.nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text-color);
  border-radius: 10px;
  line-height: 1.2;
  /* Explicit line-height for stability */
}

.nav-item-header.is-active .nav-link {
  color: #ffffff;
  font-weight: 600;
}

/* Remove direct active background to let header handle it */
.nav-link.active {
  background: transparent;
}


.nav-sub {
  list-style: none;
  padding-left: 0.75rem;
  /* Reduced from 1.25rem */
  margin: 0;
  border-left: 1.5px solid var(--border-color);
  margin-left: 0.75rem;
  /* Reduced from 1rem */
  overflow: hidden;
  transition: opacity 0.3s ease, margin 0.3s ease;
}

.nav-item-level.is-collapsed>.nav-sub {
  display: none;
}


.nav-item-level.is-expanded>.nav-sub {
  max-height: 2000px;
  /* Large enough for nested items */
  opacity: 1;
  margin-top: 0;
  margin-bottom: 0;
}

.nav-item-level>a:hover,
.nav-item-level>a.active {
  background: var(--primary-color);
  color: #ffffff;
}

.nav-leaf {
  margin: 0.15rem 0;
}

.nav-leaf .nav-link {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  opacity: 0.85;
  border-radius: 0.4rem;
}

.nav-leaf .nav-link:hover,
.nav-leaf .nav-link.active {
  opacity: 1;
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
}

.nav-leaf .nav-link.active {
  background: var(--primary-color);
  color: #ffffff;
}

/* Content Area */
#content {
  flex: 1;
  padding: 1.5rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--breadcrumb-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--breadcrumb-color);
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: color var(--transition-speed), transform 0.2s;
}

.breadcrumb-home-icon {
  display: block;
}

.breadcrumb-separator {
  opacity: 0.4;
  font-size: 0.75rem;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
}

@media (prefers-color-scheme: dark) {
  th {
    background: #334155;
    color: #f8fafc;
  }
}

/* Alerts */
.alert {
  padding: 1.25rem;
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  border-left: 6px solid;
  box-shadow: var(--shadow-md);
}

.alert-tip {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: var(--primary-color);
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .site-layout {
    flex-direction: row;
    padding-left: var(--sidebar-width);
  }

  #sidebar {
    transform: translateX(0);
    position: fixed;
    /* Stick to side */
    top: var(--navbar-height);
    border-bottom: none;
  }

  .mobile-menu-toggle,
  .sidebar-overlay {
    display: none !important;
  }

  .nav-logo h2 {
    font-size: 1.25rem;
  }

  .nav-container {
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
  }

  .nav-left,
  .nav-right {
    flex: 1;
  }

  .nav-right {
    display: flex;
    justify-content: flex-end;
  }
}

#content {
  padding: 3rem 4rem;
}

/* Component Styles */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  color: var(--heading-color);
}

/* Home Section Styles */
.home-hero {
  padding: 4rem 2rem;
  text-align: center;
  background: var(--sidebar-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.home-hero h1 {
  font-size: 3rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--heading-color);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--breadcrumb-color);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.home-categories {
  margin-bottom: 4rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.75rem;
  margin: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition-speed);
}

.category-card:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.04);
  box-shadow: var(--shadow-md);
}

.category-card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.category-card p {
  color: var(--breadcrumb-color);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Button Utilities */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  transition: all var(--transition-speed);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

/* Professional Download Button Styles */
.btn-download {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.875rem 1.25rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
  width: 100%;
  cursor: pointer;
}

.btn-download:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.btn-download .icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 8px;
  margin-right: 1rem;
  color: var(--primary-color);
  transition: background 0.2s ease;
}

.btn-download:hover .icon-wrapper {
  background: rgba(59, 130, 246, 0.15);
}

.btn-download span {
  flex: 1;
  text-align: left;
}

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

.item-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all var(--transition-speed);
  cursor: pointer;
}

.item-card:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.04);
  box-shadow: var(--shadow-md);
}

.item-card h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.25rem;
}

.summary {
  font-size: 0.9rem;
  color: var(--breadcrumb-color);
  margin-top: 0.5rem;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.page-content p {
  margin-bottom: 1.25rem;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Resource List Styles (Refined & Integrated) */
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.resource-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.resource-item:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.04);
  box-shadow: var(--shadow-md);
}

.resource-name {
  margin: 0;
  color: var(--heading-color);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  flex: 1;
  transition: color var(--transition-speed) ease;
  line-height: 1.3;
}

.resource-item:hover .resource-name {
  color: var(--primary-color);
}

/* Subtle arrow indicator */
.resource-item::after {
  content: "→";
  font-size: 1.1rem;
  color: var(--primary-color);
  opacity: 0.4;
  transition: opacity var(--transition-speed) ease;
  margin-left: 0.5rem;
}

.resource-item:hover::after {
  opacity: 1;
}

/* Cleanup unused classes from existing layouts */
.resource-info,
.resource-meta,
.resource-action {
  display: none;
}

/* Minimal Download Box for Detail Pages */



/* Brand Group Styles */
.brand-group {
  margin: 2rem 0;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.brand-group .resource-list {
  margin-top: 0;
}

/* Color Swatches Styles */
.swatch-section {
  margin: 3rem 0;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.swatch-item:hover {
  /* Removed displacement animation */
}

.swatch-image-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: #fff;
  transition: all 0.2s ease;
}

.swatch-item:hover .swatch-image-wrapper {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-primary);
}

.swatch-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swatch-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--breadcrumb-color);
  line-height: 1.1;
  word-break: break-word;
  max-width: 64px;
  transition: color 0.2s ease;
}

.swatch-item:hover .swatch-name {
  color: var(--primary-color);
}

@media (min-width: 640px) {
  .swatch-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1.5rem;
  }

  .swatch-image-wrapper {
    width: 68px;
    height: 68px;
  }

  .swatch-name {
    font-size: 0.75rem;
  }
}