/* =========================================================
   ALBUKHR TESTNET — SHARED UI STYLESHEET
   Scope: Testnet pages only
   No Mainnet CSS dependency
========================================================= */

:root{
  --albukhr-green:#0f7a3d;
  --albukhr-green-2:#19b36b;
  --albukhr-green-soft:#e8f6ee;
  --albukhr-green-pale:#f4fff8;

  --testnet-gold:#f0ad00;
  --testnet-gold-dark:#795900;
  --testnet-gold-soft:#fff9e9;

  --text:#163322;
  --muted:#65736b;
  --muted-2:#87928c;
  --border:#dfe9e3;
  --page:#f5f8f6;
  --white:#fff;

  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
  --shadow-sm:0 4px 14px rgba(15,122,61,.05);
  --shadow-md:0 8px 24px rgba(15,122,61,.08);
}

/* =========================
   RESET
========================= */

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

html{
  width:100%;
  min-height:100%;
  scroll-behavior:smooth;
}

body{
  width:100%;
  min-height:100%;
  margin:0;
  overflow-x:hidden;
  color:var(--text);
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(15,122,61,.07),
      transparent 280px
    ),
    linear-gradient(
      145deg,
      #f4fff8 0%,
      #fff 42%,
      var(--page) 100%
    );
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img,
svg{
  max-width:100%;
}

img{
  display:block;
}

button,
a{
  -webkit-tap-highlight-color:transparent;
}

button{
  font:inherit;
}

a{
  color:inherit;
}

/* =========================
   HEADER
========================= */

.header{
  position:sticky;
  top:0;
  z-index:100;
  width:100%;
  min-height:58px;
  padding:0 16px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  background:var(--albukhr-green);
  color:#fff;

  box-shadow:0 3px 14px rgba(0,0,0,.10);
}

.header a{
  color:#fff;
  text-decoration:none;
  font-weight:800;
}

.header strong{
  font-size:17px;
  letter-spacing:.4px;
}

.env{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:27px;
  padding:5px 10px;

  border:1px solid rgba(240,173,0,.65);
  border-radius:999px;

  background:rgba(240,173,0,.14);
  color:#fff;

  font-size:9px;
  font-weight:900;
  letter-spacing:.8px;
}

/* =========================
   MAIN PAGE CONTAINER
========================= */

main{
  width:100%;
  max-width:1000px;
  margin:0 auto;
  padding:20px 16px 90px;
}

/* =========================
   HERO
========================= */

.hero{
  position:relative;
  overflow:hidden;

  margin-bottom:20px;
  padding:22px;

  background:
    linear-gradient(
      135deg,
      #fff 0%,
      #f2fff7 100%
    );

  border:1px solid #dfeae4;
  border-radius:var(--radius-lg);

  box-shadow:var(--shadow-md);
}

.hero::after{
  content:"";
  position:absolute;
  width:180px;
  height:180px;
  right:-90px;
  top:-90px;

  border-radius:50%;
  background:rgba(15,122,61,.06);

  pointer-events:none;
}

.eyebrow{
  display:block;
  color:var(--albukhr-green);

  font-size:10px;
  font-weight:900;
  letter-spacing:1px;
}

.hero h1{
  position:relative;
  z-index:1;

  margin:7px 0 8px;

  color:#14251b;
  font-size:29px;
  line-height:1.12;
  letter-spacing:-.4px;
}

.hero p{
  position:relative;
  z-index:1;

  margin:0;

  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}

/* =========================
   TESTNET STATUS / NOTICE
========================= */

.notice{
  display:flex;
  align-items:flex-start;
  gap:10px;

  margin-top:18px;
  padding:14px;

  background:var(--testnet-gold-soft);
  border:1px solid #eee1ad;
  border-radius:var(--radius-md);

  color:#635b3a;
  box-shadow:0 4px 12px rgba(121,89,0,.035);
}

.notice::before{
  content:"!";
  width:25px;
  height:25px;
  flex:0 0 25px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:50%;
  background:var(--testnet-gold);
  color:#fff;

  font-size:13px;
  font-weight:900;
}

