@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;700;800&display=swap');

:root{
  --bg: #04070c;
  --bg-soft: #0a1119;
  --panel: rgba(11, 16, 24, .94);
  --panel-strong: rgba(16, 23, 34, .98);
  --panel-soft: rgba(255,255,255,.03);
  --line: rgba(148,163,184,.16);
  --line-strong: rgba(45,212,191,.42);
  --text: #edf4fb;
  --muted: #94a7bb;
  --accent: #2dd4bf;
  --accent-strong: #0f766e;
  --accent-alt: #38bdf8;
  --ok: #4ade80;
  --danger: #f87171;
  --shadow: 0 22px 70px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html{min-height:100%}
[hidden]{display:none !important}

body{
  min-height:100svh;
  margin:0;
  font-family:"Noto Kufi Arabic","Segoe UI",Tahoma,sans-serif;
  color:var(--text);
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(620px 300px at 100% 0%, rgba(56,189,248,.10), transparent 60%),
    radial-gradient(680px 360px at 0% 0%, rgba(45,212,191,.08), transparent 62%),
    linear-gradient(180deg, #03060b 0%, #09111a 55%, #04070c 100%);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size:44px 44px;
  opacity:.55;
}

a{
  color:inherit;
  text-decoration:none;
}

button,
input,
textarea,
select{
  font:inherit;
}

img{
  max-width:100%;
  display:block;
}

.container{
  width:min(1120px, 100%);
  margin:0 auto;
  padding:24px 18px 18px;
  flex:1;
  display:flex;
  flex-direction:column;
}

.hero{
  width:100%;
  height:100px;
  background:linear-gradient(180deg, rgba(9,14,22,.96), rgba(12,19,29,.98));
  border-bottom:1px solid var(--line);
  box-shadow:0 10px 30px rgba(0,0,0,.20);
}

.hero-copy{
  position:relative;
  width:min(1120px, 100%);
  height:100%;
  margin:0 auto;
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.hero-brand{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.hero-copy::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(135deg, rgba(45,212,191,.08), transparent 28%),
    linear-gradient(315deg, rgba(56,189,248,.08), transparent 26%);
  pointer-events:none;
}

.hero-copy h1,
.header h1{
  margin:0;
  font-size:clamp(28px, 5vw, 48px);
  line-height:1.25;
}

.hero-logo-wrap{
  display:flex;
  align-items:center;
  margin:0;
  position:relative;
  z-index:1;
}

.hero-logo{
  width:160px;
  height:80px;
  object-fit:contain;
  filter:drop-shadow(0 10px 20px rgba(0,0,0,.32));
}

.hero-badge,
.result-badge{
  position:relative;
  z-index:1;
  display:inline-flex;
  width:fit-content;
  align-items:center;
  padding:8px 12px;
  border:1px solid rgba(45,212,191,.20);
  background:rgba(45,212,191,.06);
  color:#eafffb;
  font-size:12px;
  font-weight:700;
  letter-spacing:.01em;
}

.subtitle{
  margin:0;
  color:var(--muted);
  line-height:1.9;
  font-size:15px;
}

.card{
  background:linear-gradient(180deg, var(--panel), var(--panel-strong));
  border:1px solid var(--line);
  padding:22px;
  box-shadow:var(--shadow);
}

.header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.workspace{
  position:relative;
  overflow:hidden;
}

.workspace::before{
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:180px;
  height:180px;
  background:linear-gradient(135deg, rgba(45,212,191,.10), transparent 65%);
  pointer-events:none;
}

.workspace-grid{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:18px;
}

.upload-panel{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.dropzone{
  position:relative;
  border:1px dashed rgba(148,163,184,.32);
  background:
    linear-gradient(180deg, rgba(8,12,19,.96), rgba(13,19,28,.99));
  padding:22px;
  cursor:pointer;
  transition:border-color .18s ease, transform .18s ease, background .18s ease;
  outline:none;
  overflow:hidden;
}

.dropzone::after{
  content:"";
  position:absolute;
  inset:12px;
  border:1px solid rgba(255,255,255,.04);
  pointer-events:none;
}

.dropzone:hover{
  transform:translateY(-2px);
  border-color:rgba(45,212,191,.46);
}

.dropzone:focus{
  box-shadow:0 0 0 4px rgba(45,212,191,.12);
}

.dropzone.dragover{
  border-color:rgba(56,189,248,.54);
  background:linear-gradient(180deg, rgba(11,18,28,.98), rgba(17,27,39,.99));
}

.dropzone.is-disabled{
  opacity:.72;
  cursor:wait;
}

.file-input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

.dz-inner{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  justify-content:center;
  min-height:230px;
  text-align:center;
}

.dz-mark{
  width:84px;
  height:84px;
  display:grid;
  place-items:center;
  font-weight:800;
  letter-spacing:.08em;
  border:1px solid rgba(45,212,191,.24);
  background:linear-gradient(180deg, rgba(45,212,191,.14), rgba(56,189,248,.08));
}

.dz-title{
  font-weight:800;
  font-size:clamp(20px, 3vw, 30px);
  line-height:1.75;
}

.dz-hint{
  color:var(--muted);
  font-size:13px;
  line-height:1.9;
  max-width:40ch;
}

.selection-strip{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.05);
  flex-wrap:wrap;
}

.selection-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.selection-label,
.label{
  font-size:12px;
  color:var(--muted);
}

.file-name{
  font-size:14px;
  font-weight:700;
  line-height:1.8;
  word-break:break-word;
}

.action-row,
.row,
.copy-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.action-row{
  justify-content:center;
}

.upload-formats{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  line-height:1.9;
}

.btn{
  appearance:none;
  min-width:180px;
  padding:14px 18px;
  border:1px solid rgba(45,212,191,.26);
  background:linear-gradient(180deg, rgba(19,32,35,.96), rgba(11,20,23,.98));
  color:var(--text);
  font-weight:700;
  cursor:pointer;
  transition:transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
}

.btn:hover:not(:disabled){
  transform:translateY(-2px);
  border-color:rgba(45,212,191,.5);
  background:linear-gradient(180deg, rgba(22,39,43,.98), rgba(12,23,26,.98));
}

.btn:disabled{
  opacity:.48;
  cursor:not-allowed;
  box-shadow:none;
}

.btn-ghost{
  border-color:rgba(148,163,184,.18);
  background:rgba(255,255,255,.02);
}

.btn-ghost:hover:not(:disabled){
  border-color:rgba(56,189,248,.34);
  background:rgba(56,189,248,.06);
}

.btn-inline{
  min-width:auto;
  padding:10px 14px;
  font-size:13px;
}

.btn-open{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:fit-content;
}

.status{
  min-height:28px;
  color:var(--muted);
  line-height:1.8;
}

.status:not(:empty){
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.025);
}

.status.error{
  color:#ffd3d3;
  border-color:rgba(248,113,113,.28);
  background:rgba(127,29,29,.18);
}

.status.ok{
  color:#dbffea;
  border-color:rgba(74,222,128,.24);
  background:rgba(20,83,45,.18);
}

.progress-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.02);
}

