/* ════════════════════════════════════════════════════════════
   IZZAT BRAND OS · LAUNCHER (Launchpad-style popup) · v2
   ════════════════════════════════════════════════════════════
   Trigger flutuante + popup full-screen com grid + search.
   Shortcut: ⌘K (Mac) / Ctrl+K (Win) · ESC fecha · / focuses search.
   Features: chips · favs · recents · tooltip · ctx menu · stagger
   ════════════════════════════════════════════════════════════ */

/* Trigger flutuante (canto inferior direito) */
.iz-launcher-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 980px;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transition: transform .2s cubic-bezier(.25,.46,.45,.94), box-shadow .2s cubic-bezier(.25,.46,.45,.94);
}
.iz-launcher-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.iz-launcher-trigger:active { transform: translateY(0); }
.iz-launcher-trigger__icon {
  width: 22px; height: 22px;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(135deg,#FF6A00,#E25F02);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}
.iz-launcher-trigger__kbd {
  margin-left: 4px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-sm, 8px);
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.6875rem;
  color: #6e6e73;
  font-weight: 500;
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-trigger {
    background: rgba(28,28,30,0.92);
    border-color: rgba(255,255,255,0.12);
    color: #f5f5f7;
  }
  .iz-launcher-trigger__kbd { background: rgba(255,255,255,0.1); color: #aeaeb2; }
}
/* manual dark theme via html[data-theme="dark"] */
html[data-theme="dark"] .iz-launcher-trigger {
  background: rgba(28,28,30,0.92);
  border-color: rgba(255,255,255,0.12);
  color: #f5f5f7;
}
html[data-theme="dark"] .iz-launcher-trigger__kbd { background: rgba(255,255,255,0.1); color: #aeaeb2; }

/* Modal/overlay */
.iz-launcher-overlay {
  position: fixed; inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s cubic-bezier(.25,.46,.45,.94);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.iz-launcher-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.iz-launcher-panel {
  width: 100%;
  max-width: 980px;
  max-height: 88vh;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 50px 100px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: scale(0.96);
  transition: transform .3s cubic-bezier(.25,.46,.45,.94);
}
.iz-launcher-overlay[data-open="true"] .iz-launcher-panel { transform: scale(1); }
@media (prefers-color-scheme: dark) {
  .iz-launcher-panel {
    background: rgba(28,28,30,0.85);
    border-color: rgba(255,255,255,0.08);
  }
}
html[data-theme="dark"] .iz-launcher-panel {
  background: rgba(28,28,30,0.85);
  border-color: rgba(255,255,255,0.08);
}

/* Header */
.iz-launcher-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-head { border-bottom-color: rgba(255,255,255,0.08); }
}
html[data-theme="dark"] .iz-launcher-head { border-bottom-color: rgba(255,255,255,0.08); }
.iz-launcher-head__icon {
  flex-shrink: 0;
  color: #86868b;
}
.iz-launcher-head__input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  font: inherit;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-size: 1.0625rem;
  color: #1d1d1f;
  padding: 4px 0;
}
.iz-launcher-head__input::placeholder { color: #86868b; }
@media (prefers-color-scheme: dark) {
  .iz-launcher-head__input { color: #f5f5f7; }
}
html[data-theme="dark"] .iz-launcher-head__input { color: #f5f5f7; }
.iz-launcher-head__close {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 0; background: rgba(0,0,0,0.06);
  border-radius: 50%;
  color: #86868b;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.iz-launcher-head__close:hover { background: rgba(0,0,0,0.12); color: #1d1d1f; }
@media (prefers-color-scheme: dark) {
  .iz-launcher-head__close { background: rgba(255,255,255,0.1); }
  .iz-launcher-head__close:hover { background: rgba(255,255,255,0.16); color: #f5f5f7; }
}
html[data-theme="dark"] .iz-launcher-head__close { background: rgba(255,255,255,0.1); }
html[data-theme="dark"] .iz-launcher-head__close:hover { background: rgba(255,255,255,0.16); color: #f5f5f7; }

/* Chips · category filter */
.iz-launcher-chips {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-chips { border-bottom-color: rgba(255,255,255,0.08); }
}
html[data-theme="dark"] .iz-launcher-chips { border-bottom-color: rgba(255,255,255,0.08); }
.iz-launcher-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 0;
  border-radius: 980px;
  background: rgba(0,0,0,0.05);
  color: #6e6e73;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .18s cubic-bezier(.25,.46,.45,.94), color .18s cubic-bezier(.25,.46,.45,.94), transform .18s cubic-bezier(.25,.46,.45,.94);
}
.iz-launcher-chip:hover { background: rgba(0,0,0,0.08); color: #1d1d1f; transform: translateY(-1px); }
.iz-launcher-chip[aria-pressed="true"] {
  background: linear-gradient(135deg,#FF6A00,#E25F02);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255,106,0,0.3);
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-chip { background: rgba(255,255,255,0.08); color: #aeaeb2; }
  .iz-launcher-chip:hover { background: rgba(255,255,255,0.12); color: #f5f5f7; }
}
html[data-theme="dark"] .iz-launcher-chip { background: rgba(255,255,255,0.08); color: #aeaeb2; }
html[data-theme="dark"] .iz-launcher-chip:hover { background: rgba(255,255,255,0.12); color: #f5f5f7; }

/* Body · grid */
.iz-launcher-body {
  padding: 24px 24px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.iz-launcher-section { margin-bottom: 28px; }
.iz-launcher-section:last-child { margin-bottom: 0; }
.iz-launcher-section__title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  padding: 0 8px;
  opacity: 0;
  animation: iz-launcher-section-in .35s cubic-bezier(.25,.46,.45,.94) forwards;
  animation-delay: .08s;
}
@keyframes iz-launcher-section-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.iz-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
}
@media (max-width: 600px) {
  .iz-launcher-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

/* App tile */
.iz-launcher-app {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px;
  padding: 10px 6px;
  border-radius: var(--radius-md, 16px);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background .15s, transform .15s;
  opacity: 0;
  animation: iz-launcher-app-in .32s cubic-bezier(.25,.46,.45,.94) forwards;
  animation-delay: calc(var(--idx, 0) * 20ms);
}
@keyframes iz-launcher-app-in {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.iz-launcher-app:hover { background: rgba(0,0,0,0.04); transform: translateY(-2px); }
.iz-launcher-app:focus-visible {
  outline: 3px solid #FF6A00;
  outline-offset: 3px;
  background: rgba(255,106,0,0.08);
  border-radius: var(--radius-md, 16px);
}
.iz-launcher-app[aria-selected="true"],
.iz-launcher-app[aria-current="true"] {
  background: rgba(255,106,0,0.10);
}

/* a11y · sr-only · só leitor de tela vê */
.iz-launcher-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* a11y · focus-visible reforço nos interativos do launcher */
.iz-launcher-head__input:focus-visible,
.iz-launcher-head__close:focus-visible,
.iz-launcher-chip:focus-visible,
.iz-launcher-foot__theme:focus-visible,
.iz-launcher-app__star:focus-visible,
.iz-launcher-ctx button:focus-visible {
  outline: 3px solid #FF6A00;
  outline-offset: 2px;
  border-radius: 8px;
}
.iz-launcher-app__star:focus-visible {
  opacity: 1;
  transform: scale(1);
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-app:hover { background: rgba(255,255,255,0.06); }
}
html[data-theme="dark"] .iz-launcher-app:hover { background: rgba(255,255,255,0.06); }

.iz-launcher-app__icon {
  width: 56px; height: 56px;
  border-radius: 22.37%;
  background: linear-gradient(135deg,#FF6A00,#E25F02);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", monospace;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.12),
    0 1px 2px rgba(0,0,0,0.08),
    inset 0 1px 1px rgba(255,255,255,0.4);
}
.iz-launcher-app__name {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #1d1d1f;
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-app__name { color: #f5f5f7; }
}
html[data-theme="dark"] .iz-launcher-app__name { color: #f5f5f7; }

/* Star · favorite toggle */
.iz-launcher-app__star {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  color: #86868b;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .18s, transform .18s, color .15s, background .15s;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.iz-launcher-app:hover .iz-launcher-app__star,
.iz-launcher-app:focus-within .iz-launcher-app__star,
.iz-launcher-app__star.is-fav {
  opacity: 1;
  transform: scale(1);
}
.iz-launcher-app__star:hover { color: #FF6A00; background: #fff; }
.iz-launcher-app__star.is-fav {
  color: #FF6A00;
  background: rgba(255,255,255,0.95);
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-app__star { background: rgba(60,60,67,0.85); color: #aeaeb2; }
  .iz-launcher-app__star:hover { background: rgba(60,60,67,1); color: #FF6A00; }
  .iz-launcher-app__star.is-fav { background: rgba(60,60,67,0.95); }
}
html[data-theme="dark"] .iz-launcher-app__star { background: rgba(60,60,67,0.85); color: #aeaeb2; }
html[data-theme="dark"] .iz-launcher-app__star:hover { background: rgba(60,60,67,1); color: #FF6A00; }
html[data-theme="dark"] .iz-launcher-app__star.is-fav { background: rgba(60,60,67,0.95); }

/* Search highlight */
.iz-launcher-mark {
  background: rgba(255,106,0,0.18);
  color: #FF6A00;
  padding: 0 2px;
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-mark { background: rgba(255,106,0,0.25); color: #FF8C33; }
}
html[data-theme="dark"] .iz-launcher-mark { background: rgba(255,106,0,0.25); color: var(--accent-light, #FF8C33); }

/* Icon wiggle on click */
.iz-launcher-wiggle {
  animation: iz-launcher-wiggle 280ms cubic-bezier(.25,.46,.45,.94);
}
@keyframes iz-launcher-wiggle {
  0%   { transform: scale(1) rotate(0deg); }
  20%  { transform: scale(1.08) rotate(-6deg); }
  40%  { transform: scale(1.04) rotate(5deg); }
  60%  { transform: scale(1.06) rotate(-3deg); }
  80%  { transform: scale(1.02) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Empty state */
.iz-launcher-empty {
  text-align: center;
  padding: 60px 20px;
  color: #86868b;
  font-size: 0.9375rem;
}

/* Footer hint */
.iz-launcher-foot {
  padding: 10px 18px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: #86868b;
  flex-wrap: wrap;
}
.iz-launcher-foot__stats {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-foot { border-top-color: rgba(255,255,255,0.08); }
}
html[data-theme="dark"] .iz-launcher-foot { border-top-color: rgba(255,255,255,0.08); }
.iz-launcher-foot kbd {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-sm, 8px);
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.6875rem;
  margin: 0 2px;
}
@media (prefers-color-scheme: dark) {
  .iz-launcher-foot kbd { background: rgba(255,255,255,0.1); }
}
html[data-theme="dark"] .iz-launcher-foot kbd { background: rgba(255,255,255,0.1); }
.iz-launcher-foot__theme {
  border: 0;
  background: rgba(0,0,0,0.05);
  color: #6e6e73;
  padding: 4px 10px;
  border-radius: 980px;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.iz-launcher-foot__theme:hover { background: rgba(0,0,0,0.1); color: #1d1d1f; }
@media (prefers-color-scheme: dark) {
  .iz-launcher-foot__theme { background: rgba(255,255,255,0.08); color: #aeaeb2; }
  .iz-launcher-foot__theme:hover { background: rgba(255,255,255,0.14); color: #f5f5f7; }
}
html[data-theme="dark"] .iz-launcher-foot__theme { background: rgba(255,255,255,0.08); color: #aeaeb2; }
html[data-theme="dark"] .iz-launcher-foot__theme:hover { background: rgba(255,255,255,0.14); color: #f5f5f7; }

/* Tooltip */
.iz-launcher-tooltip {
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, 0);
  z-index: 10002;
  padding: 6px 10px;
  background: rgba(28,28,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: -0.01em;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s cubic-bezier(.25,.46,.45,.94);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iz-launcher-tooltip.is-visible { opacity: 1; }

/* Context menu */
.iz-launcher-ctx {
  position: fixed;
  top: 0; left: 0;
  z-index: 10003;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  padding: 4px;
  min-width: 180px;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.iz-launcher-ctx.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.iz-launcher-ctx button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm, 8px);
  font-family: inherit;
  font-size: 0.8125rem;
  color: #1d1d1f;
  cursor: pointer;
  transition: background .12s;
}
.iz-launcher-ctx button:hover { background: rgba(255,106,0,0.12); color: #FF6A00; }
@media (prefers-color-scheme: dark) {
  .iz-launcher-ctx {
    background: rgba(44,44,46,0.95);
    border-color: rgba(255,255,255,0.1);
  }
  .iz-launcher-ctx button { color: #f5f5f7; }
}
html[data-theme="dark"] .iz-launcher-ctx {
  background: rgba(44,44,46,0.95);
  border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .iz-launcher-ctx button { color: #f5f5f7; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .iz-launcher-overlay,
  .iz-launcher-panel,
  .iz-launcher-app,
  .iz-launcher-trigger,
  .iz-launcher-chip,
  .iz-launcher-app__star,
  .iz-launcher-tooltip,
  .iz-launcher-ctx,
  .iz-launcher-section__title { transition: none !important; animation: none !important; }
  .iz-launcher-panel { transform: none !important; }
  .iz-launcher-app { opacity: 1 !important; transform: none !important; }
  .iz-launcher-section__title { opacity: 1 !important; transform: none !important; }
  .iz-launcher-wiggle { animation: none !important; }
}

/* Mobile · full sheet */
@media (max-width: 600px) {
  .iz-launcher-overlay { padding: 0; align-items: stretch; }
  .iz-launcher-panel {
    max-height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
  .iz-launcher-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
}
