:root{
  --bg:#070611;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.10);
  --text:#f2f2f7;
  --muted:#b8b8c6;
  --accent:#a855f7;
  --accent2:#ec4899;
  --border: rgba(255,255,255,0.12);
}

*{ box-sizing:border-box; }
html, body {
  height: 100%;
}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  background-color: var(--bg);
  background-image: radial-gradient(circle at 20% 10%, rgba(168,85,247,0.25), transparent 35%),
                    radial-gradient(circle at 80% 20%, rgba(236,72,153,0.20), transparent 40%),
                    radial-gradient(circle at 50% 90%, rgba(168,85,247,0.12), transparent 45%);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  min-height:100vh;
  
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%;
  align-items: stretch;
}
main {
  flex: 1;
  width: 100%;
}
body.modal-open{
  overflow: hidden;
}

.page-title{
  margin: 0 0 12px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.topbar{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  position: sticky;
  top:0;
  z-index:10;
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{ width:64px; height:64px; border-radius:10px; background: var(--card2); border:1px solid var(--border); }
.brand-title{ font-size:18px; font-weight:700; letter-spacing:0.2px; }
.brand-sub{ font-size:13px; color:var(--muted); }

.nav{
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.container{ max-width: 1100px; margin: 0 auto; padding: 18px; }

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media(min-width: 900px){
  .grid.two{ grid-template-columns: 1fr 1fr; }
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration:none;
  background: rgba(255,255,255,0.06);
  cursor:pointer;
  user-select:none;
}
.btn:hover{ background: rgba(255,255,255,0.10); }
.btn:disabled{ opacity:0.5; cursor:not-allowed; }

.btn-primary{
  border-color: rgba(168,85,247,0.55);
  background: linear-gradient(135deg, rgba(168,85,247,0.55), rgba(236,72,153,0.35));
}

input, textarea{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.30);
  color: var(--text);
  outline:none;
}
textarea{ min-height: 110px; resize: none; overflow-y: auto; }

.row{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.muted{ color: var(--muted); }
.footer{
  padding: 16px;
  text-align:center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
}

.imgbox{
  width:100%;
  aspect-ratio: 1 / 1;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  cursor: zoom-in;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.imgbox:hover{
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(168,85,247,0.6);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.5),
    0 0 20px rgba(168,85,247,0.25);
}
.imgbox img{
  width:100%;
  height:100%;
  object-fit:contain;
}
/* Group boxes */
.group{
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  border-radius: 16px;
  padding: 14px;
  margin: 0;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.group-body{
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.group-body.centered > *{
  width: 100%;
  text-align: center;
}
.group-body.centered .row{
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 12px;
}
.group.group-info{
  background: rgba(0,0,0,0.12);
  border-style: dashed;
}
.group > legend{
  padding: 0 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.2px;
  display: table;
  margin-left: 8px;
}
.group .row{
  width: 100%;
}
.group.centered{
  align-items: center;
  text-align: center;
}
.group.centered .row{
  justify-content: center;
}

/* Select styling */
.select{
  width: 100%;
  padding: 10px 42px 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.30);
  color: var(--text);
  outline: none;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.65) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.65) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 55%,
    calc(100% - 12px) 55%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

.select:hover{
  background-color: rgba(255,255,255,0.06);
}

.select:focus{
  border-color: rgba(168,85,247,0.55);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.18);
}

.select option{
  background: #0b0a16; /* dropdown list background */
  color: var(--text);
}

/* Optional: label tooltip cursor hint */
.has-tip{
  cursor: help;
}
.img-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.img-modal.open{
  display: flex;
}

.img-modal img{
  width: 95vw;
  height: 90vh;
  object-fit: contain;
  border-radius: 16px;
  /* border: 1px solid var(--border); */
  /*background: rgba(255,255,255,0.04); */
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: imgFadeIn 0.2s ease;
}
@keyframes imgFadeIn{
  from{ opacity:0; transform: scale(0.98); }
  to{ opacity:1; transform: scale(1); }
}

.img-modal > .img-modal-close{
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
}

.img-modal-close{
  position: static;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.img-modal-close:hover{
  background: rgba(255,255,255,0.14);
}

/* Menu/Nav icons */
.icon-btn{
  padding: 10px;
  width: 44px;
  height: 44px;
}
.icon-btn svg{
  width: 18px;
  height: 18px;
  fill: var(--text);
  display: block;
}
.icon-btn{
  position: relative;
}
.icon-btn::after{
  content: attr(data-tip);
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;

  background: rgba(0,0,0,0.85);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
}
.icon-btn:hover::after{
  opacity: 1;
}
.icon-btn:hover,
.icon-btn:focus-visible{
  border-color: rgba(168,85,247,0.7);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.4),
    0 0 14px rgba(168,85,247,0.35),
    inset 0 0 10px rgba(168,85,247,0.15);
}
.icon-btn:active{
  box-shadow:
    0 0 18px rgba(168,85,247,0.45),
    inset 0 0 14px rgba(168,85,247,0.25);
}
@media (max-width: 600px){
  .icon-btn{
    width: 40px;
    height: 40px;
    padding: 8px;
  }

  .icon-btn svg{
    width: 18px;
    height: 18px;
  }
}
@media (max-width: 480px){
  .icon-btn::after{
    display: none;
  }
}

/* Account gallery */
.thumb-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.thumb{
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  overflow: hidden;
  cursor: zoom-in;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.thumb:hover{
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(168,85,247,0.6);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.5),
    0 0 20px rgba(168,85,247,0.25);
}

.thumb img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
}

/* Modal actions (download button) */
.img-modal-actions{
  position: absolute;
  top: 18px;
  right: 18px;      /* was left */
  left: auto;
  display:flex;
  gap:10px;
  z-index: 2;
}

.img-modal-download{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 16px;
}
.img-modal-download:hover{
  background: rgba(255,255,255,0.14);
}
.showcase-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

@media (max-width: 600px){
  .showcase-header{
    flex-direction: column;
    align-items:flex-start;
  }
}
.showcase-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.img-modal-stage{
  position: relative;
  width: 95vw;
  height: 90vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* thumb + full both occupy the same stage */
.img-modal-thumb,
.img-modal-full{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  /* border: 1px solid var(--border); */
  /*background: rgba(255,255,255,0.04); */
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* thumb styling */
.img-modal-thumb{
  filter: blur(10px);
  transform: scale(1.02); /* hides blur edges */
  opacity: 1;
  transition: opacity 180ms ease;
}

/* full starts hidden, fades in */
.img-modal-full{
  opacity: 0;
  transition: opacity 180ms ease;
}

/* when loaded */
.img-modal-stage.loaded .img-modal-thumb{
  opacity: 0;
}
.img-modal-stage.loaded .img-modal-full{
  opacity: 1;
}

/* spinner */
.img-modal-spinner{
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.18);
  border-top-color: rgba(168,85,247,0.85);
  animation: imgspin 0.9s linear infinite;
  z-index: 3;
}

/* hide spinner when loaded */
.img-modal-stage.loaded .img-modal-spinner{
  display: none;
}

@keyframes imgspin{
  to { transform: rotate(360deg); }
}