.progress{
  height:12px;
  background:rgba(255,255,255,.06);
  overflow:hidden;
  flex:1;
  border:1px solid rgba(255,255,255,.08);
}

.progress-bar{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, var(--accent), var(--accent-alt));
  transition:width .16s linear;
}

.progress-text{
  color:var(--muted);
  font-size:12px;
  min-width:48px;
  text-align:left;
}

.result{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px;
  border:1px solid rgba(56,189,248,.16);
  background:linear-gradient(180deg, rgba(8,14,22,.96), rgba(13,21,33,.98));
}

.result-head{
  display:flex;
  flex-direction:column;
  gap:0;
}

.result-preview{
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.06);
  padding:12px;
  overflow:hidden;
}

.result-preview img{
  width:100%;
  height:auto;
  aspect-ratio:4 / 3;
  object-fit:contain;
  background:#020407;
  border:1px solid rgba(255,255,255,.06);
}

.result-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.result-buttons{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  gap:10px;
}

.result-buttons .btn,
.result-buttons .btn-open{
  flex:1 1 0;
  width:auto;
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.input{
  width:100%;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
  direction:ltr;
  text-align:left;
}

.input:focus{
  border-color:rgba(56,189,248,.34);
  box-shadow:0 0 0 4px rgba(56,189,248,.10);
}

.copy-row .input{
  flex:1 1 260px;
}

code{
  background:rgba(255,255,255,.06);
  padding:2px 6px;
  border:1px solid rgba(255,255,255,.10);
}

.site-footer{
  margin-top:auto;
  padding-top:18px;
}

.footer-inner{
  background:linear-gradient(180deg, rgba(10,15,23,.96), rgba(13,20,29,.98));
  border:1px solid var(--line);
  padding:18px 20px;
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:center;
  text-align:center;
}

.footer-brand{
  font-weight:800;
  letter-spacing:.04em;
  color:#f7fbff;
}

.footer-links{
  width:100%;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  align-items:center;
}

.footer-links a{
  min-width:140px;
  padding:11px 16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  color:var(--text);
  font-size:13px;
  font-weight:700;
  transition:border-color .18s ease, transform .18s ease, background .18s ease;
}

.footer-links a:hover{
  transform:translateY(-2px);
  border-color:rgba(45,212,191,.40);
  background:rgba(45,212,191,.06);
}

.footer-copy{
  color:var(--muted);
  font-size:12px;
}

@media (min-width: 860px){
  .workspace-grid.has-result{
    grid-template-columns:minmax(0, 1.35fr) minmax(320px, .9fr);
    align-items:start;
  }
}

@media (max-width: 640px){
  .container{
    padding:20px 12px 14px;
  }

  .card,
  .hero-copy{
    padding:18px;
  }

  .hero{
    height:100px;
  }

  .hero-copy{
    height:100%;
  }

  .hero-brand{
    gap:10px;
  }

  .subtitle{
    font-size:13px;
  }

  .dropzone{
    padding:18px;
  }

  .dz-inner{
    min-height:190px;
  }

  .btn{
    min-width:0;
    width:100%;
  }

  .btn-inline{
    width:auto;
  }

  .row .btn-open{
    width:100%;
  }

  .footer-links a{
    width:100%;
  }
}
