:root{
  --bg:#070b16;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.12);

  --text:#e8efff;
  --muted: rgba(232,239,255,0.60);

  --blue:#6aa8ff;
  --purple:#7c3aed;

  --radius:18px;
  --radius-sm:12px;
  --shadow: 0 18px 55px rgba(0,0,0,.55);
}

*{ box-sizing:border-box; }

/* ===== Persian font (Vazir) ===== */
@font-face{
  font-family: "Vazir";
  src:
    url("/static/fonts/Vazir-Medium.woff2") format("woff2"),
    url("/static/fonts/Vazir-Medium.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ✅ FIXED base layout */
html, body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  overflow-x: hidden; /* فقط افقی */
}

/* background blobs */
.bg-blobs{
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 450px at 18% 0%, rgba(106,168,255,.20), transparent 62%),
    radial-gradient(900px 500px at 92% 0%, rgba(124,58,237,.22), transparent 60%),
    radial-gradient(700px 520px at 50% 92%, rgba(106,168,255,.10), transparent 70%);
}

/* ✅ Page as flex column so footer can stick to bottom */
.page{
  max-width: 1100px;
  margin: 0 auto;
  padding: 54px 22px 40px;
  position: relative;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ✅ Wrap your {% block content %} with <main class="content"> ... */
.content{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* header */
.header{
  text-align:center;
  margin-bottom: 14px;
}
.title{
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #aebcff;
  text-shadow: 0 10px 40px rgba(0,0,0,.55);
}
.subtitle{
  margin-top: 6px;
  font-size: 14px;
  color: rgba(232,239,255,0.75);
}

.rule{
  height:1px;
  width: 78%;
  margin: 18px auto 34px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}

/* cards */
.card{
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card-xl{
  width: 880px;
  margin: 0 auto 26px;
  padding: 22px;
}

.card-md{
  width: 880px;
  margin: 0 auto 18px;
  padding: 22px;
}

.form{ width: 100%; }

.field{
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.06);
}

.textarea{
  width:100%;
  min-height: 300px;
  resize: vertical;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.28);
  color: var(--text);
  padding: 18px 18px;
  outline: none;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Vazir", monospace;
  transition: border .18s, box-shadow .18s;
}
.textarea::placeholder{ color: rgba(232,239,255,0.28); }
.textarea:focus{
  border-color: rgba(106,168,255,0.55);
  box-shadow: 0 0 0 3px rgba(106,168,255,0.12);
}

/* bottom row */
.bottom-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 14px 10px 0;
  flex-wrap: wrap;
}

