/* ═══════════════════════════════════════════════════════════
   ENHANCED UI - Centered, Modern, Customizable Design
   ═══════════════════════════════════════════════════════════ */

/* Enhanced Hero Section - More Centered */
#home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  padding: 40px 24px 60px;
  position: relative;
  z-index: auto;
}

#home.shifted {
  min-height: auto;
  padding: 24px 24px 24px;
  justify-content: flex-start;
}

/* Enhanced Logo Block - Better Centering */
.logo-block {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
  max-width: 800px;
  width: 100%;
  position: relative;
  z-index: 100;
}

#home.shifted .logo-block {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Enhanced Logo - More Prominent */
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 7vw, 84px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--txt);
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--txt) 0%, var(--red2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  transition: font-size 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#home.shifted .logo {
  font-size: clamp(22px, 4vw, 36px);
  margin-bottom: 0;
}

.logo span {
  color: var(--red);
  -webkit-text-fill-color: var(--red);
}

/* Enhanced Subtitle */
.logo-sub {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--txt2);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
  opacity: 0.9;
  animation: fadeInUp 0.8s 0.1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

#home.shifted .logo-sub {
  display: none;
}

/* Enhanced Search Container - Better Centering */
.search-outer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  animation: fadeInUp 0.8s 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
  position: relative;
  z-index: 100;
}

/* Enhanced Search Box - Modern Design */
.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 4px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.search-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red2) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}

.search-box:hover {
  border-color: rgba(214, 48, 49, 0.2);
  transform: translateY(-1px);
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-box:focus-within {
  border-color: var(--red);
  box-shadow: 
    0 0 0 3px rgba(214, 48, 49, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.search-box:focus-within::before {
  opacity: 0.5;
}

/* Enhanced Search Icon */
.search-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt3);
  transition: all 0.3s;
  flex-shrink: 0;
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

.search-box:focus-within .search-icon {
  color: var(--red);
  transform: scale(1.1);
}

/* Enhanced Search Input */
#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--txt);
  padding: 16px 8px;
  caret-color: var(--red2);
  min-width: 0;
}

#searchInput::placeholder {
  color: var(--txt3);
  opacity: 0.7;
}

/* Enhanced Search Button */
.search-go {
  margin: 4px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--red) 0%, #c62828 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 
    0 2px 8px rgba(214, 48, 49, 0.3),
    0 1px 4px rgba(214, 48, 49, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.search-go::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.search-go:hover {
  background: linear-gradient(135deg, var(--red2) 0%, var(--red) 100%);
  box-shadow: 
    0 4px 16px rgba(214, 48, 49, 0.4),
    0 2px 8px rgba(214, 48, 49, 0.25);
  transform: translateY(-1px);
}

.search-go:hover::before {
  opacity: 1;
}

.search-go:active {
  transform: translateY(0);
}

/* Enhanced Search Hint */
.search-hint {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 16px;
  text-align: center;
  animation: fadeInUp 0.8s 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  opacity: 0.8;
}

.search-hint kbd {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  padding: 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--txt2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0 2px;
}

#home.shifted .search-hint {
  display: none;
}

/* Enhanced Controls Bar */
.controls-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  animation: fadeInUp 0.8s 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
  width: 100%;
}

#home.shifted .controls-bar {
  display: flex;
}

/* Entity Type Filter */
#entityTypeFilter {
  transition: border-color 0.2s, box-shadow 0.2s;
}

#entityTypeFilter:hover {
  border-color: var(--border2);
}

#entityTypeFilter:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.1);
}

/* Enhanced Pills */
.pill {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--txt3);
  letter-spacing: 0.01em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pill:hover {
  color: var(--txt);
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pill.active-tab {
  color: var(--amber);
  border-color: rgba(253, 203, 110, 0.3);
  background: var(--amber-bg);
  box-shadow: 
    0 0 0 1px rgba(253, 203, 110, 0.08),
    0 2px 6px rgba(253, 203, 110, 0.15);
  transform: translateY(-1px);
}

/* Enhanced Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Enhanced Hero Background */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(214, 48, 49, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(214, 48, 49, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(214, 48, 49, 0.02) 0%, transparent 50%),
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.01) 50%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, 0.01) 50%, transparent 52%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 80px 80px, 80px 80px;
  opacity: 0.5;
  animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.3;
  }
}

#home.shifted .hero-bg {
  opacity: 0.15;
}

/* Customization Panel */
.customize-panel {
  position: fixed;
  right: 24px;
  top: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.customize-toggle {
  position: fixed;
  right: 24px;
  top: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customize-toggle:hover {
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.customize-section {
  margin-bottom: 24px;
}

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

.customize-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--txt3);
  margin-bottom: 12px;
  display: block;
}

.customize-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.customize-option:last-child {
  border-bottom: none;
}

.customize-option-label {
  font-size: 13px;
  color: var(--txt2);
}

.customize-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--surface2);
  outline: none;
  -webkit-appearance: none;
  margin: 8px 0;
}

.customize-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(214, 48, 49, 0.4);
  transition: all 0.2s;
}

.customize-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(214, 48, 49, 0.6);
}

.customize-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(214, 48, 49, 0.4);
  transition: all 0.2s;
}

.customize-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(214, 48, 49, 0.6);
}

.customize-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.customize-toggle-switch.active {
  background: var(--red);
}

.customize-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.customize-toggle-switch.active::after {
  transform: translateX(20px);
}

.customize-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch.active {
  border-color: var(--txt);
  transform: scale(1.1);
}

/* Responsive Improvements */
@media (max-width: 768px) {
  #home {
    padding: 60px 16px 60px;
  }
  
  .logo {
    font-size: clamp(40px, 10vw, 72px);
  }
  
  .logo-sub {
    font-size: 14px;
  }
  
  .search-outer {
    max-width: 100%;
  }
  
  .search-box {
    border-radius: 14px;
  }
  
  #searchInput {
    font-size: 16px;
    padding: 14px 8px;
  }
  
  .search-go {
    padding: 12px 20px;
    font-size: 13px;
  }
  
  .customize-panel {
    right: 16px;
    top: 70px;
    width: calc(100% - 32px);
    max-width: 320px;
  }
  
  .customize-toggle {
    right: 16px;
    top: 70px;
  }
}

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

/* Print Styles */
@media print {
  .customize-panel,
  .customize-toggle,
  .hero-bg {
    display: none !important;
  }
}
