/*
Theme Name: Bloom AI
Theme URI: https://bloomai.io
Author: Bloom AI Team
Author URI: https://bloomai.io
Description: Bloom AI — Premium AI Review Assistant, Link-in-Bio & SaaS Digital Platform WordPress Theme. Every Review Helps You Grow.
Version: 2.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bloom-ai
Tags: saas, ai-review, digital-card, link-tree, responsive, full-site-editing, custom-colors, custom-menu, custom-logo, editor-style
*/

/* ==========================================================================
   CSS Custom Properties & Complete Brand Design Tokens
   ========================================================================== */
:root {
  /* Bloom AI — Official Fresh Green + Sunny Orange Palette */
  --brand-primary: #2EB872;
  --brand-primary-hover: #1E8F57;
  --brand-accent: #FF8A1F;
  --brand-highlight: #FFD23F;

  --color-cream: #FAFFF5;
  --color-secondary: #E6F7EC;
  --color-primary: #2EB872;
  --color-primary-hover: #1E8F57;
  --color-dark: #1E8F57;

  /* Legacy & Semantic Mapping */
  --bloom-charcoal: #23332B;
  --bloom-primary: #2EB872;
  --bloom-secondary: #E6F7EC;
  --bloom-champagne: #FAFFF5;

  /* Backgrounds & Surfaces */
  --bloom-background: #FAFFF5;
  --bloom-surface: #FFFFFF;
  --bloom-surface-secondary: #E6F7EC;

  /* Typography */
  --bloom-text-primary: #23332B;
  --bloom-text-secondary: #1E8F57;
  --bloom-text-muted: #5C7266;

  /* Borders */
  --bloom-border: #D8EEDF;

  /* Buttons */
  --bloom-button-primary: #2EB872;
  --bloom-button-hover: #1E8F57;
  --bloom-button-text: #FFFFFF;

  /* Accents */
  --bloom-accent: #FF8A1F;
  --bloom-highlight: #FFD23F;

  /* Typography Semantic Contrast Tokens (WCAG AA Compliant) */
  --text-primary: #23332B;       /* 12.8:1 on white, 12.1:1 on #FAFFF5 */
  --text-secondary: #1E8F57;     /* High readability dark green */
  --text-muted: #5C7266;         /* 5.2+:1 on white */
  --text-inverse: #FFFFFF;
  --text-disabled: #8A9E93;

  /* Surfaces & Borders */
  --surface-primary: #FFFFFF;
  --surface-secondary: #FAFFF5;
  --border-default: #D8EEDF;
  --focus-ring: #2EB872;

  /* Semantic Design Tokens */
  --background: #FAFFF5;
  --foreground: #23332B;

  --card: #FFFFFF;
  --card-foreground: #23332B;

  --popover: #FFFFFF;
  --popover-foreground: #23332B;

  --primary: #2EB872;
  --primary-foreground: #FFFFFF;

  --secondary: #E6F7EC;
  --secondary-foreground: #23332B;

  /* CRITICAL: --muted is used as text color! Must be a readable slate text color */
  --muted: #5C7266;
  --muted-foreground: #5C7266;
  --muted-bg: #E6F7EC;

  --accent: #FF8A1F;
  --accent-foreground: #FFFFFF;

  --border: #D8EEDF;
  --input: #D8EEDF;
  --ring: #2EB872;

  /* Brand color tokens matching frontend specification */
  --blue: #1B3E2D;
  --blue-bright: #2EB872;
  --navy: #1E8F57;
  --navy-headings: #1E8F57;
  --orange: #FF8A1F;
  --soft-blue: #E6F7EC;
  --light-blue: #FAFFF5;
  --white: #FFFFFF;
  --text: #23332B;
  --success: #2EB872;
  --shadow: 0 8px 24px rgba(35, 51, 43, 0.08);
  --radius: 12px;

  /* Aliases for cross-compatibility */
  --nav: var(--blue);
  --navy-headings: var(--navy);
  --cta-orange: var(--primary);
  --hero-bg: var(--soft-blue);
  --accent-light: var(--secondary);
  --bg-alt: var(--background);
  --card-bg: var(--white);
  --card-border: var(--border);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Sora', 'Inter', sans-serif;
}

/* Base resets & typography */
html,
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Button default reset */
button,
input,
select,
textarea {
  font: inherit;
}

/* WordPress Admin Bar Compatibility */
body.admin-bar .home-nav {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .home-nav {
    top: 46px;
  }
}

/* ==========================================================================
   Template Showcase & Interactive Preview Enhancements
   ========================================================================== */
.templates-section {
  padding: 80px 0;
}

.template-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 40px;
}

.template-filters button {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-filters button:hover {
  border-color: var(--blue-bright);
  color: var(--blue);
}

.template-filters button.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(0, 59, 143, 0.2);
}

.home-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media screen and (max-width: 992px) {
  .home-template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 640px) {
  .home-template-grid {
    grid-template-columns: 1fr;
  }
}

.home-template-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 10px 34px rgba(6, 43, 91, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(6, 43, 91, 0.12);
}

.home-template-preview {
  height: 380px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background: #e6eef8;
  position: relative;
}

