/* ===== HOME PAGE ===== */
#page-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

/* Grid removido — apenas partículas */
.home-bg-grid { display: none; }

/* Dark overlay so content is readable over wallpaper */
#page-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 1;
}

.home-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 640px;
  padding: 0 24px;
}

/* Logo */
.home-logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: homeLogoIn 0.7s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes homeLogoIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Home logo mark */
.home-logo-icon {
  display: flex; align-items: center; justify-content: center;
}

.home-logo-cloud {
  display: flex; align-items: center; justify-content: center;
  animation: homeLogoCloudIn 0.8s cubic-bezier(0.34,1.56,0.64,1) forwards;
  opacity: 0;
}
@keyframes homeLogoCloudIn {
  from { opacity:0; transform: scale(0.6) translateY(10px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
.cloud-svg-anim {
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.25));
  animation: cloudFloat 4s ease-in-out infinite 1s;
}
@keyframes cloudFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.home-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text-primary);
}

/* Search */
.search-container {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(25,25,25,0.24);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 14px;
  gap: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: searchIn 0.6s ease forwards 0.2s;
  opacity: 0;
}

@keyframes searchIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-container:focus-within {
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04), 0 4px 24px rgba(0,0,0,0.4);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 45px rgba(0,0,0,0.12);
  z-index: 1000;
  overflow: hidden;
  max-height: 340px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.search-suggestions.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-suggestion-item:hover {
  background: rgba(255,255,255,0.06);
}

.ssi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.ssi-icon img,
.ssi-icon svg {
  width: 18px;
  height: 18px;
}

.ssi-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ssi-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssi-type-badge {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-active);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.search-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-brand-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.search-engine-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-engine-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
}

.search-input {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
  padding: 6px 0;
}

.search-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition);
}

.search-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(255,255,255,0.3);
}

.search-btn:active { transform: scale(0.96); }

/* Quick links */
.quick-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  animation: quickLinksIn 0.6s ease forwards 0.4s;
  opacity: 0;
}

@keyframes quickLinksIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform var(--transition);
}

.quick-link:hover { transform: translateY(-3px); }

.quick-link-icon {
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  overflow: hidden;
}

.quick-link:hover .quick-link-icon {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.quick-link-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.quick-link-icon .ql-placeholder {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
}

.quick-link-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Add quick link button */
.quick-link-add .quick-link-icon {
  border-style: dashed;
}

.quick-link-add:hover .quick-link-icon {
  border-style: solid;
}

/* Footer */
.home-footer {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  z-index: 2;
  white-space: nowrap;
  animation: fadeInUp 0.6s ease forwards 0.8s;
  opacity: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 10px 24px;
}
.home-footer a { color: rgba(255,255,255,0.75); transition: color var(--transition); }
.home-footer a:hover { color: #fff; }

.footer-sep { color: rgba(255,255,255,0.25); }

.footer-online {
  display: flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}
.footer-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: onlinePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes onlinePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #22c55e; }
  50%       { opacity: 0.7; box-shadow: 0 0 12px #22c55e; }
}

/* ----- Animated grid + radial fade — Apps, Games, Settings ----- */
.page-with-grid-bg > .page-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: bgGridMove 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Overlay suave — não cobre o wallpaper */
.page-with-grid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 35%, transparent 40%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
  z-index: 0;
}

/* AI page — sem overlay, fundo limpo */
#page-ai.page-with-grid-bg::before {
  display: none;
}

/* Quando wallpaper ativo, remove o overlay escuro */
body.wallpaper-active .page-with-grid-bg::before {
  display: none;
}

.page-with-grid-bg > *:not(.page-bg-grid) {
  z-index: 2;
}
