/* ==========================================================================
   DayDream X - Modern Cyberpunk Web Proxy Design System & Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* DayDreamX Color Palette */
  --bg-primary: #070913;
  --bg-secondary: #0d111f;
  --bg-tertiary: #13182c;
  --bg-elevated: rgba(19, 24, 44, 0.75);
  --bg-glass: rgba(15, 20, 36, 0.7);
  --bg-glass-card: rgba(22, 28, 50, 0.6);
  --bg-input: rgba(11, 15, 28, 0.85);

  --accent-purple: #a855f7;
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;

  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #06b6d4 100%);
  --accent-gradient-glow: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
  --accent-gradient-hover: linear-gradient(135deg, #c084fc 0%, #818cf8 50%, #22d3ee 100%);
  --accent-gradient-text: linear-gradient(135deg, #c084fc 0%, #38bdf8 50%, #a855f7 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(168, 85, 247, 0.35);
  --border-cyan-glow: rgba(6, 182, 212, 0.35);
  --border-card: rgba(255, 255, 255, 0.06);

  --status-online: #10b981;
  --status-warn: #f59e0b;
  --status-error: #ef4444;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Blurs */
  --glass-blur: blur(18px);
  --glass-blur-heavy: blur(32px);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px rgba(168, 85, 247, 0.25), 0 0 70px rgba(6, 182, 212, 0.15);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Ambient Cyberpunk Glow Background */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.35;
  animation: pulseBlob 14s ease-in-out infinite alternate;
}

.ambient-blob-1 {
  width: 600px;
  height: 600px;
  top: -10%;
  left: 15%;
  background: radial-gradient(circle, #7928ca 0%, rgba(121, 40, 202, 0) 70%);
}

.ambient-blob-2 {
  width: 700px;
  height: 700px;
  bottom: -15%;
  right: 10%;
  background: radial-gradient(circle, #0070f3 0%, rgba(0, 112, 243, 0) 70%);
  animation-delay: -5s;
}

.ambient-blob-3 {
  width: 500px;
  height: 500px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, #ff0080 0%, rgba(255, 0, 128, 0) 70%);
  opacity: 0.15;
  animation-delay: -9s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}

@keyframes pulseBlob {
  0% { transform: scale(1) translate(0, 0); opacity: 0.3; }
  50% { transform: scale(1.15) translate(40px, -30px); opacity: 0.45; }
  100% { transform: scale(0.9) translate(-30px, 40px); opacity: 0.25; }
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Header & Persistent DayDreamX Tab Strip
   ========================================================================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 62px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.5);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Tabs Bar */
.nav-tabs-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 800px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs-container::-webkit-scrollbar {
  display: none;
}

.tabs-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.browser-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  min-width: 140px;
  max-width: 220px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
  position: relative;
}

.browser-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.browser-tab.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--border-glow);
  color: var(--text-primary);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.2);
}

.browser-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

.tab-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.tab-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.tab-close {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.tab-new-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.tab-new-btn:hover {
  background: var(--accent-gradient-glow);
  border-color: var(--border-glow);
  color: var(--accent-cyan);
  transform: scale(1.05);
}

/* Nav Controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: var(--transition-fast);
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-warn);
  box-shadow: 0 0 8px currentColor;
}

.status-dot.online {
  background: var(--status-online);
  color: var(--status-online);
}

.status-dot.error {
  background: var(--status-error);
  color: var(--status-error);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.nav-btn.primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.nav-btn.primary:hover {
  box-shadow: 0 6px 22px rgba(168, 85, 247, 0.55);
  transform: translateY(-2px);
}

.nav-btn.tiktok-btn {
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.18) 0%, rgba(37, 244, 238, 0.18) 100%);
  border-color: rgba(254, 44, 85, 0.45);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(254, 44, 85, 0.25);
}

.nav-btn.tiktok-btn:hover {
  background: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%);
  color: #000;
  box-shadow: 0 0 20px rgba(254, 44, 85, 0.6);
  transform: translateY(-2px);
}

.nav-btn.gba-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-color: rgba(168, 85, 247, 0.45);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.nav-btn.gba-btn:hover {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
}

.nav-btn.roblox-btn {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.22) 0%, rgba(239, 68, 68, 0.22) 100%);
  border-color: rgba(225, 29, 72, 0.45);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.25);
}

.nav-btn.roblox-btn:hover {
  background: linear-gradient(135deg, #e11d48 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.6);
  transform: translateY(-2px);
}

.update-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  display: inline-block;
  margin-left: 2px;
}

.quick-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-pill-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.quick-pill-btn.tiktok-highlight {
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.18) 0%, rgba(37, 244, 238, 0.18) 100%);
  border-color: rgba(254, 44, 85, 0.4);
  color: #fff;
}

.quick-pill-btn.tiktok-highlight:hover {
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.4) 0%, rgba(37, 244, 238, 0.4) 100%);
  border-color: #fe2c55;
  box-shadow: 0 0 18px rgba(254, 44, 85, 0.5);
}

.quick-pill-btn.gba-highlight {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-color: rgba(168, 85, 247, 0.45);
  color: #fff;
}

.quick-pill-btn.gba-highlight:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(99, 102, 241, 0.4) 100%);
  border-color: var(--accent-purple);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.5);
}

.quick-pill-btn.roblox-highlight {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.22) 0%, rgba(239, 68, 68, 0.22) 100%);
  border-color: rgba(225, 29, 72, 0.45);
  color: #fff;
}

.quick-pill-btn.roblox-highlight:hover {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.45) 0%, rgba(239, 68, 68, 0.45) 100%);
  border-color: #e11d48;
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.55);
}

/* Updates Timeline */
.updates-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.update-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.update-card.latest {
  border-color: var(--border-glow);
  background: var(--accent-gradient-glow);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.update-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.update-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.update-version {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.update-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.update-card.latest .update-tag {
  background: var(--accent-gradient);
  color: #fff;
}

.update-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.update-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.update-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.update-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.update-item-icon {
  font-size: 0.8rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Main Layout */
.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

/* ==========================================================================
   Home Launcher View (DayDreamX Hero & Omnibox)
   ========================================================================== */
.launcher-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 62px);
  padding: 30px 20px 60px 20px;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  transition: opacity var(--transition-normal);
}

.launcher-view.hidden {
  display: none;
}

.hero-section {
  text-align: center;
  margin-bottom: 32px;
  max-width: 780px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient-glow);
  border: 1px solid var(--border-glow);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 18px;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 14px;
}

.hero-gradient-text {
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.4));
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* DayDreamX Search Container */
.search-container {
  width: 100%;
  max-width: 820px;
  margin-bottom: 48px;
}

