/* 
 * Plugin Name: Screen Generator Tools
 * Author: Ali Fathi
 * Website: https://Afateam.ir
 */


/* Base */
*{ box-sizing:border-box; }
html, body{ margin:0; padding:0;  color:#e5e7eb; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
.wrap{ max-width:1100px; margin:0 auto; padding:0 16px; }

.site-header{ background:#0b1220; border-bottom:1px solid rgba(255,255,255,.06); }
.site-header .wrap{ display:flex; align-items:center; height:64px; }
.site-title a{ color:#fff; text-decoration:none; }

.site-footer{ background:#0b1220; border-top:1px solid rgba(255,255,255,.06); padding:20px 0; margin-top:40px; }

/* Tools section */
section[data-tools]{
  background:#111827;
  border-radius:18px;
  padding:24px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  margin: 24px 0;
}
section[data-tools] .tools-wrap{
  display:grid; grid-template-columns:260px 1fr 320px; gap:20px;
}
@media (max-width:1100px){
  section[data-tools] .tools-wrap{ grid-template-columns:240px 1fr; }
  section[data-tools] .tools-controls{ grid-column:1 / -1; }
}
@media (max-width:768px){
  section[data-tools] .tools-wrap{ grid-template-columns:1fr; }
}
/* sidebar */
.tools-sidebar{ display:flex; flex-direction:column; gap:12px; }
.tool-chip{ display:flex; align-items:center; gap:12px; background:#0b1220; border-radius:14px; padding:12px; border:1px solid rgba(255,255,255,.06); }
.tool-chip .swatch{ width:24px; height:24px; border-radius:8px; display:inline-block; }
/* stage */
.tool-stage .stage{ position:relative;  min-height:320px; border-radius:14px; box-shadow:0 6px 22px rgba(0,0,0,.25); }
.stage-footer{ display:flex; justify-content:flex-end; gap:10px; margin-top:10px; }
.stage-btn{ padding:10px 14px; border-radius:10px; background:#111827; color:#fff; border:none; cursor:pointer; }

/* Standalone panel, matching the visual style of the sidebar/controls panels */
.tools-panel{
  background:#0b1220; border:1px solid rgba(255,255,255,.06);
  border-radius:16px; padding:16px 18px; margin-top:12px;
}
.tools-panel h4{ margin:0 0 12px; font-size:14px; color:#e5e7eb; }

.stage-brightness{ display:flex; align-items:center; gap:12px; }
.sgt-brightness-icon{ color:#fbbf24; flex-shrink:0; }
.sgt-brightness-range{
  flex:1; appearance:none; -webkit-appearance:none; height:6px; border-radius:999px;
  background:linear-gradient(90deg,#3b82f6,#06b6d4); outline:none; cursor:pointer;
}
.sgt-brightness-range::-webkit-slider-thumb{
  appearance:none; -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
  background:#fff; border:3px solid #3b82f6; cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.35); transition:transform .15s ease;
}
.sgt-brightness-range::-webkit-slider-thumb:hover{ transform:scale(1.12); }
.sgt-brightness-range::-moz-range-thumb{
  width:18px; height:18px; border-radius:50%; background:#fff; border:3px solid #3b82f6;
  cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,.35);
}
.sgt-brightness-range::-moz-range-track{ height:6px; border-radius:999px; background:transparent; }
.sgt-brightness-value{
  min-width:44px; text-align:right; font-variant-numeric:tabular-nums;
  font-weight:700; color:#e5e7eb; font-size:13px;
}
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* Dims the stage without touching its actual color — a plain black layer
   whose opacity scales with the slider, drawn above the color but below
   the fullscreen icon / prank overlay. */
.tool-stage .stage .sgt-brightness-overlay{
  position:absolute; inset:0; z-index:2; pointer-events:none;
  background:#000; opacity:0; transition:opacity .12s ease;
}
/* controls */
.tools-controls{ background:#0b1220; border-radius:16px; padding:18px; border:1px solid rgba(255,255,255,.06); }
.control-row{ margin-top:12px; }
.control-row.inline{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.control-row.inline > div{ min-width:0; }
.control-row.inline input, .control-row.inline select{ width:100%; box-sizing:border-box; }
.tools-controls input[type="number"], .tools-controls select, .tools-controls input[type="color"]{
  width:100%; background:#0f172a; color:#e5e7eb; border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:10px 12px;
}
.tools-controls label{ font-size:.9rem; color:#cbd5e1; display:block; margin-bottom:6px; }
.button, button{ display:inline-block; background:#3b82f6; color:#fff; border:none; border-radius:12px; padding:12px 16px; font-weight:700; cursor:pointer; }
.button.secondary{ background:#111827; }

/* Share bar */
.share-bar{ display:flex; align-items:center; gap:10px; margin-top:18px; flex-wrap:wrap; padding:0 8px; }
.share-label{ color:#cbd5e1; font-size:.9rem; }
.share-btn{ width:36px; height:36px; border-radius:999px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; text-transform:uppercase; box-shadow:0 2px 8px rgba(0,0,0,.25); }
.share-btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.share-x{ background:#111; } .share-fb{ background:#1877F2; } .share-ln{ background:#0A66C2; } .share-tg{ background:#229ED9; } .share-wa{ background:#25D366; }

/* Fullscreen: only the letterboxed backdrop area is black.
   The fullscreen element itself must keep its own (JS-applied) background color,
   otherwise the stage always looks black regardless of the chosen color. */
::backdrop{ background:#000; }
body{ overflow-x:hidden; }

/* Fallback "fake fullscreen" for browsers/devices where the native
   Fullscreen API is unavailable or rejected (mainly iOS Safari on iPhone). */
html.sgt-fake-fullscreen-lock,
body.sgt-fake-fullscreen-lock{ overflow:hidden !important; height:100% !important; }

.tool-stage .stage.sgt-fake-fullscreen{
  position:fixed !important;
  top:0; left:0; right:0; bottom:0;
  width:100vw !important;
  height:100vh !important;
  height:100dvh !important;
  max-width:none !important;
  margin:0 !important;
  border-radius:0 !important;
  z-index:2147483647;
}
.tool-stage .stage.sgt-fake-fullscreen .fs-icon{
  bottom:16px; right:16px;
}


/* Gradient style buttons */
.button.gradient {
  background: linear-gradient(135deg,#4f46e5,#9333ea);
  color:#fff !important;
  border:none;
  box-shadow:0 3px 8px rgba(0,0,0,.2);
  transition:transform .2s ease, filter .2s ease;
}
.button.gradient:hover{ filter:brightness(1.1); transform:translateY(-1px); }

/* Floating fullscreen icon */
.fs-icon{ position:absolute; bottom:10px; right:10px; width:36px; height:36px; border-radius:10px; background:rgba(0,0,0,0.6); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; border:none; z-index:10; }
.fs-icon:before{
  content:"\26F6"; font-size:18px; /* Unicode square icon */
}
.fs-icon:hover{ background:rgba(0,0,0,0.8); }


/* Clickable chips */
.tool-chip{ cursor:pointer; border:1px solid rgba(255,255,255,.08); background:#0b1220; }
.tool-chip:hover{ border-color: rgba(59,130,246,.6); box-shadow:0 4px 12px rgba(0,0,0,.25); }
.tools-sidebar .tool-chip{ text-align:left; }
.tools-sidebar .tool-chip span{ pointer-events:none; }

/* <a class="tool-chip"> preset links must look identical to the <button> version */
a.tool-chip{ text-decoration:none; color:inherit; }

/* Current page's own color: shown as an active state, not a clickable link to itself */
.tool-chip-active{ cursor:default; border-color: rgba(59,130,246,.7); background:#111d33; }
.tool-chip-active:hover{ box-shadow:none; }

/* Prank ("Broken Screen") button + overlay */
.tool-chip-prank{ border:1px dashed rgba(239,68,68,.55) !important; }
.tool-chip-prank:hover{ border-color: rgba(239,68,68,.9) !important; box-shadow:0 4px 12px rgba(239,68,68,.2) !important; }
.prank-swatch{ display:flex !important; align-items:center; justify-content:center; background:#111 !important; font-size:14px; line-height:1; }

.tool-stage .stage .sgt-prank-overlay{
  position:absolute; inset:0; z-index:5; pointer-events:none;
}
.tool-stage .stage .sgt-prank-overlay svg{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.tool-stage .stage.sgt-prank-active{ cursor:pointer; }

/* Place stage relatively for fs-icon */
.tool-stage { position: relative; }

/* Buttons contrast */
.stage-btn{ background: linear-gradient(135deg,#06b6d4,#3b82f6); color:#fff; }
.stage-btn:hover{ filter: brightness(1.1); transform: translateY(-1px); }

/* Download primary gradient already defined as .button.gradient */

/* Floating FS icon already styled in V6 */

.share-btn.share-ig{ background:#E1306C; }

.download-row{ display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; margin-top:.75rem }
.quality-label{ font-size:.9rem; opacity:.85 }
.quality-select{ padding:.5rem .6rem; border:1px solid var(--border, #e5e7eb); border-radius:.6rem; background:#fff; }


/* ==== Global / Reset ==== */
html, body { font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { text-decoration: none; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.button { display: inline-flex; align-items:center; gap:.5rem; padding:10px 16px; border-radius:12px; border:1px solid transparent; font-weight:600; }
.button.cta { background: linear-gradient(135deg, #6C5CE7, #A78BFA); color:#fff; }
.button.cta:hover { filter: brightness(1.05); }

/* ==== Header ==== */
.site-header { position: sticky; top:0; z-index: 50; background: rgba(255,255,255,0.75); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.header-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; min-height: 64px; }
.site-branding .logo { font-weight: 800; font-size: 20px; color:#111827; }

.main-navigation { display: flex; align-items: center; gap: 20px; }
.main-navigation .menu a { color:#374151; font-weight:600; }
.main-navigation .menu a:hover { color:#111827; }

.nav-toggle { display:none; width:40px; height:40px; background:transparent; border:1px solid #e5e7eb; border-radius:10px; align-items:center; justify-content:center; gap:4px; }
.nav-toggle span { display:block; width:18px; height:2px; background:#111827; }
.nav-toggle.is-active span:nth-child(2){ opacity:.4; transform: scaleX(.7); }

/* ==== Footer ==== */
.site-footer { background:#0F172A; color:#E5E7EB; margin-top:64px; }
.footer-grid { display:grid; grid-template-columns: 1.5fr 1fr 1fr; gap:24px; padding:48px 0; }
.footer-col .logo { color:#fff; font-weight:800; font-size:18px; }
.footer-col h4 { font-size:16px; margin:0 0 12px; color:#fff; }
.footer-col .menu a { color:#cbd5e1; }
.footer-col .menu a:hover { color:#fff; }
.footer-bottom { border-top:1px solid rgba(255,255,255,0.08); padding:16px 0; text-align:center; font-size:14px; color:#cbd5e1; }
.socials { display:flex; gap:10px; margin-top:12px; }
.socials .ico { display:inline-flex; width:36px; height:36px; align-items:center; justify-content:center; border-radius:10px; background:#111827; color:#fff; }
.socials .ico-x{ background:#111827; }
.socials .ico-fb{ background:#1877F2; }
.socials .ico-ig{ background:#E1306C; }
.socials .ico-ln{ background:#0A66C2; }

/* ==== Responsive ==== */
@media (max-width: 1024px){
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px){
  .header-row { grid-template-columns: auto 1fr auto; }
  .main-navigation { position: fixed; top:64px; left:0; right:0; background:#fff; padding:16px; border-bottom:1px solid #e5e7eb; transform: translateY(-120%); transition: transform .25s ease; flex-direction: column; gap:12px; }
  .main-navigation.is-open { transform: translateY(0); }
  .main-navigation .menu { flex-direction: column; gap: 12px; }
  .nav-toggle { display:flex; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Avoid horizontal scroll in all sections */
.tool-stage, .site-main, .site-header, .site-footer { max-width: 100vw; overflow-x: hidden; }


/* --- Plugin Safe Reset (do not paint site background) --- */
html, body { background: transparent; }


/* --- Box around the Screen Generator tools --- */
section[data-tools]{
  background: transparent !important;   /* plugin outer background removed */
  margin: 32px auto;
  padding: 0;
  box-shadow: none;
}
section[data-tools] .tools-wrap{
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}
@media (max-width: 768px){
  section[data-tools] .tools-wrap{ padding: 16px; }
}

/* Keep stage surface paintable by JS */
section[data-tools] .tool-stage .stage{
  
}


/* --- Social icons visibility --- */
.share-btn svg { width: 18px; height: 18px; display: block; }
.share-btn svg path, .share-btn svg * { fill: #fff; }



/* --- Share bar inside the tools box --- */
section[data-tools] .tools-wrap .share-bar {
  margin-top: 20px;
  padding: 10px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* --- Stage with stronger shadow --- */
section[data-tools] .tool-stage .stage {
  
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border-radius: 14px;
}

/* --- Title inside tools controls --- */
section[data-tools] .tools-controls h3 {
  font-size: 12px !important;
  color: #ffffff !important;
  font-weight: 500;
  text-align: center;
  margin-bottom: 12px;
}


/* === Box on the whole section so share-bar is inside === */
body section[data-tools] {
    background: #f0f0f0 !important;
    border-radius: 16px !important;
    padding: 24px !important;
    margin: 32px auto !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
    max-width: 1200px;
}
/* Keep inner wrap neutral */
body section[data-tools] .tools-wrap{ background: transparent !important; box-shadow:none !important; padding: 0 !important; }
body section[data-tools] .share-bar{ margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.08); }


/* === Strong shadow around the display (stage) === */
body section[data-tools] .tool-stage .stage{
  
  box-shadow: 0 12px 28px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05) !important;
  border-radius: 14px !important;
}


/* === Screen Generator Tools title smaller and white === */
body section[data-tools] .tools-controls h3{
  font-size: 12px !important;
  color: #ffffff !important;
  font-weight: 500 !important;
  margin-bottom: 12px !important;
  text-align: center;
}



/* Ensure stage only has shadow and radius, no background override */
.tool-stage .stage {
  box-shadow: 0 12px 28px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05) !important;
  border-radius: 14px !important;
}


/* Keep the Quality list text white */
select.quality-select,
select.quality-select option {
  color: #fff !important;
}

/* When the stage is actually fullscreen (native), it should fill the screen
   edge-to-edge. The rounded corners / drop-shadow used for the in-page
   "card" look stay behind otherwise and make it look like a floating box
   instead of true fullscreen. Written as separate rules per prefix on
   purpose: combining unsupported pseudo-classes in one comma list makes
   some browsers drop the whole rule. */
.tool-stage .stage:fullscreen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }
.tool-stage .stage:-webkit-full-screen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }
.tool-stage .stage:-moz-full-screen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }
.tool-stage .stage:-ms-fullscreen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }

/* The rules above lose to "body section[data-tools] .tool-stage .stage"
   (defined earlier in this file) on CSS specificity — that selector has two
   extra element-type selectors (body, section[data-tools]), which outweighs
   our extra class/pseudo-class even though both sides use !important.
   Repeat with the same high-specificity prefix so the corner-radius reset
   actually wins in every fullscreen state, on both desktop and mobile. */
body section[data-tools] .tool-stage .stage.sgt-fake-fullscreen{
  border-radius:0 !important;
  box-shadow:none !important;
  margin:0 !important;
}
body section[data-tools] .tool-stage .stage:fullscreen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }
body section[data-tools] .tool-stage .stage:-webkit-full-screen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }
body section[data-tools] .tool-stage .stage:-moz-full-screen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }
body section[data-tools] .tool-stage .stage:-ms-fullscreen{ border-radius:0 !important; box-shadow:none !important; margin:0 !important; }

/* Once fullscreen is active, the on-screen icon is unnecessary clutter for
   a "white screen" style tool — desktop users exit with Escape/F, and
   mobile users exit with the device Back button/gesture (see the
   history-guard logic in tools.js). It stays visible before entering
   fullscreen; that's how you get in. */
.tool-stage .stage.sgt-fake-fullscreen .fs-icon{ display:none !important; }
.tool-stage .stage:fullscreen .fs-icon{ display:none !important; }
.tool-stage .stage:-webkit-full-screen .fs-icon{ display:none !important; }
.tool-stage .stage:-moz-full-screen .fs-icon{ display:none !important; }
.tool-stage .stage:-ms-fullscreen .fs-icon{ display:none !important; }
