/* Launchpad View - Her Aesthetic */
/* Elegant, minimal app launcher with terracotta background */

:host {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-red, oklch(0.55 0.155 25));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  dynamic-range-limit: no-limit;
}

:host([open]) {
  opacity: 1;
  visibility: visible;
}

/* Header */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  font-family: var(--font-body, 'Cormorant Garamond', serif);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 400;
  color: oklch(1 0 0 / 0.85);
  letter-spacing: 0.08em;
}

/* Close button - elegant circle */
.close-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid oklch(1 0 0 / 0.35);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.close-btn:hover {
  border-color: oklch(1 0 0 / 0.7);
  background: oklch(1 0 0 / 0.1);
  transform: scale(1.02);
}

.close-btn:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}

.close-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: oklch(1 0 0 / 0.6);
  stroke-width: 1.5;
  stroke-linecap: round;
  fill: none;
  transition: stroke 0.15s ease;
}

.close-btn:hover svg {
  stroke: oklch(1 0 0 / 0.95);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Command Palette - Raycast/Warp-style search
   ═══════════════════════════════════════════════════════════════════════════ */

.command-palette {
  width: 100%;
  max-width: 560px;
  padding: 0 2rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

:host([open]) .command-palette {
  opacity: 1;
  transform: translateY(0);
}

.command-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: oklch(0 0 0 / 0.2);
  border: 1px solid oklch(1 0 0 / 0.15);
  border-radius: 16px;
  padding: 0 1rem;
  transition: all 0.2s ease;
}

.command-input-wrapper:focus-within {
  background: oklch(0 0 0 / 0.3);
  border-color: oklch(1 0 0 / 0.35);
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.2);
}

.command-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: oklch(1 0 0 / 0.5);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.command-input-wrapper:focus-within .command-icon {
  stroke: oklch(1 0 0 / 0.8);
}

.command-input {
  flex: 1;
  height: 3rem;
  padding: 0 0.75rem;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'SF Pro Text', -apple-system, system-ui, sans-serif;
  font-size: 1rem;
  color: oklch(1 0 0 / 0.95);
  caret-color: oklch(1 0 0 / 0.8);
}

.command-input::placeholder {
  color: oklch(1 0 0 / 0.4);
  font-style: italic;
}

/* Clear button - replaces shortcut when input has content */
.command-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.1);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.command-clear.visible {
  display: flex;
}

.command-clear:hover {
  background: oklch(1 0 0 / 0.18);
}

.command-clear:active {
  background: oklch(1 0 0 / 0.25);
}

.command-clear svg {
  width: 14px;
  height: 14px;
  stroke: oklch(1 0 0 / 0.6);
  stroke-width: 2;
  stroke-linecap: round;
}

.command-clear:hover svg {
  stroke: oklch(1 0 0 / 0.85);
}

.command-shortcut {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: oklch(1 0 0 / 0.35);
  padding: 0.25rem 0.5rem;
  background: oklch(1 0 0 / 0.08);
  border-radius: 6px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Search Results
   ═══════════════════════════════════════════════════════════════════════════ */

.search-results {
  width: 100%;
  max-width: 560px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0 2rem;
  margin-bottom: 1rem;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: oklch(1 0 0 / 0.5);
  font-style: italic;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.result-item:hover,
.result-item.selected {
  background: oklch(1 0 0 / 0.12);
}

.result-item.selected {
  background: oklch(1 0 0 / 0.18);
}

.result-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(1 0 0 / 0.08);
  border-radius: 10px;
  flex-shrink: 0;
}

.result-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: oklch(1 0 0 / 0.75);
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-content {
  flex: 1;
  min-width: 0;
}

.result-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: oklch(1 0 0 / 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-description {
  display: block;
  font-size: 0.8rem;
  color: oklch(1 0 0 / 0.5);
  margin-top: 0.125rem;
}

.result-shortcut {
  font-size: 1rem;
  color: oklch(1 0 0 / 0.4);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Apps Grid
   ═══════════════════════════════════════════════════════════════════════════ */

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  padding: 2rem;
  max-width: 500px;
}

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

/* App Card - minimal, just icon + name */
.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  padding: 1.25rem;
  border-radius: var(--radius-md, 20px);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(15px);
}

:host([open]) .app-card {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation */
:host([open]) .app-card:nth-child(1) { transition-delay: 0.05s; }
:host([open]) .app-card:nth-child(2) { transition-delay: 0.1s; }
:host([open]) .app-card:nth-child(3) { transition-delay: 0.15s; }
:host([open]) .app-card:nth-child(4) { transition-delay: 0.2s; }
:host([open]) .app-card:nth-child(5) { transition-delay: 0.25s; }
:host([open]) .app-card:nth-child(6) { transition-delay: 0.3s; }

.app-card:hover {
  background: oklch(1 0 0 / 0.08);
  transform: scale(1.05);
}

.app-card:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}

/* App Icon - NO border, just the beautiful vector icon */
.app-icon {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.app-card:hover .app-icon {
  transform: scale(1.05);
}

/* Icon SVG - clean line art */
.app-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  stroke: oklch(1 0 0 / 0.85);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}

.app-card:hover .app-icon svg {
  stroke: oklch(1 0 0);
}

/* App Name - elegant serif */
.app-name {
  font-family: var(--font-body, 'Cormorant Garamond', serif);
  font-style: italic;
  font-size: 0.9rem;
  color: oklch(1 0 0 / 0.7);
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.app-card:hover .app-name {
  color: oklch(1 0 0 / 0.95);
}

/* Active App Indicator - subtle underline */
.app-card[data-active="true"] .app-name {
  color: oklch(1 0 0 / 0.95);
}

.app-card[data-active="true"] .app-name::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: oklch(1 0 0 / 0.5);
  margin-top: 0.25rem;
}

/* Keyboard focus */
.app-card:focus-visible {
  outline: 1px solid oklch(1 0 0 / 0.6);
  outline-offset: 4px;
}

/* HDR Enhancement */
@media (dynamic-range: high) {
  .close-btn:hover {
    border-color: var(--hdr-white-bright, oklch(1.15 0 0));
  }

  .app-card:hover .app-icon svg {
    stroke: var(--hdr-white-peak, oklch(1.5 0 0));
  }

  .app-card:hover .app-name {
    color: var(--hdr-white-bright, oklch(1.15 0 0));
  }
}
