/* AI Apps Manager — DaisyUI Fantasy (Light) Design */

/* Section — light purple-white background matching Fantasy base-100 */
.aiam-section {
  font-family: inherit;
  background: oklch(98% 0.005 290);
  color: oklch(27.8% 0.029 257);
  padding: 60px 24px 80px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  box-sizing: border-box;
}
.aiam-section *, .aiam-section *::before, .aiam-section *::after { box-sizing: border-box; }

/* Hero */
.aiam-hero { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.aiam-hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 6px;
  background: linear-gradient(135deg, oklch(37.45% 0.189 325), oklch(53.92% 0.162 241));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.aiam-hero-underline {
  width: 80px; height: 4px; margin: 0 auto 14px; border-radius: 2px;
  background: linear-gradient(90deg, oklch(37.45% 0.189 325), oklch(53.92% 0.162 241));
}
.aiam-hero-subtitle { font-size: 1.05rem; color: oklch(50% 0.02 257); margin: 0 0 32px; line-height: 1.6; }

/* Search */
.aiam-search-wrap { position: relative; max-width: 480px; margin: 0 auto 20px; }
.aiam-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: oklch(60% 0.02 257); pointer-events: none; }
.aiam-search-input {
  width: 100%; padding: 14px 20px 14px 50px; border-radius: 0.5rem;
  border: 1px solid oklch(86% 0 0);
  background: oklch(100% 0 0);
  color: oklch(27.8% 0.029 257); font-size: 1rem; font-family: inherit; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.aiam-search-input::placeholder { color: oklch(65% 0.01 257); }
.aiam-search-input:focus { border-color: oklch(37.45% 0.189 325); box-shadow: 0 0 0 3px oklch(37.45% 0.189 325 / 0.15); }

/* Stats */
.aiam-stats { font-size: .88rem; color: oklch(55% 0.02 257); margin: 0; }
.aiam-stats span { color: oklch(37.45% 0.189 325); font-weight: 600; }

/* ===== BENTO GRID ===== */
.aiam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Card */
.aiam-card {
  background: oklch(100% 0 0);
  border: 1px solid oklch(90% 0 0);
  border-radius: 1rem;
  padding: 24px;
  display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s, box-shadow .35s;
  opacity: 0; transform: translateY(20px);
  animation: aiamFadeIn .5s ease forwards;
  animation-delay: var(--delay, 0s);
  position: relative; overflow: hidden;
  box-shadow: 0 1px 3px oklch(0% 0 0 / 0.06);
}
.aiam-card:hover {
  transform: translateY(-5px);
  border-color: oklch(37.45% 0.189 325 / 0.4);
  box-shadow: 0 16px 48px oklch(37.45% 0.189 325 / 0.1), 0 4px 16px oklch(0% 0 0 / 0.06);
}
@keyframes aiamFadeIn { to { opacity: 1; transform: translateY(0); } }

/* Featured card */
.aiam-card--featured {
  grid-column: span 2;
  grid-row: span 2;
  padding: 36px;
  background: linear-gradient(135deg, oklch(97% 0.01 325), oklch(98% 0.005 241));
}
.aiam-card--featured .aiam-card-logo-wrap { width: 88px; height: 88px; border-radius: 22px; }
.aiam-card--featured .aiam-card-title { font-size: 1.45rem; }
.aiam-card--featured .aiam-card-desc { -webkit-line-clamp: 3 !important; font-size: .95rem; max-height: 4.65em !important; }
.aiam-card--featured .aiam-beta-btn { padding: 12px 28px; font-size: .92rem; }

/* Highlight from URL */
.aiam-card--highlight {
  border-color: oklch(37.45% 0.189 325) !important;
  box-shadow: 0 0 0 3px oklch(37.45% 0.189 325 / 0.2), 0 8px 32px oklch(0% 0 0 / 0.08) !important;
}

/* Card inner */
.aiam-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.aiam-card-logo-wrap {
  width: 56px; height: 56px; border-radius: 0.75rem; overflow: hidden; flex-shrink: 0;
  background: oklch(96% 0.005 290);
  display: flex; align-items: center; justify-content: center;
}
.aiam-card-logo { width: 100%; height: 100%; object-fit: cover; }
.aiam-card-logo-placeholder { font-size: 1.6rem; }
.aiam-card-title { font-size: 1.1rem; font-weight: 700; margin: 0; color: oklch(27.8% 0.029 257); }

/* Rating */
.aiam-card-rating { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.aiam-stars { position: relative; display: inline-block; font-size: .85rem; line-height: 1; }
.aiam-stars-bg { color: oklch(86% 0 0); letter-spacing: 2px; }
.aiam-stars-fill { position: absolute; top: 0; left: 0; color: oklch(75.98% 0.204 57); letter-spacing: 2px; overflow: hidden; white-space: nowrap; width: calc(var(--rating) / 5 * 100%); }
.aiam-rating-num { font-size: .8rem; font-weight: 600; color: oklch(75.98% 0.204 57); }

/* Desc — !important needed because WP/LiteSpeed rewrites display to flow-root */
p.aiam-card-desc,
.aiam-card .aiam-card-desc {
  font-size: .88rem;
  color: oklch(50% 0.015 257);
  line-height: 1.55;
  margin: 0 0 16px;
  flex: 0 0 auto;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  text-overflow: ellipsis;
  word-break: break-word;
  max-height: 3.1em; /* hard cap: 2 lines at 1.55 line-height */
}
/* Link style inside card title */
.aiam-card-title a { color: inherit; text-decoration: none; }
.aiam-card-title a:hover { color: oklch(37.45% 0.189 325); }

/* Footer */
.aiam-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; margin-bottom: 10px; flex-wrap: wrap; }
.aiam-card-code {
  font-size: .75rem; font-weight: 600; color: oklch(37.45% 0.189 325);
  background: oklch(37.45% 0.189 325 / 0.08); padding: 4px 10px; border-radius: .5rem;
}

/* Beta btn — primary purple */
.aiam-beta-btn {
  font-family: inherit; font-size: .8rem; font-weight: 600; color: oklch(87.49% 0.037 325); border: none;
  padding: 9px 18px; border-radius: 0.5rem; cursor: pointer;
  background: oklch(37.45% 0.189 325);
  transition: transform .2s, box-shadow .2s, opacity .2s; white-space: nowrap; position: relative; overflow: hidden;
}
.aiam-beta-btn::after {
  content: ''; position: absolute; top: -50%; left: -75%; width: 50%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg); animation: aiamShimmer 3s ease-in-out infinite;
}
@keyframes aiamShimmer { 0% { left: -75%; } 100% { left: 150%; } }
.aiam-beta-btn:hover { transform: scale(1.04); box-shadow: 0 4px 16px oklch(37.45% 0.189 325 / 0.3); opacity: 0.9; }
.aiam-beta-btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.aiam-beta-btn--done { background: oklch(64.8% 0.15 160) !important; color: oklch(0% 0 0) !important; pointer-events: none; }
.aiam-beta-btn--done::after { display: none; }