.expire{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.expire-label{
  display:flex;
  gap: 8px;
  align-items:center;
  font-size: 13px;
  color: rgba(232,239,255,0.75);
}

/* select + centered arrow */
.select{
  width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background-color: rgba(0,0,0,0.26);
  color: var(--text);
  outline:none;

  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;

  background-image:
    linear-gradient(45deg, transparent 50%, #cbd5f5 50%),
    linear-gradient(135deg, #cbd5f5 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.select:focus{
  border-color: rgba(106,168,255,0.55);
}

/* dropdown options white + black text */
select option, select optgroup{
  background: #ffffff;
  color: #000000;
}

/* button */
.btn{
  padding: 12px 22px;
  border-radius: 12px;
  border: 0;
  color: #f4f2ff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(124,58,237,0.75));
  box-shadow: 0 14px 36px rgba(124,58,237,0.35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 44px rgba(124,58,237,0.50);
  filter: brightness(1.05);
}

.below-row{
  padding: 12px 10px 6px;
}

.link{
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.link:hover{ text-decoration: underline; }

/* footer */
.footer {
  margin-top: auto; /* ✅ push footer to bottom */
  padding: 1.2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: #aaa;
}

.footer-strong{
  color: rgba(232,239,255,0.55);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 600;
  color: #fff;
}

.footer-sep {
  margin: 0 0.4rem;
  opacity: 0.4;
}

.footer-link {
  color: #9ddcff;
  text-decoration: none;
  font-weight: 500;
}

.footer-link:hover {
  text-decoration: underline;
}

/* created page */
.center{ text-align:center; }

.check{
  width: 58px;
  height: 58px;
  border-radius: 999px;
  margin: 4px auto 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(34,197,94,0.18);
  border: 1px solid rgba(34,197,94,0.35);
  color: #73ffb1;
  font-size: 30px;
}

.h1{ font-size: 22px; font-weight: 800; }
.muted{ color: var(--muted); margin-top: 6px; }

.section-title{
  font-weight: 800;
  color: rgba(200,190,255,0.85);
  margin-bottom: 12px;
}

.copybox{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.24);
  flex-wrap: wrap;
}

.copyinput{
  flex:1;
  min-width: 150px;
  border:0;
  outline:none;
  background: transparent;
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 14px;
}

.iconbtn{
  width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease;
}
.iconbtn:hover{
  transform: scale(1.05);
  background: rgba(255,255,255,0.10);
}

.hint{
  margin-top: 10px;
  color: rgba(232,239,255,0.60);
  font-size: 13px;
}

.actions{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.toplinks{
  display:flex;
  align-items:center;
  gap: 8px;
  color: rgba(232,239,255,0.55);
  font-size: 13px;
  flex-wrap: wrap;
}
.dot{ opacity:.35; margin: 0 6px; }

.inline-form{ display:inline; }

/* ✅ No internal scroll inside paste box */
.pre{
  margin-top: 12px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.30);
  overflow: visible;          /* ✅ changed from auto */
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Vazir", monospace;
  font-size: 14px;
}

/* error */
.error{
  margin-top: 10px;
  color: #ffb4b4;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,180,180,0.25);
  background: rgba(255,180,180,0.08);
}

/* success */
.success{
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(125,255,178,0.28);
  background: rgba(125,255,178,0.10);
  color: #7dffb2;
  font-weight: 700;
  animation: fadeIn .25s ease-out;
}

@keyframes fadeIn{
  from{ opacity:0; transform: translateY(-6px); }
  to{ opacity:1; transform: translateY(0); }
}

/* ===== Delete button ===== */
.relative{ position: relative; }

.top-actions{
  position: absolute;
  top: 14px;
  right: 16px;
}

.delete-btn{
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.45);
  color: #ff9b9b;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .12s;
}
.delete-btn:hover{
  background: rgba(239,68,68,0.22);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239,68,68,0.25);
}
.delete-btn.small{
  padding: 4px 10px;
  font-size: 12px;
}

/* ===== 404 / Not Found ===== */
.notfound-card{ padding: 32px 26px; }
.notfound-icon{
  font-size: 44px;
  margin-bottom: 12px;
  text-align: center;
  opacity: 0.9;
}
.notfound-title{
  text-align: center;
  margin-bottom: 6px;
}
.notfound-text{
  text-align: center;
  font-size: 14px;
  line-height: 1.9;
}
.notfound-actions{
  margin-top: 18px;
  text-align: center;
}
.notfound-link{
  font-size: 14px;
  font-weight: 700;
}

/* controls group (expires + password) */
.left-controls{
  display:flex;
  gap: 18px;
  align-items:flex-end;
  flex-wrap: wrap;
}

.pass{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.pass-input{
  width: 200px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.26);
  color: var(--text);
  outline: none;
}
.pass-input::placeholder{
  color: rgba(232,239,255,0.35);
}
.pass-input:focus{
  border-color: rgba(106,168,255,0.55);
  box-shadow: 0 0 0 3px rgba(106,168,255,0.12);
}

.pass-input.wide{
  width: min(420px, 90%);
}

/* locked view */
.lockbox{
  margin-top: 14px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  text-align: center;
}
.lock-title{
  font-weight: 800;
  font-size: 16px;
  color: rgba(232,239,255,0.9);
}

.unlock-form{
  display:flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.lock-hint{
  margin-top: 8px;
  color: rgba(232,239,255,0.65);
  font-size: 13px;
  text-align: center;
  line-height: 1.8;
}

/* stack input then button vertically */
.unlock-form-vertical{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.unlock-form-vertical .pass-input.wide{
  width: min(520px, 92%);
}

.unlock-form-vertical .btn{
  min-width: 140px;
}

/* Fix password input size (locked view) */
.unlock-form-vertical .pass-input.wide{
  width: 100%;
  max-width: 420px;
  height: 44px;

  padding: 0 14px;
  font-size: 14px;
  line-height: 44px;

  border-radius: 12px;
  box-sizing: border-box;
}

/* ===== RESPONSIVE MOBILE STYLES ===== */
@media (max-width: 768px){
  .page{
    padding: 32px 16px 32px;
  }

  .content{
    align-items: flex-start; /* موبایل بهتره بالا باشه */
  }

  .title{
    font-size: 36px;
    letter-spacing: -0.5px;
  }

  .subtitle{
    font-size: 13px;
  }

  .rule{
    width: 100%;
    margin: 16px auto 24px;
  }

  .card-xl,
  .card-md{
    width: 100%;
    margin: 0 auto 16px;
    padding: 16px;
  }

  .textarea{
    min-height: 200px;
    padding: 14px;
    font-size: 16px;
  }

  .bottom-row{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0 0;
  }

  .select{
    width: 100%;
  }

  .btn{
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
  }

  .footer-content{
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .footer-sep{
    margin: 0.2rem 0;
  }

  .topbar{
    flex-direction: column;
    align-items: center;
  }

  .toplinks{
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .dot{
    display: none;
  }

  .copybox{
    flex-direction: column;
    align-items: stretch;
  }

  .copyinput{
    width: 100%;
    min-width: unset;
    word-break: break-all;
  }

  .iconbtn{
    width: 100%;
    height: 44px;
  }

  .actions{
    flex-direction: column;
  }

  .actions .btn{
    width: 100%;
  }

  .left-controls{
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .pass{
    gap: 6px;
  }

  .pass-input,
  .pass-input.wide{
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
    line-height: 44px;
  }

  .unlock-form{
    flex-direction: column;
    align-items: stretch;
  }

  .unlock-form-vertical{
    gap: 10px;
  }

  .unlock-form-vertical .pass-input.wide{
    width: 100%;
  }

  .unlock-form-vertical .btn{
    min-width: unset;
    width: 100%;
  }

  .top-actions{
    top: 10px;
    right: 10px;
  }

  .delete-btn{
    padding: 8px 12px;
    font-size: 12px;
  }

  .check{
    width: 50px;
    height: 50px;
    font-size: 26px;
  }

  .h1{
    font-size: 18px;
  }

  .pre{
    padding: 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px){
  .page{
    padding: 24px 12px 24px;
  }

  .title{
    font-size: 28px;
  }

  .subtitle{
    font-size: 12px;
  }

  .card-xl,
  .card-md{
    padding: 14px;
    margin: 0 auto 12px;
  }

  .textarea{
    min-height: 150px;
    padding: 12px;
    font-size: 16px;
  }

  .btn{
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  .footer{
    padding: 1rem 0;
    font-size: 0.75rem;
  }

  .footer-link{
    font-size: 0.75rem;
  }

  .select{
    padding: 8px 8px;
    font-size: 14px;
  }

  .error,
  .success{
    padding: 8px 10px;
    font-size: 12px;
    margin-top: 8px;
  }

  .copyinput{
    font-size: 12px;
  }

  .iconbtn{
    width: 40px;
    height: 40px;
  }

  .pass-input,
  .pass-input.wide{
    font-size: 16px;
  }

  .notfound-card{
    padding: 24px 16px;
  }

  .notfound-icon{
    font-size: 36px;
  }

  .notfound-text{
    font-size: 13px;
  }
  
  /* --- View page top bar: keep actions in ONE row --- */
  .topbar{
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .toplinks{
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;

    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;

    white-space: nowrap !important;
  }

  .toplinks > *{
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
  }

  .dot{
    display: none !important;
  }

  .toplinks a.link{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 12px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    font-size: 13px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }

  .toplinks form.inline-form{
    display: inline-flex !important;
    margin: 0 !important;
  }

  .toplinks .delete-btn.small{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 12px !important;
    font-size: 13px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  .toplinks::-webkit-scrollbar{
    display: none;
  }
}

/* ===== Copy button inside paste box ===== */
.paste-box{
  position: relative;
}

.copy-inside{
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.35);
  color: inherit;
  backdrop-filter: blur(6px);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.copy-inside:hover{
  background: rgba(0,0,0,0.55);
}
.copy-inside:active{
  transform: scale(0.95);
}

/* Make space so button doesn't cover text */
.paste-box .pre{
  padding-top: 44px;
}

/* Hidden textarea for select() */
.copy-hidden{
  position: absolute;
  left: -9999px;
  top: -9999px;
}
