/* React + shadcn UI Inspired Professional Theme
   Typography-first design with micro-charts and rich tooltips
   Max font size: 14px | Helvetica + Monaco | Minimal but information-dense */

:root {
  /* shadcn UI color tokens - Light mode */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 0 0% 93%;
  --input: 0 0% 93%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;

  /* Brighter highlight colors */
  --highlight-green: 142 71% 45%;
  --highlight-blue: 221 83% 53%;
  --highlight-violet: 262 83% 58%;
  --highlight-amber: 32 95% 44%;
  --highlight-cyan: 189 94% 43%;
  --highlight-rose: 350 89% 60%;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography scale - nothing over 14px */
  --text-xs: 10px;
  --text-sm: 11px;
  --text-base: 12px;
  --text-md: 13px;
  --text-lg: 14px;

  /* Font stacks */
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Dark mode colors - near black with subtle borders */
body[data-theme="dark"] {
  --background: 0 0% 7%;
  --foreground: 0 0% 95%;
  --card: 0 0% 9%;
  --card-foreground: 0 0% 95%;
  --popover: 0 0% 7%;
  --popover-foreground: 0 0% 95%;
  --primary: 0 0% 95%;
  --primary-foreground: 0 0% 10%;
  --secondary: 0 0% 12%;
  --secondary-foreground: 0 0% 95%;
  --muted: 0 0% 10%;
  --muted-foreground: 0 0% 60%;
  --accent: 0 0% 12%;
  --accent-foreground: 0 0% 95%;
  --destructive: 0 62.8% 40%;
  --destructive-foreground: 0 0% 95%;
  --border: 0 0% 15%;
  --input: 0 0% 15%;
  --ring: 0 0% 70%;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: hsl(var(--foreground));
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body[data-theme="dark"] {
  background: hsl(var(--background));
}

/* Deep Freeze Cloud Header */
.wrapper_Header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  background: #2e78c1;
  border-bottom: 3px solid #d47f2a;
  margin: 0;
  gap: 16px;
  height: 32px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 100;
}

.logo_header_text {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  padding: 0;
  letter-spacing: 0.5px;
}

.header-right-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Container */
.pro-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) 80px var(--space-4);
}

/* Hide header bar in BrainFreeze theme */
.pro-header-bar {
  display: none;
}

/* Hide Classic user info, show Modern user info */
.pro-user-info-classic {
  display: none !important;
}

.pro-user-info-modern {
  display: flex !important;
}

/* Header - Compact and clean */
.pro-header {
  position: relative;
  display: none; /* Hidden - using wrapper_Header instead */
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.pro-logo {
  position: relative;
  height: 56px;
  width: auto;
  opacity: 1;
}

/* Dark mode toggle - shadcn style */
/* Dark mode toggle in header bar */
.dark-mode-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0.8;
  transition: opacity 0.2s;
  height: 32px;
}

.dark-mode-toggle:hover {
  opacity: 1;
}

/* Settings gear toggle in header bar */
.header-settings-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0.75;
  transition: opacity 0.15s;
  height: 32px;
  outline: none;
}

.header-settings-toggle:hover {
  opacity: 1;
}

.header-settings-toggle:focus,
.header-settings-toggle:focus-visible,
.header-settings-toggle:active {
  outline: none;
  box-shadow: none;
  border: none;
}

.dark-mode-toggle:focus-visible {
  outline: none;
  ring: 2px solid hsl(var(--ring));
  ring-offset: 2px;
}

.dark-mode-toggle svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  color: #ffffff;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sun-icon {
  display: block;
}

.moon-icon {
  display: none;
}

body[data-theme="dark"] .sun-icon {
  display: none;
}

body[data-theme="dark"] .moon-icon {
  display: block;
}

/* Dark mode: invert minimal tile images */
body[data-theme="dark"] .pro-card-image-wrapper {
  background: transparent;
}

body[data-theme="dark"] .pro-card-image-wrapper .pro-card-image {
  filter: invert(1);
  mix-blend-mode: difference;
}

.pro-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow-sm);
  z-index: 12;
}

