/* =========================================================
   AGENDA IA THEME ENGINE — HERO IA + UI DINÂMICA
   Usa 1 imagem IA apenas no card principal.
   O resto da app acompanha por cores, gradientes e glass.
   ========================================================= */

body.ai-theme-enabled {
  --ai-primary: #169ca3;
  --ai-secondary: #f59b3d;
  --ai-accent: #ff7b5f;

  --ai-bg: #fffaf2;
  --ai-bg-soft: #eefafa;

  --ai-text: #0f2940;
  --ai-text-soft: #60717c;

  --ai-card: rgba(255,255,255,.92);
  --ai-radius: 26px;

  --ai-shadow: 0 18px 50px rgba(0,0,0,.08);
  --ai-border: rgba(0,0,0,.06);

  --ai-hero-image: linear-gradient(135deg,#eefafa,#fffaf2);

  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--ai-secondary) 18%, transparent), transparent 30%),
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--ai-primary) 18%, transparent), transparent 32%),
    linear-gradient(180deg, var(--ai-bg), var(--ai-bg-soft));

  color: var(--ai-text);
  transition: background .35s ease, color .35s ease;
}

/* HEADER */

body.ai-theme-enabled .topbar,
body.ai-theme-enabled .top-header,
body.ai-theme-enabled .header,
body.ai-theme-enabled .app-header {
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--ai-border);
}

/* CARD PRINCIPAL — ÚNICO COM IMAGEM IA */

body.ai-theme-enabled .today-banner {
  position: relative;
  overflow: hidden;
  padding: 28px;
  min-height: 250px;
  border-radius: 34px;

  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,.94) 0%,
      rgba(255,255,255,.78) 42%,
      rgba(255,255,255,.10) 100%
    ),
    var(--ai-hero-image);

  background-size: cover;
  background-position: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.45);
  isolation: isolate;
}

body.ai-theme-enabled .today-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 18%, rgba(255,255,255,.34), transparent 26%),
    linear-gradient(135deg, color-mix(in srgb, var(--ai-primary) 10%, transparent), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body.ai-theme-enabled .today-banner::after {
  content: var(--ai-decor, "✨");
  position: absolute;
  right: 24px;
  bottom: 18px;
  font-size: 58px;
  opacity: .22;
  transform: rotate(-7deg);
  pointer-events: none;
  z-index: 1;
}

body.ai-theme-enabled .today-banner > * {
  position: relative;
  z-index: 2;
}

body.ai-theme-enabled .today-banner-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  font-size: 15px;
  font-weight: 800;
  color: var(--ai-text);
  margin-bottom: 18px;
}

body.ai-theme-enabled .today-banner-date {
  font-family: 'Lora', serif;
  font-size: clamp(42px, 7vw, 68px);
  line-height: .95;
  font-weight: 700;
  color: var(--ai-text);
  letter-spacing: -2px;
  max-width: 520px;
  text-shadow: 0 4px 16px rgba(255,255,255,.35);
  margin-bottom: 16px;
}

body.ai-theme-enabled .today-banner-count {
  font-size: 24px;
  font-weight: 700;
  color: color-mix(in srgb, var(--ai-text) 82%, white);
  margin-bottom: 22px;
}

body.ai-theme-enabled .today-banner-btn {
  border: 0;
  border-radius: 999px;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  box-shadow: 0 18px 38px rgba(0,0,0,.14);
  transition: transform .18s ease, box-shadow .18s ease;
}

body.ai-theme-enabled .today-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(0,0,0,.18);
}

/* BANNERS */

body.ai-theme-enabled .install-banner,
body.ai-theme-enabled .promo-banner,
body.ai-theme-enabled .reminder-banner {
  border-radius: var(--ai-radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,.90), rgba(255,255,255,.72)),
    linear-gradient(135deg, color-mix(in srgb, var(--ai-primary) 10%, transparent), color-mix(in srgb, var(--ai-secondary) 10%, transparent));
  border: 1px solid var(--ai-border);
  box-shadow: 0 10px 28px rgba(0,0,0,.05);
}

/* CARDS / MINI CARDS — SEM IMAGEM IA EXTRA */