/* Testers */
.aiam-card-testers { font-size: .78rem; color: oklch(60% 0.015 257); display: flex; align-items: center; gap: 5px; }
.aiam-card-testers span { font-size: .95rem; }

/* No results */
.aiam-no-results { text-align: center; padding: 60px 20px; max-width: 400px; margin: 0 auto; }
.aiam-no-results-icon { font-size: 3rem; margin-bottom: 16px; }
.aiam-no-results h3 { font-size: 1.3rem; margin: 0 0 8px; color: oklch(27.8% 0.029 257); }
.aiam-no-results p { color: oklch(55% 0.015 257); font-size: .95rem; margin: 0; }

/* ===== MODAL ===== */
.aiam-modal { display: none; position: fixed; inset: 0; z-index: 999999; font-family: inherit; }
.aiam-modal--open { display: flex; align-items: center; justify-content: center; }
.aiam-modal-overlay { position: absolute; inset: 0; background: oklch(27.8% 0.029 257 / 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.aiam-modal-dialog {
  position: relative;
  background: oklch(100% 0 0);
  border: 1px solid oklch(90% 0 0);
  border-radius: 1rem; padding: 40px 32px 32px; width: 92%; max-width: 420px;
  text-align: center; animation: aiamModalIn .35s ease;
  color: oklch(27.8% 0.029 257);
  box-shadow: 0 24px 64px oklch(0% 0 0 / 0.15);
}
@keyframes aiamModalIn { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.aiam-modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: oklch(60% 0.01 257); font-size: 1.6rem; cursor: pointer; line-height: 1; transition: color .2s; }
.aiam-modal-close:hover { color: oklch(30% 0.02 257); }
.aiam-modal-logo { width: 64px; height: 64px; border-radius: 1rem; overflow: hidden; margin: 0 auto 18px; background: oklch(96% 0 0); }
.aiam-modal-logo img { width: 100%; height: 100%; object-fit: cover; }
.aiam-modal-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 8px; color: oklch(27.8% 0.029 257); }
.aiam-modal-title span { color: oklch(37.45% 0.189 325); }
.aiam-modal-desc { color: oklch(50% 0.015 257); font-size: .92rem; margin: 0 0 24px; line-height: 1.5; }
.aiam-modal-form { display: flex; flex-direction: column; gap: 14px; }
.aiam-input-wrap input {
  width: 100%; padding: 14px 18px; border-radius: 0.5rem;
  border: 1px solid oklch(86% 0 0);
  background: oklch(100% 0 0);
  color: oklch(27.8% 0.029 257); font-size: 1rem; font-family: inherit; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.aiam-input-wrap input::placeholder { color: oklch(65% 0.01 257); }
.aiam-input-wrap input:focus { border-color: oklch(37.45% 0.189 325); box-shadow: 0 0 0 3px oklch(37.45% 0.189 325 / 0.12); }
.aiam-submit-btn {
  font-family: inherit; font-size: 1rem; font-weight: 600; color: oklch(87.49% 0.037 325); border: none;
  padding: 14px; border-radius: 0.5rem; cursor: pointer;
  background: oklch(37.45% 0.189 325);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.aiam-submit-btn:hover { transform: scale(1.02); box-shadow: 0 4px 20px oklch(37.45% 0.189 325 / 0.3); opacity: 0.9; }
.aiam-submit-btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.aiam-form-msg { font-size: .88rem; padding: 10px 14px; border-radius: .5rem; display: none; }
.aiam-form-msg--error { display: block; background: oklch(71.76% 0.221 22 / 0.1); color: oklch(50% 0.18 22); border: 1px solid oklch(71.76% 0.221 22 / 0.2); }
.aiam-form-msg--success { display: block; background: oklch(64.8% 0.15 160 / 0.1); color: oklch(45% 0.12 160); border: 1px solid oklch(64.8% 0.15 160 / 0.2); }
.aiam-modal-success { display: none; padding: 10px 0; }
.aiam-modal-success--show { display: block; animation: aiamSuccessIn .5s ease; }
@keyframes aiamSuccessIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
.aiam-success-check { width: 64px; height: 64px; border-radius: 50%; background: oklch(64.8% 0.15 160 / 0.12); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 2rem; }
.aiam-modal-success h3 { font-size: 1.25rem; margin: 0 0 6px; color: oklch(27.8% 0.029 257); }
.aiam-modal-success p { color: oklch(50% 0.015 257); font-size: .9rem; margin: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .aiam-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .aiam-card--featured { grid-column: span 2; grid-row: span 1; padding: 28px; }
}
@media (max-width: 768px) {
  .aiam-section { padding: 40px 16px 60px; }
  .aiam-grid { grid-template-columns: 1fr; gap: 14px; padding: 0 8px; }
  .aiam-card--featured { grid-column: span 1; padding: 24px; }
  .aiam-card--featured .aiam-card-logo-wrap { width: 56px; height: 56px; border-radius: 14px; }
  .aiam-card--featured .aiam-card-title { font-size: 1.15rem; }
  .aiam-card--featured .aiam-card-desc { -webkit-line-clamp: 3; }
  .aiam-modal-dialog { padding: 32px 20px 24px; }
}
@media (max-width: 480px) {
  .aiam-card-footer { flex-direction: column; gap: 8px; }
  .aiam-beta-btn { width: 100%; text-align: center; }
}

/* === SINGLE APP PAGE === */
.aiam-single-app {
  max-width: 680px; margin: 0 auto; padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.aiam-single-header {
  display: flex; align-items: flex-start; gap: 24px; margin-bottom: 32px;
}
.aiam-single-logo {
  width: 120px; height: 120px; border-radius: 24px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 4px 20px oklch(0% 0 0 / 0.1);
}
.aiam-single-logo img { width: 100%; height: 100%; object-fit: cover; }
.aiam-single-info { display: flex; flex-direction: column; gap: 8px; }
.aiam-single-title {
  font-size: 1.8rem; font-weight: 800; margin: 0; color: oklch(27.8% 0.029 257);
  line-height: 1.2;
}
.aiam-single-testers {
  font-size: .9rem; color: oklch(45% 0.02 257); margin: 4px 0 0;
}
.aiam-single-desc {
  background: oklch(97% 0.005 257); border-radius: 1rem; padding: 24px; margin-bottom: 32px;
}
.aiam-single-desc p {
  font-size: 1rem; line-height: 1.7; color: oklch(35% 0.02 257); margin: 0;
}
.aiam-single-cta { text-align: center; margin-bottom: 40px; }
.aiam-beta-btn--large {
  font-size: 1.1rem !important; padding: 16px 40px !important; border-radius: 0.75rem;
}
@media (max-width: 480px) {
  .aiam-single-header { flex-direction: column; align-items: center; text-align: center; }
  .aiam-single-logo { width: 100px; height: 100px; }
  .aiam-single-title { font-size: 1.4rem; }
  .aiam-beta-btn--large { width: 100%; }
}