#userDetails {
  display: flex !important;
  align-items: center;
  gap: var(--space-3);
}

.pro-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid hsl(var(--border));
}

.pro-user-avatar svg {
  width: 18px;
  height: 18px;
  color: hsl(var(--foreground));
  stroke-width: 1.5;
}

.pro-user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.pro-user-email {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: hsl(var(--foreground));
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pro-user-role {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  display: inline-block;
}

.pro-user-role.role-superadmin {
  background: hsl(var(--highlight-blue));
  color: white;
}

.pro-user-role.role-admin {
  background: hsl(var(--highlight-blue));
  color: white;
}

/* Search Section - Compact and functional */
.pro-search-section {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.pro-search-bar {
  position: relative;
  margin-bottom: var(--space-3);
}

.pro-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  padding-right: 62px;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  border: 2px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}

.pro-search-clear {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 150ms, background 150ms;
}

.pro-search-clear.visible {
  display: inline-flex;
}

.pro-search-clear:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--foreground) / 0.08);
}

.pro-search-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

.pro-search-input::placeholder {
  color: hsl(var(--muted-foreground));
  font-size: var(--text-sm);
}

.pro-search-icon {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

/* Stats with micro sparklines */
.pro-search-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid hsl(var(--border));
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.pro-stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  cursor: help;
}

.pro-stat:hover {
  color: hsl(var(--foreground));
}

.pro-stat-value {
  color: hsl(var(--foreground));
  font-weight: 700;
  font-size: var(--text-sm);
}

/* Micro sparklines - inline data viz */
.pro-micro-sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 14px;
  margin-left: var(--space-1);
  opacity: 0.7;
  transition: opacity 150ms;
}

.pro-stat:hover .pro-micro-sparkline {
  opacity: 1;
}

.pro-sparkline-bar {
  width: 2px;
  background: hsl(var(--highlight-blue));
  border-radius: 1px;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pro-stat:hover .pro-sparkline-bar {
  background: hsl(var(--highlight-violet));
}

/* Group by dropdown */
.group-by-select {
  padding: 2px 6px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  cursor: pointer;
}

/* Product group sections */
.pro-group-section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.pro-group-section .pro-grid {
  padding-top: var(--space-5);
}

.pro-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px var(--space-4);
  background: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: var(--text-xs);
  font-weight: 600;
}

.pro-group-count {
  color: hsl(var(--muted-foreground));
  opacity: 0.6;
  font-size: var(--text-xs);
  font-weight: 400;
}

/* Grid - Dense but breathable */
.pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: var(--space-6);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card size variations */
.pro-grid.size-medium {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.pro-grid.size-large {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.pro-grid.size-xlarge {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

/* Card - Information dense with subtle hover */
.pro-card {
  position: relative;
  aspect-ratio: 1;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
}

.pro-card:hover {
  border-color: hsl(var(--ring));
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

.pro-card-image-wrapper {
  width: 100%;
  height: 74%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4%;
  box-sizing: border-box;
  background: #ffffff;
  overflow: hidden;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.pro-card-image {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.94;
  transition: opacity 200ms;
}

.pro-card:hover .pro-card-image {
  opacity: 1;
}

.pro-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsl(var(--muted)) 0%, hsl(var(--secondary)) 100%);
  color: hsl(var(--muted-foreground));
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Card indicators - Minimalist */
.pro-card-indicators {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  right: var(--space-2);
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  z-index: 2;
}

.pro-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.pro-indicator:hover {
  transform: scale(1.15);
  background: hsl(var(--background));
  box-shadow: var(--shadow-md);
}

.pro-indicator svg {
  width: 11px;
  height: 11px;
  color: hsl(var(--foreground));
}

.pro-indicator.favorited {
  background: hsl(var(--highlight-amber));
}

.pro-indicator.favorited svg {
  color: white;
  fill: white;
}

.pro-badge-new {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  padding: 2px 6px;
  background: hsl(var(--highlight-green));
  color: white;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
  opacity: 0.75;
  z-index: 2;
}

/* Product tags - shadcn style */
.pro-product-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  line-height: 1.4;
  opacity: 0.85;
}

/* Card info overlay - Typography focused */
.pro-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3);
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.75) 40%,
    rgba(0, 0, 0, 0.5) 70%,
    transparent 100%);
  z-index: 1;
  backdrop-filter: blur(4px);
}