.search-box-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glow);
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transition: var(--transition-normal);
}

.search-box-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.35), 0 0 60px rgba(168, 85, 247, 0.25);
  transform: translateY(-2px);
}

/* Engine Selector Dropdown */
.engine-dropdown {
  position: relative;
  flex-shrink: 0;
}

.engine-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.engine-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glow);
}

.engine-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
  animation: fadeInDown 0.2s ease-out forwards;
}

.engine-menu.active {
  display: flex;
}

.engine-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.engine-option:hover, .engine-option.active {
  background: var(--accent-gradient-glow);
  color: var(--text-primary);
  border: 1px solid var(--border-glow);
}

/* Search Input Field */
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 10px 0;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition-fast);
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.search-clear-btn.visible {
  display: flex;
}

.search-submit-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-lg);
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.search-submit-btn:hover {
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.6);
  transform: translateY(-1px);
}

/* ==========================================================================
   Featured Apps & Games Catalog (DayDreamX Catalog)
   ========================================================================== */
.apps-catalog-section {
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-gradient-glow);
  border-color: var(--border-glow);
  color: var(--accent-cyan);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-glass-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  background: rgba(28, 35, 62, 0.85);
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(168, 85, 247, 0.2);
}

.app-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: var(--transition-fast);
}

.app-card:hover .app-card-icon {
  background: var(--accent-gradient-glow);
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

.app-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.app-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   In-App Browser Viewport & Navigation Bar
   ========================================================================== */
.browser-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 62px);
  background: var(--bg-primary);
}

.browser-view.hidden {
  display: none;
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  height: 48px;
}

.nav-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
}

.nav-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.browser-omnibox {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  height: 34px;
  transition: var(--transition-fast);
}

.browser-omnibox:focus-within {
  border-color: var(--border-glow);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.omnibox-security {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--status-online);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.omnibox-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
}

.browser-viewport {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

.proxy-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  display: block;
}

.loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-cyan);
  transition: width 0.3s ease;
  z-index: 10;
  opacity: 0;
}

.loading-bar.active {
  opacity: 1;
  animation: loadingProgress 2s infinite ease-in-out;
}

@keyframes loadingProgress {
  0% { width: 0%; left: 0%; }
  50% { width: 70%; left: 15%; }
  100% { width: 100%; left: 100%; }
}

/* ==========================================================================
   DayDreamX Settings & Wisp Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.8);
  backdrop-filter: var(--glass-blur-heavy);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 680px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 16px;
}

.modal-tab-btn {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-tab-btn:hover {
  color: var(--text-primary);
}

.modal-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.settings-tab-content {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.settings-tab-content.active {
  display: flex;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-label {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Wisp Option Cards */
.wisp-options-grid, .engines-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wisp-option-card, .engine-radio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.wisp-option-card:hover, .engine-radio-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.wisp-option-card.selected, .engine-radio-card.selected {
  background: var(--accent-gradient-glow);
  border-color: var(--border-glow);
}

.option-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-radio {
  accent-color: var(--accent-purple);
  width: 16px;
  height: 16px;
}

.option-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.option-sub {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.wisp-test-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.custom-wisp-input, .custom-engine-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
}

.custom-wisp-input:focus, .custom-engine-input:focus {
  border-color: var(--border-glow);
}

.btn-test-wisp {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient-glow);
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-test-wisp:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--accent-cyan);
}

.ping-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.ping-badge.good { color: var(--status-online); background: rgba(16, 185, 129, 0.1); }
.ping-badge.medium { color: var(--status-warn); background: rgba(245, 158, 11, 0.1); }
.ping-badge.bad { color: var(--status-error); background: rgba(239, 68, 68, 0.1); }

/* Tab Cloaking Grid */
.cloak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.cloak-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.cloak-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.cloak-card.selected {
  background: var(--accent-gradient-glow);
  border-color: var(--border-glow);
}

.cloak-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.cloak-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Diagnostic Items */
.diagnostic-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.diag-val {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 12px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.success { border-color: var(--status-online); }
.toast.error { border-color: var(--status-error); }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .hero-title { font-size: 2.6rem; }
  .navbar { height: auto; flex-wrap: wrap; padding: 10px 14px; }
  .nav-tabs-container { order: 3; width: 100%; max-width: 100%; }
  .search-box-wrapper { flex-wrap: wrap; }
  .search-actions { width: 100%; justify-content: flex-end; }
  .apps-grid { grid-template-columns: 1fr; }
}
