/* =========================
   PhotoToolsMax - style.css
   Light + Dark Theme (Fixed)
   ========================= */

:root{
  --bg: #f6f8ff;
  --panel: #ffffff;
  --text: #0b1220;
  --muted: rgba(11,18,32,.70);
  --border: rgba(15,23,42,.12);
  --shadow: 0 12px 40px rgba(2,6,23,.08);

  --primary: #6ea2ff;
  --primaryText: #0b1220;

  --chip: rgba(110,162,255,.18);
  --chipBorder: rgba(110,162,255,.35);

  --dropBg: rgba(110,162,255,.08);

  --radius: 18px;
}

html.theme-dark{
  --bg: #060b15;
  --panel: rgba(14,20,40,.88);
  --text: #eaf0ff;
  --muted: rgba(234,240,255,.70);
  --border: rgba(234,240,255,.12);
  --shadow: 0 18px 55px rgba(0,0,0,.35);

  --primary: #7fb0ff;
  --primaryText: #071022;

  --chip: rgba(127,176,255,.20);
  --chipBorder: rgba(127,176,255,.35);

  --dropBg: rgba(127,176,255,.10);
}

/* ✅ IMPORTANT FIX:
   No overlay/opacity layer in light mode.
*/
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Layout */
.container{
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.mt{ margin-top: 18px; }

.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbarInner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color: inherit;
}
.logo{
  width:44px;height:44px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  font-weight:800;
  background: var(--chip);
  border: 1px solid var(--chipBorder);
}
.brandTitle{ font-weight: 800; font-size: 18px; line-height:1.1; }
.brandSub{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.nav{ display:flex; gap:10px; align-items:center; }
.navLink{
  text-decoration:none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.navLink.active{
  color: var(--text);
  background: var(--chip);
  border: 1px solid var(--chipBorder);
}
.iconBtn{
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 14px;
  width: 42px; height: 42px;
  cursor:pointer;
  box-shadow: var(--shadow);
}

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  margin-top: 18px;
}
.hero h1{ margin: 0; font-size: clamp(22px, 3.2vw, 34px); }
.muted{ color: var(--muted); }
.small{ font-size: 13px; }

.heroBadges{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 12px; }
.badge{
  background: var(--chip);
  border: 1px solid var(--chipBorder);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* Cards */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.cardHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.pill{
  background: var(--chip);
  border: 1px solid var(--chipBorder);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  margin-top: 16px;
}

/* Drop */
.drop{
  position: relative;
  border: 2px dashed color-mix(in srgb, var(--border) 75%, transparent);
  background: var(--dropBg);
  border-radius: var(--radius);
  padding: 16px;
  overflow:hidden;
}
.drop input[type="file"]{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.dropInner{
  display:grid;
  gap: 6px;
  text-align:center;
}
.dropTitle{ font-weight: 800; font-size: 18px; }
.dropSub{ color: var(--muted); font-size: 13px; }
.selectedInfo{
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

/* Form fields */
.row{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.field span{ display:block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hint{ opacity: .9; }

input, select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  outline:none;
}
input:focus, select:focus{
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

/* Buttons */
.btn{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor:pointer;
  font-weight: 700;
}
.btnPrimary{
  background: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 60%, var(--border));
  color: var(--primaryText);
}
.btnGhost{
  background: transparent;
}

/* Result */
.result{ margin-top: 12px; }
.statusLine{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  align-items:center;
}
.progressWrap{
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 50%, transparent);
  overflow:hidden;
}
.progressBar{
  height:100%;
  width:0%;
  border-radius: 999px;
  background: var(--primary);
  transition: width .25s ease;
}

.list{
  margin-top: 12px;
  display:grid;
  gap: 10px;
}
.item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}
.itemTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.fileName{ font-weight: 800; }
.meta{ color: var(--muted); font-size: 12px; margin-top: 4px; }
.actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.linkBtn{
  text-decoration:none;
  display:inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

/* Ads */
.adCard .adTitle, .inpageAd .adTitle{
  font-weight: 800;
  margin-bottom: 8px;
}
.adBox{
  min-height: 140px;
  border-radius: var(--radius);
  border: 2px dashed color-mix(in srgb, var(--border) 70%, transparent);
  display:grid;
  place-items:center;
  padding: 12px;
}
.inpageAd{ margin-top: 14px; }

.note{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

/* Lists + tags */
.cleanList{
  list-style:none;
  padding:0;
  margin: 10px 0 0;
  display:grid;
  gap: 8px;
}
.cleanList li{
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.divider{
  height:1px;
  background: var(--border);
  margin: 14px 0;
}
.tags{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tags span{
  background: var(--chip);
  border: 1px solid var(--chipBorder);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* Footer */
.footer{
  margin-top: 18px;
  padding: 18px 0 26px;
  color: var(--muted);
}
.footerInner{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footerLinks a{
  color: var(--muted);
  text-decoration:none;
  margin-left: 12px;
}
.footerLinks a:hover{ text-decoration: underline; }

/* FAQ */
.faq{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 10px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.faq summary{
  cursor:pointer;
  font-weight: 800;
}

/* Responsive */
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .row{ grid-template-columns: 1fr; }
  .nav{ display:none; } /* mobile clean */
}