body[data-theme="dark"] .pro-card-info {
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.8) 40%,
    rgba(0, 0, 0, 0.6) 70%,
    transparent 100%);
}

.pro-card-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.pro-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* Micro chart in card */
.pro-micro-chart {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 10px;
}

.pro-micro-bar {
  width: 2px;
  background: hsl(var(--background) / 0.5);
  border-radius: 1px;
  transition: background 150ms;
}

.pro-card:hover .pro-micro-bar {
  background: hsl(var(--background) / 0.8);
}


.pro-tooltip-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}

.pro-tooltip-description {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.pro-tooltip-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid hsl(var(--border));
}

.pro-tooltip-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pro-tooltip-label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}

.pro-tooltip-value {
  font-size: var(--text-md);
  font-family: var(--font-mono);
  font-weight: 700;
  color: hsl(var(--foreground));
}

/* Loading state */
.pro-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: hsl(var(--muted-foreground));
}

.pro-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-3);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pro-loading-text {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* Toast notifications */
.pro-toast {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: var(--space-2) var(--space-3);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  opacity: 0;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1000;
}

.pro-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pro-toast.success {
  border-color: hsl(var(--highlight-green));
  background: hsl(var(--highlight-green) / 0.25);
  color: hsl(var(--highlight-green));
}

.pro-toast.error {
  border-color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.25);
  color: hsl(var(--destructive));
}

