/* =========================
   User Files — 3D Home vibe
   Scoped to .uf-page so layout.html stays unchanged
========================= */

/* Reuse the same theme tokens (subset) from 3d_home.css */
:root{
  --bg0:#070915;
  --bg1:#0b1026;

  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.10);
  --stroke: rgba(255,255,255,.10);

  --text: rgba(255,255,255,.88);
  --muted: rgba(255,255,255,.62);
  --muted2: rgba(255,255,255,.46);

  --blue:#63b3ff;
  --violet:#9b6bff;
  --cyan:#1ee6ff;
  --neon:#00ffd1;

  --shadow: 0 30px 90px rgba(0,0,0,.55);
  --radius: 22px;
  --radius2: 28px;
}

/* Page wrapper */
.uf-page{
  position: relative;
  min-height: 100vh;

  /* Let your fixed navbar in layout.html breathe */
  padding: 110px 0 60px;

  color: var(--text);

  /* Background base (scoped) */
  background:
    radial-gradient(1200px 900px at 20% 0%, rgba(80,110,255,.18), transparent 60%),
    radial-gradient(900px 700px at 80% 20%, rgba(146,92,255,.16), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));

  overflow: clip;
}

/* Container similar sizing to 3d_home */
.uf-container{
  width: min(1180px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Accent gradient text */
.uf-accent{
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Background layer: radials + grid + orbs */
.uf-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.uf-bg__radial{
  position:absolute;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .9;
}
.uf-bg__radial--a{left:-260px; top:-280px; background: radial-gradient(circle, rgba(99,179,255,.18), transparent 60%)}
.uf-bg__radial--b{right:-320px; bottom:-320px; background: radial-gradient(circle, rgba(155,107,255,.16), transparent 62%)}

.uf-bg__grid{
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 110px 110px;
  mask-image: radial-gradient(circle at 50% 35%, rgba(0,0,0,.88), transparent 72%);
  opacity:.25;
}

/* Floating glow orbs */
.uf-orb{
  position:absolute;
  width: 220px; height:220px;
  border-radius: 50%;
  filter: blur(14px);
  opacity:.55;
  background: radial-gradient(circle at 30% 30%, rgba(30,230,255,.50), rgba(155,107,255,.18), transparent 68%);
}
.uf-orb--1{left:8%; top:24%}
.uf-orb--2{left:68%; top:12%; width: 300px; height:300px; opacity:.45}
.uf-orb--3{left:74%; top:66%; width: 260px; height:260px; background: radial-gradient(circle at 40% 30%, rgba(99,179,255,.48), rgba(0,255,209,.14), transparent 70%)}
.uf-orb--4{left:18%; top:74%; width: 260px; height:260px; opacity:.35}

/* Optional Spline background (disabled by default) */
.uf-spline{
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none; /* enable by adding .uf--spline on .uf-page */
  pointer-events: none;
}
.uf-page.uf--spline .uf-spline{ display: block; }
.uf-spline iframe{
  width: 100%;
  height: 100%;
  border: none;
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.05) saturate(1.08);
  pointer-events: none;
}

/* Header */
.uf-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.uf-pill{
  display:inline-flex;
  align-items:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.78);
  letter-spacing: .18em;
  font-size: 11px;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 14px;
}

.uf-title{
  margin:0;
  font-size: clamp(28px, 3.8vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.uf-subtitle{
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 68ch;
  line-height: 1.6;
}

/* Glass card container */
.uf-card{
  position: relative;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 80px rgba(0,0,0,.35);
  overflow: hidden;
}

/* subtle glow frame */
.uf-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: inherit;
  pointer-events:none;
  background: linear-gradient(
    90deg,
    rgba(30,230,255,.40),
    rgba(99,179,255,.18),
    rgba(155,107,255,.26)
  );
  filter: blur(14px);
  opacity: .35;
}

.uf-card__top{
  position: relative;
  z-index: 1;
  padding: 18px 18px 8px;
}

.uf-card__label{
  font-weight: 700;
  letter-spacing: -0.02em;
}

.uf-card__hint{
  margin-top: 6px;
  color: var(--muted2);
  font-size: 13px;
}

/* Table wrapper */
.uf-tableWrap{
  position: relative;
  z-index: 1;
  padding: 0 12px 14px;
  overflow: auto;
  outline: none;
}
.uf-tableWrap:focus-visible{
  box-shadow: 0 0 0 3px rgba(155,107,255,.18), 0 0 0 6px rgba(30,230,255,.10);
  border-radius: 18px;
}

/* Table */
.uf-table{
  width: 100%;
  margin: 0;
  color: var(--text);
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px; /* enables nice horizontal scroll on mobile */
}

/* Sticky header, stays below modal layers */
.uf-table thead th{
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(8,10,24,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 14px 12px;
  white-space: nowrap;
}

.uf-table td{
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: middle;
  text-align: center;
}

.uf-table--examples{
  min-width: 0;
  table-layout: fixed;
}

.uf-table--examples thead th,
.uf-table--examples td{
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.uf-table--examples .uf-btn{
  max-width: 100%;
  white-space: normal;
}

.uf-row{
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.uf-row:hover{
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(30,230,255,.10);
  transform: translateY(-1px);
}

.uf-cell--num{
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.78);
}

.uf-strong{
  font-weight: 700;
  color: rgba(255,255,255,.92);
}

.uf-date{
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.uf-muted{
  color: var(--muted);
  margin: 0;
}

.uf-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.uf-actions--stack{
  flex-direction: column;
  align-items: center;
}

.uf-truncate{
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons — Bootstrap-compatible but visually 3d_home-like */
.uf-btn.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  border-radius: 16px;
  padding: 10px 12px;
  font-weight: 650;
  letter-spacing: -0.01em;

  border: 1px solid rgba(255,255,255,.14);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.uf-btn.btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(155,107,255,.18),
    0 0 0 6px rgba(30,230,255,.10),
    0 0 28px rgba(30,230,255,.12);
}

.uf-btn--primary{
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  color: rgba(7,9,21,.92);
  box-shadow: 0 18px 50px rgba(0,0,0,.28), 0 0 28px rgba(30,230,255,.16);
}
.uf-btn--primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 22px 58px rgba(0,0,0,.32), 0 0 34px rgba(30,230,255,.20);
}

.uf-btn--info{
  background: linear-gradient(135deg, rgba(99,179,255,.22), rgba(155,107,255,.18));
  color: rgba(255,255,255,.92);
  box-shadow: 0 16px 44px rgba(0,0,0,.24), 0 0 22px rgba(99,179,255,.10);
}
.uf-btn--info:hover{
  transform: translateY(-2px);
  box-shadow: 0 22px 58px rgba(0,0,0,.30), 0 0 30px rgba(155,107,255,.16);
}

.uf-btn--ghost{
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
}
.uf-btn--ghost:hover{
  transform: translateY(-2px);
  border-color: rgba(30,230,255,.22);
  box-shadow: 0 0 30px rgba(30,230,255,.14);
}

.uf-btn--warn{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.90);
}
.uf-btn--warn:hover{
  transform: translateY(-2px);
  border-color: rgba(255, 220, 120, .45);
  box-shadow: 0 0 34px rgba(255, 220, 120, .12), 0 0 30px rgba(30,230,255,.08);
}

/* =========================
   Modals — glass + blur
========================= */

/* Glass modal content */
.uf-modal__content{
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8,10,24,.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.uf-modal__header{
  border-bottom: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(800px 220px at 20% 0%, rgba(99,179,255,.14), transparent 55%),
    radial-gradient(700px 220px at 80% 20%, rgba(155,107,255,.12), transparent 55%),
    rgba(8,10,24,.52);
}

.uf-modal__close{
  color: rgba(255,255,255,.86);
  text-shadow: none;
  opacity: 1;
}
.uf-modal__close:hover{ opacity: 1; }

.uf-modal__body{
  color: rgba(255,255,255,.86);
}

/* KV layout inside modals */
.uf-kv{
  display: grid;
  gap: 10px;
}
.uf-kv__row{
  display:flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.uf-kv__k{
  color: rgba(255,255,255,.70);
  font-weight: 600;
}
.uf-kv__v{
  color: rgba(255,255,255,.92);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* =========================
   Modal + Backdrop layering (FIXED)
========================= */

/* Backdrop stays above page content */
.modal-backdrop{
  backdrop-filter: blur(8px);
  opacity: 0.35 !important;
  z-index: 200000 !important;
}

/* Modal stays above backdrop */
.modal{
  z-index: 200010 !important;
}

/* Header/navbar should NOT be above the modal */
header, .navbar, [role="navigation"]{
  z-index: 1000 !important;          /* below backdrop/modal */
}

/* When modal is open, prevent header from catching clicks */
body.modal-open header,
body.modal-open .navbar,
body.modal-open [role="navigation"]{
  pointer-events: none !important;
}

/* But keep the modal clickable */
body.modal-open .modal{
  pointer-events: auto !important;
}


/* =========================
   Animation hooks
========================= */
.uf-animate-in{
  will-change: transform, opacity, filter;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .uf-row,
  .uf-btn.btn{
    transition: none !important;
  }
  .uf-orb{
    display: none;
  }
}

/* Responsive */
@media (max-width: 980px){
  .uf-head{
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px){
  .uf-page{ padding-top: 100px; }
  .uf-card__top{ padding: 16px 14px 6px; }
  .uf-tableWrap{ padding: 0 8px 12px; }
}

/* =========================
   Modal visual emphasis (CYAN)
========================= */

/* Modal title in cyan */
.uf-modal__header .modal-title{
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 0 12px rgba(30,230,255,.35);
}

/* Cyan accent underline under header */
.uf-modal__header{
  position: relative;
}

.uf-modal__header::after{
  content:"";
  position:absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan),
    var(--blue),
    var(--cyan),
    transparent
  );
  opacity: .75;
}

/* Stronger cyan glass border */
.uf-modal__content{
  border: 1px solid rgba(30,230,255,.35);
  box-shadow:
    0 0 0 1px rgba(30,230,255,.18),
    0 30px 90px rgba(0,0,0,.55),
    0 0 45px rgba(30,230,255,.18);
  transition: box-shadow .35s ease, border-color .35s ease;
}

/* Cyan glow on hover / focus (subtle blink effect) */
.uf-modal__content:hover{
  border-color: rgba(30,230,255,.75);
  box-shadow:
    0 0 0 1px rgba(30,230,255,.35),
    0 30px 90px rgba(0,0,0,.55),
    0 0 70px rgba(30,230,255,.35);
}

/* Close button cyan hover */
.uf-modal__close{
  filter: drop-shadow(0 0 6px rgba(30,230,255,.25));
}
.uf-modal__close:hover{
  filter: drop-shadow(0 0 12px rgba(30,230,255,.65));
}

/* =========================================
   Fix: Hover text should NOT turn black
   Download + View Map → cyan on hover
========================================= */

.uf-btn--ghost:hover,
.uf-btn--ghost:active,
.uf-btn--ghost:focus-visible,
.uf-btn--warn:hover,
.uf-btn--warn:active,
.uf-btn--warn:focus-visible{
  color: var(--cyan) !important;
  text-decoration: none !important;
}

/* ensure inner elements also follow */
.uf-btn--ghost:hover *,
.uf-btn--warn:hover *{
  color: var(--cyan) !important;
}

/* =========================================
   User Files: 3D Spline background (Home Applications style)
========================================= */

/* show spline when uf--spline is present (you already have this) */
/* .uf-page.uf--spline .uf-spline{ display:block; } */

.uf-spline{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* full-bleed iframe like apps3d-bg */
.uf-spline iframe{
  position: absolute;
  inset: -6vh -6vw;
  width: 112vw;
  height: 112vh;
  border: none;
  opacity: .72;
  filter: blur(0.25px) saturate(1.35) brightness(1.30) contrast(1.08);
  transform: none; /* override old scale(1.05) */
  pointer-events: none;
}

/* vignette overlay */
.uf-spline__vignette{
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 55% at 50% 35%,
    rgba(0,0,0,.05),
    rgba(0,0,0,.30)
  );
}

/* grain overlay */
.uf-spline__grain{
  position: absolute;
  inset: 0;
  opacity: .06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

/* Optional: make uf-page base gradient more subtle so 3D is dominant */
.uf-page{
  background: linear-gradient(180deg, rgba(7,9,21,.35), rgba(11,16,38,.55));
}
/* --- Force 3D background ON, without uf--spline --- */
.uf-spline{
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* keep your content above the 3D layer */
.uf-container{ position: relative; z-index: 5 !important; }

/* keep your other background layer below */
.uf-bg{ z-index: 0 !important; }
