/* app/static/css/styles.css */
:root{
  --bg: #ffffff;
  --bg2: #f6f7fb;
  --text: #0b1220;
  --muted: rgba(11,18,32,.68);
  --card: rgba(255,255,255,.86);
  --border: rgba(15,23,42,.10);
  --shadow: 0 18px 60px rgba(15,23,42,.10);
  --shadow2: 0 10px 24px rgba(15,23,42,.08);
  --radius: 18px;

  --blue: #0a84ff;
  --blue2: rgba(10,132,255,.14);
  --mint: rgba(46,213,190,.18);
  --violet: rgba(151,71,255,.14);
  --peach: rgba(255,149,0,.12);
}

html, body{
  height:100%;
}

body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(900px 600px at 15% 5%, rgba(10,132,255,.12), transparent 55%),
              radial-gradient(900px 600px at 90% 10%, rgba(151,71,255,.10), transparent 55%),
              radial-gradient(900px 600px at 40% 95%, rgba(46,213,190,.12), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
}

.bg-app{
  background: radial-gradient(900px 600px at 15% 5%, rgba(10,132,255,.12), transparent 55%),
              radial-gradient(900px 600px at 90% 10%, rgba(151,71,255,.10), transparent 55%),
              radial-gradient(900px 600px at 40% 95%, rgba(46,213,190,.12), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Navbar */
.nav-apple{
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.navbar .nav-link{
  color: rgba(11,18,32,.78);
  font-weight: 500;
}
.navbar .nav-link:hover{
  color: rgba(11,18,32,.95);
}

.brand-mark{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0a84ff, #22c55e);
  box-shadow: 0 0 0 6px rgba(10,132,255,.08);
}

.avatar-nav{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.avatar-nav-fallback{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0a84ff;
  background: rgba(10,132,255,.10);
  border: 1px solid rgba(10,132,255,.18);
}

/* Buttons */
.btn-apple-primary{
  background: linear-gradient(180deg, #1990ff, #0a84ff);
  border: 1px solid rgba(10,132,255,.25);
  color: #fff;
  box-shadow: 0 10px 22px rgba(10,132,255,.20);
}
.btn-apple-primary:hover{
  filter: brightness(1.02);
  transform: translateY(-1px);
}
.btn-apple-primary:active{
  transform: translateY(0);
}
.btn-apple-secondary{
  background: rgba(255,255,255,.80);
  border: 1px solid var(--border);
  color: rgba(11,18,32,.90);
  box-shadow: var(--shadow2);
}
.btn-apple-secondary:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.92);
}
.btn-apple-secondary:active{
  transform: translateY(0);
}

.btn, .btn:focus{
  transition: transform .18s ease, filter .18s ease, background .18s ease, box-shadow .18s ease;
}

/* Hero */
.hero-shell{
  position: relative;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 26px;
}
@media (min-width: 992px){
  .hero-shell{ padding: 42px; }
}

.hero-bg{
  position: absolute;
  inset: -140px -120px auto -160px;
  height: 520px;
  background:
    radial-gradient(340px 240px at 30% 30%, rgba(10,132,255,.22), transparent 60%),
    radial-gradient(340px 240px at 65% 35%, rgba(46,213,190,.18), transparent 60%),
    radial-gradient(340px 240px at 55% 75%, rgba(255,149,0,.14), transparent 60%);
  filter: blur(18px);
  opacity: .9;
  pointer-events: none;
  transform: translate3d(0,0,0);
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(10,132,255,.18);
  background: rgba(10,132,255,.07);
  color: rgba(11,18,32,.78);
  font-weight: 600;
  font-size: 12px;
}

.search-bar{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow2);
}
@media (min-width: 768px){
  .search-bar{
    grid-template-columns: 1.4fr .9fr auto;
    align-items: center;
  }
}
.search-input, .search-select{
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.90);
  border-radius: 14px;
  padding: 10px 12px;
}
.search-input i, .search-select i{
  color: rgba(11,18,32,.55);
}
.search-input input{
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 16px;
}
.search-select select{
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  color: rgba(11,18,32,.90);
}

.hero-card{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.82);
  border-radius: 20px;
  box-shadow: var(--shadow2);
  overflow: hidden;
}
.hero-card-head{
  padding: 16px 16px 10px 16px;
  background: linear-gradient(180deg, rgba(10,132,255,.07), rgba(255,255,255,0));
}
.hero-card-title{
  font-weight: 700;
}
.hero-card-sub{
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.hero-card-actions{
  padding: 14px 16px 16px 16px;
  border-top: 1px solid rgba(15,23,42,.08);
}

.steps{
  padding: 8px 16px 6px 16px;
}
.step{
  display:flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(15,23,42,.08);
}
.step:first-child{ border-top: none; }
.step-icon{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(10,132,255,.10);
  border: 1px solid rgba(10,132,255,.16);
  color: rgba(10,132,255,.95);
}
.step-title{
  font-weight: 600;
}
.step-text{
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.hero-metrics{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}
.metric{
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 8px 16px rgba(15,23,42,.06);
}
.metric-kicker{
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.metric-value{
  font-weight: 600;
  margin-top: 2px;
}

.category-strip{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.category-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.80);
  border: 1px solid rgba(15,23,42,.10);
  color: rgba(11,18,32,.88);
  box-shadow: 0 8px 16px rgba(15,23,42,.05);
  font-size: 13px;
}
.category-pill i{
  color: rgba(10,132,255,.95);
}

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
}

/* Cards */
.card-apple{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(15,23,42,.08);
  overflow:hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card-apple:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 46px rgba(15,23,42,.10);
}
.card-apple .card-img-top{
  height: 220px;
  object-fit: cover;
  background: rgba(15,23,42,.03);
}
.placeholder-img{
  height: 220px;
  background: rgba(15,23,42,.03);
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.card-title-apple{
  font-weight: 650;
  line-height: 1.2;
  color: rgba(11,18,32,.95);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.btn-icon{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  transition: transform .18s ease, background .18s ease;
}
.btn-icon:hover{
  transform: translateY(-1px);
}
.btn-icon-on{
  background: rgba(255,149,0,.12);
  border-color: rgba(255,149,0,.25);
}
.btn-icon-off{
  background: rgba(255,255,255,.92);
}

.badge-apple{
  background: rgba(10,132,255,.12);
  border: 1px solid rgba(10,132,255,.20);
  color: rgba(10,132,255,.95);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 700;
}

.link-apple{
  color: rgba(10,132,255,.95);
  text-decoration: none;
}
.link-apple:hover{
  text-decoration: underline;
}

/* Listing view images */
.listing-photo{
  max-height: 520px;
  object-fit: contain;
  background: rgba(15,23,42,.03);
}

/* Tiles and chat */
.swap-tile{
  display:block;
  text-decoration:none;
  color: inherit;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.swap-tile:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 46px rgba(15,23,42,.08);
}

.chat-box{
  max-height: 520px;
  overflow: auto;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.70);
  padding: 14px;
}
.chat-msg{
  display:flex;
  margin-bottom: 12px;
}
.chat-msg.me{
  justify-content:flex-end;
}
.chat-bubble{
  max-width: 82%;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 16px rgba(15,23,42,.05);
}
.chat-msg.me .chat-bubble{
  background: rgba(10,132,255,.10);
  border-color: rgba(10,132,255,.18);
}

/* Empty state and CTA */
.empty-state{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow2);
  text-align: center;
}
.empty-icon{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(10,132,255,.10);
  border: 1px solid rgba(10,132,255,.18);
  color: rgba(10,132,255,.95);
  font-size: 24px;
  margin-bottom: 10px;
}

.cta-band{
  border: 1px solid rgba(15,23,42,.10);
  background: linear-gradient(180deg, rgba(10,132,255,.08), rgba(255,255,255,.82));
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow2);
}
.cta-title{
  font-weight: 750;
  font-size: 20px;
}
.cta-text{
  margin-top: 6px;
}

/* Footer */
.footer{
  border-top: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.60);
  backdrop-filter: blur(10px);
}

/* Reveal animations */
[data-reveal]{
  opacity: 0;
  transform: translateY(10px);
}
.revealed{
  opacity: 1;
  transform: translateY(0);
  transition: opacity .55s ease, transform .55s ease;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
  .card-apple, .swap-tile, .btn{ transition: none !important; }
  [data-reveal]{ opacity: 1 !important; transform: none !important; }
}


/* Backward compatible classes */
.glass-card{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
}
.mini-card{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.72);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.pagination-dark .page-link{
  background: rgba(255,255,255,.86);
  border-color: rgba(15,23,42,.10);
  color: rgba(11,18,32,.88);
}
.pagination-dark .page-item.active .page-link{
  background: rgba(10,132,255,.16);
  border-color: rgba(10,132,255,.22);
}