/* No results */
.pro-no-results {
  text-align: center;
  padding: var(--space-8);
  color: hsl(var(--muted-foreground));
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* Access disclaimer */
.pro-disclaimer {
  background: linear-gradient(135deg,
    hsl(var(--highlight-violet) / 0.08),
    hsl(var(--highlight-blue) / 0.08));
  border: 1px solid hsl(var(--highlight-violet) / 0.2);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: hsl(var(--foreground));
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.pro-disclaimer-icon {
  width: 16px;
  height: 16px;
  color: hsl(var(--highlight-violet));
  flex-shrink: 0;
  margin-top: 2px;
}

.pro-disclaimer-text {
  line-height: 1.5;
}

.pro-disclaimer-text strong {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

/* Theme switcher - Fixed position */
.theme-switcher {
  position: fixed;
  top: 32px;
  right: 0;
  z-index: 3000;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-top: none;
  border-radius: 0 0 4px 4px;
  min-width: 172px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
}

.theme-switcher.collapsed {
  display: none;
}

.settings-section {
  padding: 8px 10px;
}

.settings-section-label {
  font-size: 7px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.settings-divider {
  height: 1px;
  background: hsl(var(--border));
}

.theme-switcher select {
  width: 100%;
  padding: 4px 6px;
  font-size: 9px;
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  border: 1px solid hsl(var(--border));
  border-radius: 3px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: border-color 150ms;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23999' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}

.theme-switcher select:focus {
  border-color: hsl(var(--ring));
}

.size-toggle {
  display: flex;
  gap: 1px;
  background: hsl(var(--muted));
  padding: 1px;
  border-radius: 3px;
}

.size-btn,
.tile-style-btn {
  flex: 1;
  padding: 3px 4px;
  font-size: 8px;
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.12s ease;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.size-btn:hover,
.tile-style-btn:hover {
  color: hsl(var(--foreground));
}

.size-btn.active,
.tile-style-btn.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.size-btn:focus-visible,
.tile-style-btn:focus-visible {
  outline: 1px solid hsl(var(--ring));
  outline-offset: 1px;
}

/* Responsive */
@media (max-width: 1024px) {
  .pro-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Mobile Header Tiles - Hidden by default */
.mobile-header-tiles {
  display: none;
}

/* Desktop logo shown by default */
.pro-logo-desktop {
  display: block;
}

.pro-logo-mobile {
  display: none;
}

@media (max-width: 768px) {
  .pro-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  /* Hide desktop header */
  .pro-header {
    display: none;
  }

  /* Hide large size option in mobile view */
  .size-btn[data-size="large"] {
    display: none;
  }

  /* Show mobile header tiles - default to medium size (180px) */
  .mobile-header-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    margin-bottom: var(--space-4);
  }

  /* Mobile header tiles size variations */
  .mobile-header-tiles.size-small {
    grid-template-columns: 1fr;
  }

  .mobile-header-tiles.size-medium {
    grid-template-columns: 1fr;
  }

  .mobile-header-tiles.size-large {
    grid-template-columns: 1fr;
  }

  .mobile-tile {
    position: relative;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
  }

  .mobile-logo-tile {
    display: none;
  }

  .mobile-tile-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
  }

  /* Combined tile with demo mode, user info, and dark mode toggle */
  .mobile-combined-tile {
    padding: var(--space-3);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }

  .mobile-combined-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
  }

  .mobile-demo-banner {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ff9a00 0%, #ff6b00 100%);
    color: white;
    text-align: center;
  }

  /* Horizontal divider for user info and dark mode toggle */
  .mobile-horizontal-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    flex: 1;
  }

  .mobile-user-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-1);
    flex: 1;
    min-width: 0;
  }

  .mobile-user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    width: 100%;
  }

  .mobile-user-email {
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: hsl(var(--foreground));
    font-weight: 500;
    text-align: left;
    word-break: break-word;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-user-role {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 3px;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font-weight: 600;
  }

  .mobile-user-role.role-superadmin,
  .mobile-user-role.role-admin {
    background: hsl(var(--highlight-blue));
    color: white;
  }

  .mobile-loading-text {
    font-size: var(--text-sm);
    color: hsl(var(--muted-foreground));
    text-align: left;
  }

  .mobile-darkmode-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .dark-mode-toggle-mobile {
    width: 40px;
    height: 40px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    flex-shrink: 0;
  }

  .dark-mode-toggle-mobile:hover {
    background: hsl(var(--accent));
  }

  .dark-mode-toggle-mobile:active {
    transform: scale(0.95);
  }

  .dark-mode-toggle-mobile svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
    color: hsl(var(--foreground));
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sun-icon-mobile {
    display: block;
  }

  .moon-icon-mobile {
    display: none;
  }

  body[data-theme="dark"] .sun-icon-mobile {
    display: none;
  }

  body[data-theme="dark"] .moon-icon-mobile {
    display: block;
  }

  .pro-tooltip {
    display: none;
  }

  .pro-search-stats {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  .pro-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pro-search-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .theme-switcher {
    bottom: var(--space-2);
    right: var(--space-2);
  }
}

/* Footer */
.pro-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-4);
  background: hsl(var(--background));
  border-top: 1px solid hsl(var(--border));
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  z-index: 100;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-logo {
  height: 20px;
  width: auto;
  opacity: 0.8;
}

body[data-theme="dark"] .footer-logo {
  filter: invert(1) hue-rotate(180deg) saturate(2);
}

body[data-theme="dark"] .footer-branding span,
body[data-theme="dark"] .footer-copyright {
  color: rgba(255,255,255,0.6);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  opacity: 0.7;
}

/* Video modal */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  opacity: 1;
}

.brainfreeze-video {
  width: auto;
  height: 100vh;
  object-fit: contain;
}

/* Fullscreen loading overlay */
.fullscreen-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

body[data-theme="dark"] .fullscreen-loader {
  background: rgba(0, 0, 0, 0.4);
}

.fullscreen-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.loader-gif {
  width: auto;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

@media (max-width: 768px) {
  .fullscreen-loader {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .loader-content {
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
  }

  .loader-gif {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
  }
}

/* Whack-a-mole appstore icon */
.whack-a-mole-icon {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  pointer-events: none !important;
  z-index: 9999 !important;
  opacity: 0 !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) !important;
  display: block !important;
}

.whack-a-mole-icon.visible {
  opacity: 1 !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .whack-a-mole-icon {
    display: none !important;
  }
}

/* Focus visible for keyboard navigation */
.pro-card:focus-visible,
.pro-indicator:focus-visible,
.pro-search-input:focus-visible,
.theme-switcher select:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
