/*
Theme Name: ES Tools Shell Theme
Theme URI: https://tools.envirosolution.co.uk/
Author: EnviroSolution
Description: App-shell theme for EnviroSolution Tools Hub.
Version: 0.1.1
Text Domain: es-tools-shell-theme
*/

:root{
  --es-primary:#16a34a;
  --es-primary-600:#15803d;
  --es-bg:#f6f8fb;
  --es-text:#0b1220;
  --es-muted:#5b6b83;
  --es-border:rgba(226,232,240,.92);
  --es-surface:rgba(255,255,255,.78);
  --es-surface-solid:#ffffff;
  --es-shadow:0 18px 70px rgba(2,6,23,.10);
  --es-radius:16px;
  --es-radius-lg:18px;
  --es-container: 1500px;
  color-scheme:light;
}

html[data-theme="dark"]{
  --es-bg:#08101d;
  --es-text:#e5e7eb;
  --es-muted:#a6b0c0;
  --es-border:rgba(148,163,184,.22);
  --es-surface:rgba(15,23,42,.72);
  --es-surface-solid:rgba(15,23,42,.92);
  --es-shadow:0 28px 120px rgba(0,0,0,.52);
  --es-primary:#22c55e;
  --es-primary-600:#16a34a;
  color-scheme:dark;
}

*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--es-bg);
  color:var(--es-text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Background */
.es-bg{position:fixed; inset:0; z-index:-2; pointer-events:none; overflow:hidden;}
.es-bg::before{
  content:"";
  position:absolute; inset:-30%;
  background:
    radial-gradient(900px 600px at 12% 20%, rgba(22,163,74,.14), transparent 62%),
    radial-gradient(950px 650px at 88% 22%, rgba(21,129,183,.10), transparent 66%),
    radial-gradient(1100px 720px at 60% 88%, rgba(99,102,241,.08), transparent 66%),
    linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0));
  animation: es-drift 26s ease-in-out infinite alternate;
  transform: translateZ(0);
}
html[data-theme="dark"] .es-bg::before{
  background:
    radial-gradient(900px 600px at 12% 20%, rgba(34,197,94,.12), transparent 62%),
    radial-gradient(950px 650px at 88% 22%, rgba(73,167,255,.10), transparent 66%),
    radial-gradient(1100px 720px at 60% 88%, rgba(168,85,247,.06), transparent 66%),
    linear-gradient(180deg, rgba(15,23,42,.72), rgba(15,23,42,0));
}
.es-bg::after{
  content:"";
  position:absolute; inset:-40%;
  background: conic-gradient(from 210deg at 50% 50%,
    rgba(22,163,74,.10), rgba(21,129,183,.08), rgba(168,85,247,.08), rgba(22,163,74,.10));
  opacity:.28;
  filter: blur(54px);
  animation: es-rotate 38s linear infinite;
  mix-blend-mode: multiply;
  transform: translateZ(0);
}
html[data-theme="dark"] .es-bg::after{ mix-blend-mode: screen; opacity:.18; }
@keyframes es-drift{ 0%{transform:translate3d(-2%,-1%,0) scale(1.02);} 100%{transform:translate3d(2%,1%,0) scale(1.07);} }
@keyframes es-rotate{ 0%{transform:translate3d(-5%,-3%,0) rotate(0deg) scale(1.05);} 100%{transform:translate3d(5%,3%,0) rotate(360deg) scale(1.10);} }

/* App bar */
.es-appbar{
  position:sticky; top:0; z-index:999;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background:var(--es-surface);
  border-bottom:1px solid var(--es-border);
  width:100%;
  overflow-x: clip;
}
.es-appbar__inner{
  width:100%;
  max-width:100vw;
  padding:10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.es-brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:var(--es-text);
  font-weight:900; letter-spacing:-0.03em;
  min-width:0;
}
.es-brand__mark{
  width:34px; height:34px; border-radius:12px;
  background: rgba(22,163,74,.12);
  display:inline-flex; align-items:center; justify-content:center;
  flex:0 0 34px;
}
.es-brand__name{
  font-size:16px; line-height:1;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  max-width: 42vw;
}
.es-appbar__right{ display:flex; align-items:center; gap:10px; min-width:0; }

