:root{
  --accent:#007bff;
  --accent-2:#3399ff;
  --bg:#f8fafc;
  --card:#ffffff;
  --text:#1e293b;
  --muted:#2d2f33;
  --glass: rgba(255,255,255,0.6);

  /* Spacing system */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-mxl: 36px;
  --space-2xl: 48px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}

/* --- HEADER --- */
header {
  text-align: center;
  margin-top: 28px;
  margin-bottom: var(--space-xl);
}
header h1 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}
header p {
  margin-top: var(--space-sm);
  font-size: 1.1rem;
  font-weight: 500;
  color:var(--muted);
}

/* --- MAIN LAYOUT --- */
main{
  max-width:820px;
  margin:-28px auto var(--space-xl);
  padding:var(--space-md);
}

/* --- CARD --- */
.card{
  background:var(--card);
  border-radius:14px;
  padding:var(--space-lg);
  box-shadow:0 8px 24px rgba(16,24,40,0.06);
}

/* --- INPUT GROUPS --- */
.upload-section{
  display:flex;
  flex-direction:column;
  gap:var(--space-md);
}
.upload-section input[type="file"]{
  cursor: pointer;
}

.primer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

label{
  display:block;
  margin-bottom:var(--space-xs);
  font-weight:600;
  color:var(--text);
}
.primer-header label {
  margin-bottom: 2px;
}

input[type="file"],
input[type="number"],
input[type="text"] {
  width:100%;
  padding:var(--space-sm);
  border-radius:10px;
  border:1px solid #e6eefc;
  background:#f7fbff;
  font-size:14px;
  color:var(--text);
}

.row{
  display:flex;
  gap:var(--space-md);
}

/* Primer Action Buttons */
.primer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.primer-actions button {
  background: #f0f4f8;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  width: 36px;
  height: 28px;
  font-size: 18px;
}

.primer-actions button:hover {
  background: #e2e8f0;
}

.primer-actions .reset-btn {
  width: 28px;
  height: 28px;
  font-size: 16px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
  color:#555;
}

.small{
  font-size:15px;
  color:var(--muted);
  margin-top: var(--space-xxs);
}

.hint{
  display:inline-flex;
  align-items:center;
  gap:var(--space-xs);
}

.info-btn{
  background:transparent;
  border:0;
  color:var(--accent);
  cursor:pointer;
  font-weight:700;
  padding: var(--space-xs);
  border-radius:8px;
}
.info-btn:hover{background:rgba(7,89,181,0.06)}

button.primary{
  background:var(--accent);
  color:#fff;
  border:0;
  padding:var(--space-sm) var(--space-md);
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  margin-top:4px;
}
button.primary:hover{background:var(--accent-2)}

/* --- RESULT SECTION --- */
.result-section{
  margin-top:var(--space-lg);
}
.result-section pre {
  margin: 0; /* remove browser default weird spacing */
}
.result-title{
  color:var(--accent);
  font-weight:700;
  margin-bottom:var(--space-xs);
}
.result-block{
  padding: 14px 0; /* vertical breathing room */
  border-bottom: 1px solid #9ca3af;
}
.result-block:last-child {
  border-bottom: none; /* no line after the last one */
}
    
.result-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.result-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fafafa;
  color: #333;
  cursor: pointer;
  transition: 0.15s ease;
}

.result-btn:hover {
  background: #f0f0f0;
  border-color: rgba(0,0,0,0.18);
}

.result-btn:active {
  background: #e5e5e5;
}

.result-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}
pre{
  max-height: 360px;
  overflow-y: auto;
  background:#fbfdff;
  border:1px solid #e6eefc;
  padding:var(--space-md);
  border-radius:10px;
  white-space:pre-wrap;
  word-break:break-word;
  font-family:Consolas,monospace;
  font-size:14px;
}

/* --- HOW IT WORKS --- */
.how{
  margin-top:24px;
  background:var(--card);
  padding:12px 24px 24px;
  border-radius:12px;
  box-shadow:0 8px 24px rgba(16,24,40,0.06);
}

/* --- FOOTER --- */
footer{
  max-width:820px;
  margin:var(--space-lg) auto var(--space-2xl);
  padding:var(--space-xs) var(--space-md);
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:var(--muted);
  font-size:15px;
}
.footer-links{
  display:flex;
  gap:var(--space-sm);
  justify-content:space-between;
  align-items:center;
}
.linkish{
  color:var(--accent);
  text-decoration:none;
  font-weight:600;
  cursor:pointer;
}
.linkish.small{
  font-weight:500;
  font-size:14px;
}

/* --- TOOLTIP --- */
.tooltip{
  position:absolute;
  background:#fff;
  border:1px solid #e6eefc;
  padding:var(--space-sm);
  border-radius:8px;
  box-shadow:0 8px 20px rgba(16,24,40,0.25);
  z-index:200;
  width:200px;
  color:var(--text);
  max-width: 90vw;
  pointer-events: none;
}

/* --- MODAL --- */
.overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:80;
}
.overlay.show{display:flex}

.backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,12,24,0.36);
  backdrop-filter:blur(6px);
  opacity:0;
  transition:opacity .22s ease;
}
.backdrop.show{opacity:1}