.home-template-preview>div {
  width: 190px;
  height: 350px;
  overflow: hidden;
  border: 5px solid #102b4a;
  border-bottom: 0;
  border-radius: 25px 25px 0 0;
  box-shadow: 0 16px 35px rgba(6, 43, 91, 0.22);
  background: #ffffff;
  position: relative;
}

.home-template-preview .wt-template {
  width: 300px;
  min-height: 550px;
  transform: scale(0.6);
  transform-origin: top left;
  pointer-events: none;
  user-select: none;
}

.home-template-info {
  padding: 19px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-template-info h3 {
  margin: 0 0 6px;
  color: var(--navy);
  font: 700 17px var(--font-heading);
}

.home-template-info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.home-template-info>div:last-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.home-template-info button,
.home-template-info a.template-use-action {
  min-height: 44px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.template-preview-action {
  color: var(--navy);
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
}

.template-preview-action:hover {
  background: var(--background);
  border-color: var(--navy);
}

.template-use-action {
  color: var(--white);
  border: 1px solid var(--orange);
  background: var(--orange);
  cursor: pointer;
}

.template-use-action:hover {
  background: #db4407;
  border-color: #db4407;
  color: var(--white);
}

/* Template Alias Themes */
.wt-classic-navy {
  --wt-primary: var(--navy);
  background: #f4f8ff;
}

.wt-emerald-luxe {
  --wt-primary: #059669;
  background: #ecfdf5;
}

.wt-emerald-luxe .wt-hero {
  background: radial-gradient(circle at top, #10b981, #064e3b 70%) !important;
}

.wt-sunset-violet {
  --wt-primary: #f4510b;
  background: #fff7ed;
}

.wt-sunset-violet .wt-hero {
  background: linear-gradient(135deg, #f4510b, #9333ea) !important;
}

.wt-bold-neo {
  --wt-primary: #0f172a;
  background: #ffffff;
}

.wt-bold-neo .wt-hero {
  background: #0f172a !important;
}

/* Live Modal Full Template Preview */
.home-modal-stage .wt-template {
  transform: none !important;
  width: 100% !important;
  min-height: 100% !important;
  pointer-events: auto;
  user-select: auto;
}

/* Bloom AI Brand Logo Integration */
.home-logo {
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
}

.home-logo img,
.bloom-nav-logo {
  height: 38px !important;
  max-height: 42px !important;
  width: auto !important;
  max-width: 180px !important;
  object-fit: contain !important;
  display: block !important;
}

.home-logo > span:has(svg) {
  display: none !important;
}


/* Mobile-First Responsive Architecture & WordPress Admin Bar Compatibility */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body.admin-bar .app-shell,
body:has(#wpadminbar) .app-shell {
  padding-top: 0 !important;
}

body.admin-bar .topbar,
body:has(#wpadminbar) .topbar {
  top: 32px;
}
body.admin-bar .sidebar,
body:has(#wpadminbar) .sidebar {
  top: 32px;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
}
@media screen and (max-width: 782px) {
  body.admin-bar .app-shell,
  body:has(#wpadminbar) .app-shell {
    padding-top: 0 !important;
  }
  body.admin-bar .topbar,
  body:has(#wpadminbar) .topbar {
    top: 46px;
  }
  body.admin-bar .sidebar,
  body:has(#wpadminbar) .sidebar {
    top: 46px;
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
  }
  body.admin-bar .mobile-drawer-overlay,
  body:has(#wpadminbar) .mobile-drawer-overlay {
    top: 46px;
    height: calc(100% - 46px);
  }
  .topbar .page-heading {
    display: none !important;
  }
}

/* Mobile-First Dashboard Welcome Section & Actions */
@media screen and (max-width: 820px) {
  .welcome,
  .dashboard .welcome {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-top: 4px !important;
    margin-bottom: 20px !important;
  }

  .welcome > div:first-child,
  .dashboard .welcome > div:first-child,
  .welcome-text-block {
    width: 100% !important;
  }

  .welcome-actions,
  .dashboard .welcome-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 4px !important;
  }

  .welcome-actions .btn,
  .dashboard .welcome-actions .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
  }

  .welcome-actions .btn-secondary,
  .welcome-actions .btn-primary {
    display: inline-flex !important;
    font-size: 13px !important;
  }
}


/* ==========================================================================
   BLOOM AI — PREMIUM MOTION DESIGN SYSTEM & MICRO-INTERACTIONS
   60fps GPU-Accelerated, Intentional, Polished & Accessible
   ========================================================================== */

/* 1. Page Transitions */
.page-transition-wrapper {
  animation: pageEntrance 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageEntrance {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
    transform: translateY(0);
  }
}

/* 2. Button Micro-Interactions */
.btn,
.home-button {
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: transform;
}

.btn:hover,
.home-button:hover {
  transform: translateY(-1.5px) !important;
}

.btn:active,
.home-button:active {
  transform: scale(0.98) translateY(0) !important;
  transition-duration: 0.08s !important;
}

.btn:focus-visible,
.home-button:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(46, 184, 114, 0.28) !important;
}

/* 3. Interactive Cards */
.card,
.home-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease !important;
}

.card:hover,
.home-card:hover {
  border-color: rgba(46, 184, 114, 0.32) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(46, 184, 114, 0.14), 0 2px 6px -1px rgba(35, 51, 43, 0.04) !important;
}

/* 4. Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
