/* ===========================
   App Shell — shell.css
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: #0a0a14;
}

/* ── App Frame ───────────────────────────────────────── */
#app-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

/* ── App Switcher Container ──────────────────────────── */
#app-switcher {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Extend hover zone to include tab + bar gap */
  padding-bottom: 24px;
  pointer-events: none; /* Only allow hover on visible internal elements */
}

/* Invisible stable hit area for the semicircle */
#app-switcher::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 24px;
  pointer-events: auto;
  z-index: 10;
  cursor: pointer;
}

/* ── Semicircle Tab ──────────────────────────────────── */
#switcher-tab {
  position: relative;
  width: 28px;
  height: 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-top: none;
  border-radius: 0 0 28px 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.25), 
    inset 0 -1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
  pointer-events: none; /* Hit area handled by #app-switcher::after */
}

#switcher-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(170deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Three dot indicator */
.tab-dots {
  display: flex;
  gap: 2px;
  align-items: center;
  margin-top: 2px;
  transition: opacity 0.2s;
}

.tab-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s;
  z-index: 2; /* Sit above the glossy gradient */
}

.tab-notch {
  display: none;
}

/* Hover state on the whole switcher zone (water drop out) */
#app-switcher.open #switcher-tab,
#app-switcher:hover #switcher-tab {
  opacity: 0;
  transform: translateY(16px) scale(0.6, 1.4);
}

#app-switcher:hover .tab-dots span {
  background: rgba(255, 255, 255, 0.9);
}

#app-switcher:hover .tab-dots span:nth-child(1) { transform: translateY(-1px); transition-delay: 0ms; }
#app-switcher:hover .tab-dots span:nth-child(2) { transform: translateY(-2px); transition-delay: 40ms; }
#app-switcher:hover .tab-dots span:nth-child(3) { transform: translateY(-1px); transition-delay: 80ms; }

/* ── App Bar ─────────────────────────────────────────── */
#app-bar {
  /* Water-drop / fall-down reveal */
  transform-origin: top center;
  transform: scaleY(0.4) translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
  margin-top: 6px;
}

/* Revealed state — triggered by JS adding .open */
#app-switcher.open #app-bar,
#app-switcher:hover #app-bar {
  transform: scaleY(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#app-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* Glassy overlay for the app bar */
#app-bar-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(170deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

#app-bar-inner > * {
  z-index: 1;
  position: relative;
}

/* ── App Icon Button ─────────────────────────────────── */
.app-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 6px;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 52px;
  outline: none;
}

.app-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px) scale(1.05);
}

.app-btn.active {
  background: rgba(255, 255, 255, 0.15);
}

.app-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: #ff6b6b;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.app-icon {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  transition: filter 0.18s, transform 0.18s;
}

.app-btn:hover .app-icon {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.app-btn.active .app-icon {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}

.app-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  white-space: nowrap;
  background-color: rgba(0, 0, 0, 0.35);
  padding: 2px 5px;
  border-radius: 6px;
  transition: color 0.18s, background-color 0.18s;
}

.app-btn:hover .app-label,
.app-btn.active .app-label {
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.6);
}

/* Separator between app groups */
.app-separator {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  margin: 0 2px;
}

/* ── Privacy Banner ──────────────────────────────────── */
#privacy-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  background: rgba(30, 30, 35, 0.65);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #fff;
  z-index: 2000;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  max-width: 90vw;
  width: max-content;
}

#privacy-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#privacy-banner.hidden {
  display: none;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-icon {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.banner-text {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.9);
}

.banner-text strong {
  font-weight: 600;
  color: #fff;
}

#banner-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 8px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

#banner-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: scale(1.05);
}

#banner-close:active {
  transform: scale(0.95);
}