body.ai-theme-enabled .card,
body.ai-theme-enabled .dashboard-card,
body.ai-theme-enabled .home-card,
body.ai-theme-enabled .stat-card,
body.ai-theme-enabled .event-card,
body.ai-theme-enabled .next-event-card,
body.ai-theme-enabled .mini-card,
body.ai-theme-enabled .stat-chip {
  position: relative;
  overflow: hidden;
  border-radius: var(--ai-radius) !important;

  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.84)),
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--ai-secondary) 18%, transparent), transparent 30%),
    radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--ai-primary) 16%, transparent), transparent 35%) !important;

  border: 1px solid var(--ai-border) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.06) !important;
  backdrop-filter: blur(14px);
}

body.ai-theme-enabled .card::after,
body.ai-theme-enabled .dashboard-card::after,
body.ai-theme-enabled .home-card::after,
body.ai-theme-enabled .stat-card::after,
body.ai-theme-enabled .stat-chip::after {
  content: var(--ai-decor, "✨");
  position: absolute;
  right: 12px;
  bottom: 6px;
  font-size: 34px;
  opacity: .10;
  pointer-events: none;
}

/* ÍCONES */

body.ai-theme-enabled .card-icon,
body.ai-theme-enabled .stat-icon,
body.ai-theme-enabled .icon-circle,
body.ai-theme-enabled .settings-icon {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary)) !important;
  color: white;
  box-shadow: 0 12px 26px rgba(0,0,0,.12);
}

/* BOTÕES */

body.ai-theme-enabled button,
body.ai-theme-enabled .btn,
body.ai-theme-enabled .primary-btn,
body.ai-theme-enabled .secondary-btn,
body.ai-theme-enabled .fab,
body.ai-theme-enabled .add-button {
  border-radius: 999px;
}

body.ai-theme-enabled .primary-btn,
body.ai-theme-enabled .fab,
body.ai-theme-enabled .add-button,
body.ai-theme-enabled .save-btn,
body.ai-theme-enabled .nav-add {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary)) !important;
  color: white;
  box-shadow: 0 16px 34px rgba(0,0,0,.14) !important;
}

/* BOTÃO FALAR COM A AGENDA */

body.ai-theme-enabled .voice-btn {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary)) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.16) !important;
}

body.ai-theme-enabled .voice-btn::before,
body.ai-theme-enabled .voice-btn::after {
  content: none !important;
}

/* MENU LATERAL REAL */

body.ai-theme-enabled .bottom-nav {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--ai-primary) 22%, white),
      color-mix(in srgb, var(--ai-secondary) 22%, white)
    ) !important;

  border: 1px solid color-mix(in srgb, var(--ai-primary) 30%, white) !important;
  box-shadow: 0 22px 55px rgba(0,0,0,.16) !important;
  backdrop-filter: blur(18px) !important;
}

body.ai-theme-enabled .bottom-nav .nav-item {
  background: rgba(255,255,255,.20) !important;
  border-radius: 22px !important;
  transition: all .18s ease;
}

body.ai-theme-enabled .bottom-nav .nav-item.active {
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.14) !important;
}

body.ai-theme-enabled .bottom-nav .nav-icon {
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.12));
}

body.ai-theme-enabled .bottom-nav .nav-label {
  color: var(--ai-text) !important;
  font-weight: 900 !important;
}

body.ai-theme-enabled .bottom-nav .nav-item.active .nav-label {
  color: var(--ai-primary) !important;
}

/* SIDE NAV GENÉRICO */

body.ai-theme-enabled .side-nav,
body.ai-theme-enabled .sidebar,
body.ai-theme-enabled #sideMenu {
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
  border-radius: 34px;
}

body.ai-theme-enabled .side-nav .active,
body.ai-theme-enabled .sidebar .active,
body.ai-theme-enabled #sideMenu .active {
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.64));
  border-radius: 24px;
  color: var(--ai-primary);
}

/* INPUTS */

body.ai-theme-enabled input,
body.ai-theme-enabled textarea,
body.ai-theme-enabled select {
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
}

/* MODAIS */

body.ai-theme-enabled .modal,
body.ai-theme-enabled .popup,
body.ai-theme-enabled .dialog,
body.ai-theme-enabled .modal-sheet {
  border-radius: 34px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 28px 70px rgba(0,0,0,.18);
}

/* LISTAS / EVENTOS */

body.ai-theme-enabled .event-item,
body.ai-theme-enabled .task-item,
body.ai-theme-enabled .shopping-item {
  border-radius: 20px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(0,0,0,.05);
}

/* SCROLLBAR */

body.ai-theme-enabled ::-webkit-scrollbar {
  width: 10px;
}

body.ai-theme-enabled ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--ai-primary), var(--ai-secondary));
  border-radius: 999px;
}
