/* Neumorphic Design System for Claude Code Templates */
/* Soft grey light mode & Gunmetal dark mode with neumorphic shadows */

:root {
  /* Light Mode Colors (Soft Grey) */
  --bg-color-light: #e8e8e8;
  --surface-color-light: #e8e8e8;
  --text-primary-light: #1a1a1a;
  --text-secondary-light: #4a4a4a;
  --accent-light: #ff6b35;
  --shadow-light: rgba(174, 174, 192, 0.4);
  --shadow-light-inset: rgba(174, 174, 192, 0.5);
  --highlight-light: rgba(255, 255, 255, 0.8);
  
  /* Dark Mode Colors (Deep Blue-Grey) */
  --bg-color-dark: #1e2a3a;
  --surface-color-dark: #253344;
  --text-primary-dark: #ffffff;
  --text-secondary-dark: #b8c5d1;
  --accent-dark: #ff6b35;
  --shadow-dark: rgba(15, 20, 28, 0.8);
  --shadow-dark-inset: rgba(15, 20, 28, 0.9);
  --highlight-dark: rgba(37, 51, 68, 0.7);
  
  /* Neumorphic Shadow Distances */
  --shadow-distance: 6px;
  --shadow-distance-hover: 3px;
  --shadow-distance-pressed: 1px;
  --shadow-blur: 12px;
  --shadow-blur-hover: 8px;
  --shadow-blur-pressed: 4px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 20px;
  --radius-xl: 30px;
}

/* Dark Mode (default) */
:root {
  --bg-color: var(--bg-color-dark);
  --surface-color: var(--surface-color-dark);
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --accent: var(--accent-dark);
  --shadow-color: var(--shadow-dark);
  --shadow-inset-color: var(--shadow-dark-inset);
  --highlight-color: var(--highlight-dark);
}

/* Light Mode */
[data-theme="light"] {
  --bg-color: var(--bg-color-light);
  --surface-color: var(--surface-color-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --accent: var(--accent-light);
  --shadow-color: var(--shadow-light);
  --shadow-inset-color: var(--shadow-light-inset);
  --highlight-color: var(--highlight-light);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color var(--transition-medium),
              color var(--transition-medium);
}

body {
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  transition: all var(--transition-medium);
}

/* Neumorphic Elements */

/* Outdented (Raised) Elements */
.neu-raised,
.neu-button {
  background: var(--surface-color);
  box-shadow: 
    var(--shadow-distance) var(--shadow-distance) var(--shadow-blur) var(--shadow-color),
    calc(var(--shadow-distance) * -1) calc(var(--shadow-distance) * -1) var(--shadow-blur) var(--highlight-color);
  transition: all var(--transition-fast);
}

.neu-raised:hover,
.neu-button:hover {
  box-shadow: 
    var(--shadow-distance-hover) var(--shadow-distance-hover) var(--shadow-blur-hover) var(--shadow-color),
    calc(var(--shadow-distance-hover) * -1) calc(var(--shadow-distance-hover) * -1) var(--shadow-blur-hover) var(--highlight-color);
  transform: translateY(-1px);
}

/* Indented (Pressed) Elements */
.neu-pressed,
.neu-input,
.neu-button:active {
  background: var(--surface-color);
  box-shadow: 
    inset var(--shadow-distance-pressed) var(--shadow-distance-pressed) var(--shadow-blur-pressed) var(--shadow-inset-color),
    inset calc(var(--shadow-distance-pressed) * -1) calc(var(--shadow-distance-pressed) * -1) var(--shadow-blur-pressed) var(--highlight-color);
}

/* Flat Elements */
.neu-flat {
  background: var(--surface-color);
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.neu-button {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-medium);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.neu-button:active {
  transform: translateY(1px);
}

.neu-button.primary {
  background: linear-gradient(145deg, var(--accent), var(--accent));
  color: white;
}

.neu-button.primary:hover {
  filter: brightness(1.1);
}

/* Button Variants */
.neu-button.icon-only {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.neu-button.large {
  padding: 16px 32px;
  font-size: 18px;
  border-radius: var(--radius-large);
}

.neu-button.small {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: var(--radius-small);
}

/* Cards */
.neu-card {
  background: var(--surface-color);
  border-radius: var(--radius-large);
  padding: 24px;
  margin: 16px;
  box-shadow: 
    8px 8px 16px var(--shadow-color),
    -8px -8px 16px var(--highlight-color);
  transition: all var(--transition-medium);
}

.neu-card:hover {
  box-shadow: 
    12px 12px 20px var(--shadow-color),
    -12px -12px 20px var(--highlight-color);
  transform: translateY(-2px);
}

/* Inputs */
.neu-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-medium);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--surface-color);
  transition: all var(--transition-fast);
}