.es-status{
  display:flex; align-items:center; gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--es-border);
  background: rgba(34,197,94,.12);
  color: var(--es-primary-600);
  font-weight:800; font-size:13px;
  flex:0 0 auto;
}
html[data-theme="dark"] .es-status{ color:#34d399; }
.es-status svg{ width:16px; height:16px; }

.es-iconbtn{
  width:40px; height:40px;
  border-radius:12px;
  border:1px solid var(--es-border);
  background: rgba(255,255,255,.55);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
  color: var(--es-text);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
html[data-theme="dark"] .es-iconbtn{ background: rgba(15,23,42,.55); box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.es-iconbtn:hover{ transform: translateY(-1px); border-color: rgba(22,163,74,.35); box-shadow: 0 12px 34px rgba(2,6,23,.12);}
.es-iconbtn svg{ width:18px; height:18px; }

.es-dropdown{ position:relative; }
.es-menu{
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  width: min(380px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  border-radius: var(--es-radius-lg);
  border:1px solid var(--es-border);
  background: var(--es-surface-solid);
  box-shadow: var(--es-shadow);
  padding:12px;
  display:none;
  overflow:hidden;
}
html[data-theme="dark"] .es-menu{ background: var(--es-surface-solid); }
.es-menu.is-open{ display:block; }
.es-menu__head{ display:flex; align-items:center; justify-content:space-between; padding:6px 6px 10px; }
.es-menu__title{ font-weight:800; letter-spacing:-0.03em; }
.es-gridmenu{ display:grid; grid-template-columns:1fr; gap:8px; padding:6px; max-height:min(58vh, 420px); overflow:auto; }
.es-gridmenu a{
  text-decoration:none; color:var(--es-text);
  border:1px solid var(--es-border);
  border-radius:14px;
  padding:10px;
  display:flex; gap:12px; align-items:flex-start;
  background: rgba(2,6,23,.02);
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
html[data-theme="dark"] .es-gridmenu a{ background: rgba(255,255,255,.03); }
.es-gridmenu a:hover{ border-color: rgba(22,163,74,.30); background: rgba(22,163,74,.06); transform: translateY(-1px); }
.es-gridmenu .label{ font-weight:800; font-size:14px; line-height:1.15; letter-spacing:-0.01em; }
.es-gridmenu .sub{ font-size:12px; color:var(--es-muted); margin-top:3px; }

.es-main{ padding: 18px 0 64px; }

/* 1500px container + outer panel card */
.es-dashboard-shell{
  max-width: var(--es-container);
  margin: 0 auto;
  padding: 0 16px;
}
.es-panel{
  margin-top: 18px;
  border-radius: 22px;
  border: 1px solid var(--es-border);
  background: var(--es-surface);
  box-shadow: var(--es-shadow);
  padding: 18px;
}

/* Typography - reduced weights */
.es-h1{ font-size:32px; font-weight:800; letter-spacing:-0.05em; margin:0; }
.es-subtitle{ font-size:14px; color:var(--es-muted); margin-top:6px; font-weight:500; }

/* Cards */
.es-grid-3{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 0;
}
.es-card{
  border-radius: 18px;
  border:1px solid var(--es-border);
  background: rgba(255,255,255,.66);
  box-shadow: 0 12px 44px rgba(2,6,23,.08);
  padding: 18px;
  min-height: 200px;
  display:flex;
  flex-direction:column;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
html[data-theme="dark"] .es-card{ background: rgba(15,23,42,.60); box-shadow: 0 18px 60px rgba(0,0,0,.35);}
.es-card:hover{
  transform: translateY(-2px);
  border-color: rgba(22,163,74,.22);
  box-shadow: 0 22px 76px rgba(2,6,23,.12);
}
.es-tool-icon{
  width:56px; height:56px;
  border-radius: 16px;
  background: rgba(22,163,74,.12);
  display:inline-flex; align-items:center; justify-content:center;
  color: var(--es-primary);
}
.es-tool-icon i{ font-size: 22px; }
.es-card h3{ margin:12px 0 0; font-size:17px; font-weight:800; letter-spacing:-0.03em; }
.es-card p{ margin:8px 0 0; font-size:13.5px; color: var(--es-muted); line-height:1.35; max-width: 46ch; }
.es-card .es-actions{ margin-top:auto; padding-top:14px; display:flex; justify-content:flex-start; }

.es-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 9px 14px;
  border-radius: 12px;
  border:1px solid var(--es-border);
  background: rgba(255,255,255,.55);
  color: var(--es-text);
  text-decoration:none;
  font-weight: 800;
  font-size: 13px;
}
html[data-theme="dark"] .es-btn{ background: rgba(15,23,42,.55); }
.es-btn-primary{
  background: var(--es-primary);
  border-color: var(--es-primary);
  color: #fff;
}
.es-btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 14px 36px rgba(2,6,23,.14); }

@media (max-width: 920px){
  .es-status span{ display:none; }
  .es-brand__name{ max-width: 36vw; }
}
@media (max-width: 520px){
  .es-appbar__inner{ padding:10px 10px; }
  .es-iconbtn{ width:38px; height:38px; }
}