.modal{
  position:relative;
  background:var(--card);
  border-radius:12px;
  padding:var(--space-md);
  max-width:520px;
  width:92%;
  box-shadow:0 12px 36px rgba(2,6,23,0.28);
  transform:translateY(10px) scale(.98);
  opacity:0;
  transition:transform .22s cubic-bezier(.2,.9,.2,1),opacity .18s;
}
.modal.show{
  transform:translateY(0) scale(1);
  opacity:1;
}

.modal h3{margin:0 0 var(--space-xs)}
.modal .close{
  position:absolute;
  right:12px;
  top:10px;
  border:0;
  background:transparent;
  font-size:18px;
  cursor:pointer;
}

.modal input,
.modal textarea{
  width:100%;
  padding:var(--space-sm);
  margin-top:var(--space-xs);
  border-radius:8px;
  border:1px solid #e6eefc;
  background:#fbfdff;
}

input[type="text"].text-primer {
  padding:14px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#1e293b;
}

.modal textarea{
  min-height:120px;
  resize:vertical;
}

.modal .actions{
  display:flex;
  gap:var(--space-xs);
  justify-content:flex-end;
  margin-top:var(--space-md);
}

.modal .btn-send{
  background:var(--accent);
  color:#fff;
  border:0;
  padding:var(--space-sm) var(--space-md);
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
}
.modal .btn-send[disabled]{opacity:0.6;cursor:default}

/* SUPPORT MODAL */

.support-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 18px;  
}

.support-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px solid #e5e9f0;
  color: #1e293b;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.support-item:hover {
  background: #ffffff;
  border-color: #d0d7e2;
  cursor: pointer;
  transform: translateY(-1px);
}

/* Base soft ring icons */
.support-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.08),   /* softer shadow */
    0 0 0 2px rgba(0, 0, 0, 0.03);     /* subtle ring */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.support-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.support-icon.kofi-icon img{
  padding-top: 3px;
  width: 28px;
  height: 28px;
}

/* Hover animation */
.support-icon:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.12),
    0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Brand-colored glow rings */
.paypal-icon {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.08),
    0 0 0 2px rgba(0, 112, 186, 0.3);  /* slightly stronger blue glow */
}

.kofi-icon {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.08),
    0 0 0 2px rgba(255, 95, 95, 0.35);  /* subtle red glow */
}

.lp-icon {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.08),
    0 0 0 2px rgba(246, 201, 21, 0.35); /* subtle yellow glow */
}

.dana-icon {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.08),   
    0 0 0 2px rgba(6, 143, 231, 0.35);   /* subtle DANA accent ring */
}


/* gentle gradient background for depth */
.support-icon.paypal-icon {
  background: linear-gradient(145deg, #ffffff, #e6f0fb);
}

.support-icon.kofi-icon {
  background: linear-gradient(145deg, #ffffff, #fff5f5);
}

.support-icon.lp-icon {
  background: linear-gradient(145deg, #ffffff, #fff8e6);
}

.support-icon.dana-icon {
  background: linear-gradient(145deg, #ffffff,#e9f4ff);    
}

/* --- SENT POPUP --- */
.sent-popup{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%) scale(.8);
  z-index:110;
  display:none;
  align-items:center;
  flex-direction:column;
  gap:var(--space-sm);
}
.sent-popup.show{
  display:flex;
  animation:popupIn .45s cubic-bezier(.2,.9,.2,1);
}

@keyframes popupIn {
  0%{opacity:0;transform:translate(-50%,-50%) scale(.7)}
  60%{opacity:1;transform:translate(-50%,-50%) scale(1.06)}
  100%{opacity:1;transform:translate(-50%,-50%) scale(1)}
}

.check-wrap{
  width:110px;
  height:110px;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,0.95),#fff);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 12px 30px rgba(2,6,23,0.18);
}
.sent-text{
  font-weight:700;
  font-size: 24px;
  color:var(--text);
}
.x-small{
  position:absolute;
  right:8px;
  top:8px;
  background:transparent;
  border:0;
  font-size:18px;
  cursor:pointer;
}
.check-svg{width:56px;height:56px}
.path {
  stroke-dasharray:1000;
  stroke-dashoffset:1000;
  animation:dash .6s ease forwards .05s;
  stroke-linecap:round;
  stroke-width:5;
}
@keyframes dash { to { stroke-dashoffset:0; } }

.bounce{
  animation:bounceUp .6s cubic-bezier(.2,.9,.2,1) .12s both;
}
@keyframes bounceUp {
  0%{transform:translateY(20px) scale(.9);opacity:0}
  60%{transform:translateY(-8px) scale(1.03);opacity:1}
  100%{transform:translateY(0) scale(1)}
}

.dna-spinner {
  margin: 0 auto;
  width: 40px;
  height: 40px;
  border: 4px solid transparent;
  border-top: 4px solid #3b82f6;
  border-right: 4px solid #3b82f6;
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
  header { padding: var(--space-lg) 1rem; }
  header h1 { font-size: 2.2rem; }
  header p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 0;
  }
  .row {
    flex-direction: column;
    gap: var(--space-md);
  }
}