.notice strong{
  display:block;
  color:var(--testnet-gold-dark);
  font-size:11px;
}

.notice p{
  margin:5px 0 0;
  color:#766f56;
  font-size:10px;
  line-height:1.55;
}

.status{
  display:inline-flex;
  align-items:center;

  min-height:20px;
  padding:3px 7px;

  border-radius:999px;
  background:var(--albukhr-green-soft);
  color:var(--albukhr-green);

  font-size:9px;
  font-weight:900;
  letter-spacing:.35px;
  text-transform:uppercase;
}

/* =========================
   SECTION HEADER
========================= */

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

  margin-bottom:12px;
}

.section-head h1,
.section-head h2{
  margin:0;
  color:#14251b;
}

.section-head h2{
  font-size:19px;
  line-height:1.2;
}

.section-head span{
  color:#68766e;
  font-size:10px;
  line-height:1.35;
  text-align:right;
}

/* =========================
   PROJECT GRID
========================= */

.project-grid{
  display:grid;
  grid-template-columns:
    repeat(auto-fit,minmax(250px,1fr));
  gap:12px;
}

/* =========================
   PROJECT CARD
========================= */

.project-card{
  position:relative;
  min-width:0;
  min-height:88px;

  display:flex;
  align-items:center;
  gap:12px;

  padding:12px;

  overflow:hidden;
  isolation:isolate;

  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-md);

  box-shadow:var(--shadow-sm);

  cursor:pointer;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.project-card::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:3px;

  background:var(--albukhr-green);

  opacity:.7;
}

.project-card:hover{
  transform:translateY(-2px);
  border-color:#c8dfd1;
  box-shadow:0 9px 22px rgba(15,122,61,.10);
}

.project-card:active{
  transform:scale(.985);
}

/* =========================
   PROJECT LOGO
   IMPORTANT:
   The IMG itself has explicit dimensions.
   This prevents intrinsic image dimensions
   from expanding the card.
========================= */

.project-logo-wrap{
  width:64px;
  height:64px;
  min-width:64px;
  flex:0 0 64px;

  display:flex;
  align-items:center;
  justify-content:center;

  overflow:hidden;

  border:1px solid #e0eee5;
  border-radius:13px;

  background:
    linear-gradient(
      145deg,
      #f7fff9,
      #edf8f1
    );

  contain:layout paint;
}

.project-logo{
  width:52px !important;
  height:52px !important;

  min-width:52px !important;
  min-height:52px !important;

  max-width:52px !important;
  max-height:52px !important;

  display:block;

  object-fit:contain;
  object-position:center;

  border-radius:9px;
}

.project-logo-fallback{
  width:44px;
  height:44px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:11px;

  background:var(--albukhr-green);
  color:#fff;

  font-size:17px;
  font-weight:900;
}

/* =========================
   PROJECT CARD CONTENT
========================= */

.project-body{
  min-width:0;
  flex:1;
  overflow:hidden;
}

.project-body h3{
  max-width:100%;
  margin:0 0 5px;

  overflow:hidden;

  color:#17241c;
  font-size:14px;
  font-weight:800;
  line-height:1.25;

  white-space:nowrap;
  text-overflow:ellipsis;
}

.project-body p{
  max-width:100%;
  margin:0 0 6px;

  overflow:hidden;

  color:#6b7770;
  font-size:10px;
  line-height:1.35;

  white-space:nowrap;
  text-overflow:ellipsis;
}

/* =========================
   PROJECT DETAIL
========================= */

.project-detail{
  width:100%;
  overflow:hidden;

  padding:20px;

  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);

  box-shadow:var(--shadow-md);
}

.detail-logo{
  width:78px !important;
  height:78px !important;

  min-width:78px !important;
  min-height:78px !important;

  max-width:78px !important;
  max-height:78px !important;

  margin:0 0 14px;

  object-fit:contain;
  object-position:center;

  border:1px solid #e0eee5;
  border-radius:15px;

  background:#f4faf6;
}

