/* Nothing Phone UI/UX Design System */

:root {
  /* Color Palette - E-Reader Style (Light Mode) */
  --nothing-black: #1A1A1A;
  --nothing-white: #F8F8F8;
  --nothing-red: #FF3B30;
  --nothing-red-hover: #FF6259;

  --nothing-gray-900: #F8F8F8;
  --nothing-gray-800: #F0F0F0;
  --nothing-gray-700: #E5E5E5;
  --nothing-gray-600: #CCCCCC;
  --nothing-gray-500: #999999;
  --nothing-gray-400: #666666;
  --nothing-gray-300: #4D4D4D;
  --nothing-gray-200: #333333;
  --nothing-gray-100: #1A1A1A;

  /* Glass Effects for Light Mode */
  --nothing-glass: rgba(255, 255, 255, 0.6);
  --nothing-glass-hover: rgba(255, 255, 255, 0.8);
  --nothing-glass-border: rgba(0, 0, 0, 0.08);
  --nothing-glass-border-hover: rgba(0, 0, 0, 0.12);

  /* Shadows */
  --nothing-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --nothing-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
  --nothing-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.06);
  --nothing-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  --nothing-glow-red: 0 0 20px rgba(255, 59, 48, 0.3);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 80px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Animation */
  --transition-fast: 150ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0.0, 0.2, 1);

  /* Z-Index */
  --z-base: 1;
  --z-nav: 100;
  --z-modal: 1000;
  --z-tooltip: 2000;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--nothing-white);
  color: var(--nothing-black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--nothing-black);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--nothing-gray-300);
  margin: 0 0 var(--space-4) 0;
}

/* Glass Card Component */
.nothing-card {
  background: var(--nothing-glass);
  border: 1px solid var(--nothing-glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-base);
  box-shadow: var(--nothing-shadow-sm);
}

.nothing-card:hover {
  background: var(--nothing-glass-hover);
  border-color: var(--nothing-glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--nothing-shadow-lg);
}

.nothing-card-header {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--nothing-black);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nothing-card-body {
  color: var(--nothing-gray-300);
}

/* Nothing Button */
.nothing-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--nothing-glass-border);
  background: var(--nothing-glass);
  color: var(--nothing-black);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nothing-btn:hover {
  background: var(--nothing-glass-hover);
  border-color: var(--nothing-glass-border-hover);
  transform: scale(1.02);
}

.nothing-btn-primary {
  background: var(--nothing-red);
  border-color: var(--nothing-red);
  box-shadow: var(--nothing-glow-red);
}

.nothing-btn-primary:hover {
  background: var(--nothing-red-hover);
  border-color: var(--nothing-red-hover);
  transform: scale(1.05);
}

/* Dot Matrix Pattern */
.nothing-dots {
  position: relative;
  overflow: hidden;
}

.nothing-dots::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
    circle,
    var(--nothing-gray-700) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}

/* Glyph Icons */
.nothing-glyph {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--nothing-glass);
  border: 1px solid var(--nothing-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all var(--transition-fast);
}

.nothing-glyph:hover {
  background: var(--nothing-red);
  border-color: var(--nothing-red);
  box-shadow: var(--nothing-glow-red);
  transform: scale(1.1) rotate(5deg);
}

/* Navigation Graph Container */
.nothing-graph-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-nav);
  background: var(--nothing-white);
  transition: transform var(--transition-slow);
  display: block;
  visibility: visible;
}

.nothing-graph-container.minimized {
  transform: translateY(-100vh);
  pointer-events: none;
}

/* Graph Navigation Controls */
.nothing-graph-controls {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: calc(var(--z-nav) + 1);
  display: flex;
  gap: var(--space-3);
}

.nothing-graph-control-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--nothing-glass);
  border: 1px solid var(--nothing-glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--nothing-white);
}

.nothing-graph-control-btn:hover {
  background: var(--nothing-red);
  border-color: var(--nothing-red);
  box-shadow: var(--nothing-glow-red);
  transform: scale(1.1);
}

/* Content Container */
.nothing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* Grid System */
.nothing-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Loading Animation */
.nothing-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.nothing-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--nothing-red);
  animation: nothing-pulse 1.4s ease-in-out infinite;
}

.nothing-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.nothing-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes nothing-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Page Transitions */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all var(--transition-base);
}

.page-exit {
  opacity: 1;
}

.page-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: all var(--transition-fast);
}

/* Responsive */
@media (max-width: 768px) {
  .nothing-container {
    padding: var(--space-4);
  }

  .nothing-card {
    padding: var(--space-4);
  }

  .nothing-graph-controls {
    bottom: var(--space-4);
    top: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Accessibility */
.nothing-focus-visible:focus-visible {
  outline: 2px solid var(--nothing-red);
  outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
  background: var(--nothing-gray-900);
}

::-webkit-scrollbar-thumb {
  background: var(--nothing-gray-700);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nothing-gray-600);
}

/* Selection */
::selection {
  background: var(--nothing-red);
  color: var(--nothing-white);
}

/* Navigation Links */
.nothing-nav-link {
  color: var(--nothing-gray-300);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nothing-nav-link:hover {
  color: var(--nothing-black);
}

.nothing-nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--nothing-red);
  transition: width var(--transition-base);
}

.nothing-nav-link:hover::after {
  width: 100%;
}

/* Interactive Legend Styles */
.legend-item {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  position: relative;
}

.legend-item:hover {
  background: var(--nothing-glass-hover) !important;
  transform: translateX(4px);
}

.legend-item.legend-active {
  background: rgba(255, 255, 255, 0.3);
  border-left: 3px solid var(--nothing-red);
}

.legend-item.legend-inactive {
  background: rgba(0, 0, 0, 0.05);
  opacity: 0.4;
  border-left: 3px solid transparent;
}

.legend-item.legend-inactive:hover {
  opacity: 0.6;
}

.legend-item::after {
  content: '●';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--nothing-red);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.legend-item.legend-active::after {
  opacity: 1;
}

.legend-item.legend-inactive::after {
  content: '○';
  opacity: 0.5;
  color: var(--nothing-gray-500);
}