.neu-input:focus {
  outline: none;
  box-shadow: 
    inset 3px 3px 6px var(--shadow-inset-color),
    inset -3px -3px 6px var(--highlight-color),
    0 0 0 2px var(--accent);
}

/* Search Box */
.neu-search {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.neu-search input {
  width: 100%;
  padding: 14px 48px 14px 20px;
  border: none;
  border-radius: var(--radius-xl);
  background: var(--surface-color);
  color: var(--text-primary);
  font-size: 16px;
  box-shadow: 
    inset 4px 4px 8px var(--shadow-inset-color),
    inset -4px -4px 8px var(--highlight-color);
}

.neu-search button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-color);
  cursor: pointer;
  box-shadow: 
    2px 2px 4px var(--shadow-color),
    -2px -2px 4px var(--highlight-color);
}

/* Theme Toggle Switch */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 70px;
  height: 36px;
  background: var(--surface-color);
  border-radius: var(--radius-xl);
  padding: 4px;
  cursor: pointer;
  box-shadow: 
    inset 2px 2px 4px var(--shadow-inset-color),
    inset -2px -2px 4px var(--highlight-color);
  transition: all var(--transition-medium);
}

.theme-toggle-slider {
  width: 28px;
  height: 28px;
  background: linear-gradient(145deg, var(--accent), #ff8c5a);
  border-radius: 50%;
  transition: transform var(--transition-medium);
  box-shadow: 
    2px 2px 4px var(--shadow-color),
    -2px -2px 4px var(--highlight-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-slider::before {
  content: "☀️";
  font-size: 16px;
}

[data-theme="dark"] .theme-toggle-slider {
  transform: translateX(34px);
}

[data-theme="dark"] .theme-toggle-slider::before {
  content: "🌙";
}

/* Chip/Tag Elements */
.neu-chip {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  background: var(--surface-color);
  color: var(--text-secondary);
  font-size: 14px;
  margin: 4px;
  box-shadow: 
    3px 3px 6px var(--shadow-color),
    -3px -3px 6px var(--highlight-color);
  transition: all var(--transition-fast);
}

.neu-chip:hover {
  color: var(--text-primary);
  transform: scale(1.05);
}

/* Grid Layout for Templates */
.neu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px;
}

/* Navigation */
.neu-nav {
  background: var(--surface-color);
  padding: 16px 32px;
  box-shadow: 
    0 4px 8px var(--shadow-color),
    0 -2px 4px var(--highlight-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(var(--surface-color), 0.9);
}

/* Tabs */
.neu-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--surface-color);
  border-radius: var(--radius-large);
  box-shadow: 
    inset 2px 2px 4px var(--shadow-inset-color),
    inset -2px -2px 4px var(--highlight-color);
}

.neu-tab {
  padding: 10px 20px;
  border-radius: var(--radius-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.neu-tab.active {
  background: var(--surface-color);
  color: var(--text-primary);
  box-shadow: 
    4px 4px 8px var(--shadow-color),
    -4px -4px 8px var(--highlight-color);
}

/* Divider */
.neu-divider {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--shadow-color) 20%,
    var(--highlight-color) 50%,
    var(--shadow-color) 80%,
    transparent
  );
  margin: 24px 0;
  border-radius: 2px;
}

/* Loading Animation */
.neu-loading {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-color);
  box-shadow: 
    4px 4px 8px var(--shadow-color),
    -4px -4px 8px var(--highlight-color);
  animation: neu-pulse 1.5s ease-in-out infinite;
}

@keyframes neu-pulse {
  0%, 100% {
    box-shadow: 
      4px 4px 8px var(--shadow-color),
      -4px -4px 8px var(--highlight-color);
  }
  50% {
    box-shadow: 
      inset 2px 2px 4px var(--shadow-inset-color),
      inset -2px -2px 4px var(--highlight-color);
  }
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--surface-color);
  border-radius: var(--radius-small);
  box-shadow: 
    inset 2px 2px 4px var(--shadow-inset-color),
    inset -2px -2px 4px var(--highlight-color);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-color);
  border-radius: var(--radius-small);
  box-shadow: 
    2px 2px 4px var(--shadow-color),
    -2px -2px 4px var(--highlight-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Orange ASCII Title - Keep Original Style */
.ascii-title {
  color: #ff6b35 !important;
  background: linear-gradient(90deg, #ff6b35, #ff8c5a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(255, 107, 53, 0.2);
  font-family: monospace;
  white-space: pre;
  line-height: 1.2;
}

/* Responsive Design */
@media (max-width: 768px) {
  .neu-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  
  .neu-card {
    padding: 16px;
    margin: 8px;
  }
  
  .theme-toggle {
    top: 10px;
    right: 10px;
  }
}

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

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}