.project-detail h1{
  margin:4px 0 10px;

  color:#14251b;
  font-size:27px;
  line-height:1.15;
  word-break:break-word;
}

.project-detail > p{
  margin:0;

  color:#5d6c63;
  font-size:12px;
  line-height:1.6;
}

.project-detail .status{
  margin-bottom:5px;
}

/* =========================
   LOCKED TRANSACTION AREA
========================= */

.project-detail .notice{
  margin-top:18px;
}

/* =========================
   TESTNET DOCK
   Safe for pages using .dock-nav.
========================= */

.dock-nav{
  position:fixed;
  left:50%;
  bottom:12px;
  z-index:1000;

  width:min(330px,calc(100% - 30px));
  min-height:58px;

  display:flex;
  align-items:stretch;
  gap:5px;

  padding:6px;

  transform:translateX(-50%);

  background:rgba(255,255,255,.96);
  border:1px solid rgba(15,122,61,.12);
  border-radius:18px;

  box-shadow:0 10px 28px rgba(0,0,0,.12);

  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);

  transition:
    transform .25s ease,
    opacity .25s ease;
}

.dock-nav.hide{
  transform:translate(-50%,120%);
  opacity:.96;
}

.dock-item{
  min-width:0;
  flex:1;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;

  padding:7px 4px;

  border-radius:13px;

  color:#77837c;
  text-decoration:none;

  font-size:9px;
  font-weight:700;
}

.dock-item.active{
  background:#e9f7ef;
  color:var(--albukhr-green);
}

.dock-icon{
  width:21px;
  height:21px;

  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* =========================
   LOADING / EMPTY STATES
========================= */

#registryStatus{
  min-height:18px;
}

.project-grid:empty::before{
  content:"Loading approved Testnet projects…";

  grid-column:1 / -1;

  display:block;

  padding:18px;

  background:#fff;
  border:1px dashed #cfded5;
  border-radius:var(--radius-md);

  color:#718078;
  font-size:11px;
  text-align:center;
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:700px){

  main{
    padding:16px 13px 90px;
  }

  .hero{
    padding:18px;
  }

  .hero h1{
    font-size:25px;
  }

  .project-grid{
    grid-template-columns:1fr;
  }

  .section-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .section-head span{
    text-align:left;
  }
}

@media(max-width:430px){

  .header{
    padding:0 13px;
  }

  .header strong{
    font-size:15px;
  }

  .env{
    min-height:24px;
    padding:4px 8px;
    font-size:8px;
  }

  main{
    padding:13px 11px 88px;
  }

  .hero{
    padding:16px;
    border-radius:15px;
  }

  .hero h1{
    font-size:23px;
  }

  .hero p{
    font-size:11px;
  }

  .project-card{
    min-height:82px;
    padding:10px;
  }

  .project-logo-wrap{
    width:58px;
    height:58px;
    min-width:58px;
    flex-basis:58px;
  }

  .project-logo{
    width:47px !important;
    height:47px !important;
    min-width:47px !important;
    min-height:47px !important;
    max-width:47px !important;
    max-height:47px !important;
  }

  .project-body h3{
    font-size:13px;
  }

  .project-body p{
    font-size:9px;
  }

  .detail-logo{
    width:70px !important;
    height:70px !important;
    min-width:70px !important;
    min-height:70px !important;
    max-width:70px !important;
    max-height:70px !important;
  }

  .project-detail{
    padding:16px;
    border-radius:15px;
  }

  .project-detail h1{
    font-size:24px;
  }

  .notice{
    padding:12px;
  }
}

/* =========================
   REDUCED MOTION
========================= */

@media(prefers-reduced-motion:reduce){

  html{
    scroll-behavior:auto;
  }

  *,
  *::before,
  *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}

/* =========================================================
   TESTNET NAVIGATION UPDATE
   Three-item dock + clickable Mainnet return control
========================================================= */
.dock-nav{width:min(390px,calc(100% - 24px))}
.header .env[href]{cursor:pointer;text-decoration:none}
.header .env[href]:active{transform:scale(.97)}
@media(max-width:430px){.dock-nav{width:calc(100% - 18px)}}
