/* ============================================================
   PA Portfolio · Modern Tailwind-style Theme (Dark + Light)
   ระบบสีแบบ Gradient · Glassmorphism · Modern UI
   ============================================================ */
:root{
  --bg-1:#f5f7ff; --bg-2:#eef1fb;
  --surface:rgba(255,255,255,.78);
  --surface-2:rgba(255,255,255,.55);
  --surface-3:rgba(255,255,255,.92);
  --border:rgba(15,23,42,.08);
  --border-strong:rgba(15,23,42,.14);
  --text:#0f172a; --text-muted:#475569; --text-soft:#64748b;

  --brand-1:#6366f1;   /* indigo-500 */
  --brand-2:#a855f7;   /* purple-500 */
  --brand-3:#ec4899;   /* pink-500   */
  --brand-4:#06b6d4;   /* cyan-500   */
  --brand:var(--brand-1);

  --gradient-brand:linear-gradient(135deg,#6366f1 0%,#a855f7 50%,#ec4899 100%);
  --gradient-brand-2:linear-gradient(135deg,#06b6d4 0%,#6366f1 50%,#a855f7 100%);
  --gradient-warm:linear-gradient(135deg,#f59e0b 0%,#ef4444 50%,#ec4899 100%);
  --gradient-cool:linear-gradient(135deg,#06b6d4 0%,#3b82f6 50%,#8b5cf6 100%);
  --gradient-soft:linear-gradient(180deg,#fff 0%,rgba(255,255,255,.6) 100%);

  --shadow-xs:0 1px 2px rgba(15,23,42,.06);
  --shadow-sm:0 4px 14px -4px rgba(15,23,42,.08);
  --shadow-md:0 10px 30px -10px rgba(99,102,241,.18);
  --shadow-lg:0 24px 60px -20px rgba(168,85,247,.25);
  --shadow-glow:0 0 0 1px rgba(99,102,241,.18), 0 20px 40px -20px rgba(168,85,247,.45);
  --radius:18px;
  --radius-lg:22px;
}
html[data-theme="dark"]{
  --bg-1:#0a0e1f; --bg-2:#0f1230;
  --surface:rgba(20,24,52,.72);
  --surface-2:rgba(255,255,255,.05);
  --surface-3:rgba(20,24,52,.92);
  --border:rgba(255,255,255,.08);
  --border-strong:rgba(255,255,255,.16);
  --text:#e8ecff; --text-muted:#a9b2d6; --text-soft:#7c87b3;
  --gradient-soft:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,0));
  --shadow-sm:0 4px 14px -4px rgba(0,0,0,.5);
  --shadow-md:0 10px 30px -10px rgba(99,102,241,.5);
  --shadow-lg:0 30px 80px -30px rgba(168,85,247,.55);
  --shadow-glow:0 0 0 1px rgba(168,85,247,.35), 0 20px 50px -20px rgba(99,102,241,.6);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  color:var(--text);
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(168,85,247,.15), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(6,182,212,.12), transparent 60%),
    radial-gradient(600px 500px at 50% 50%, rgba(236,72,153,.06), transparent 60%),
    linear-gradient(180deg,var(--bg-1),var(--bg-2));
  background-attachment: fixed;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

/* Surfaces */
.glass,.surface{
  background:var(--surface);
  backdrop-filter:blur(20px) saturate(140%);
  -webkit-backdrop-filter:blur(20px) saturate(140%);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  color:var(--text);
}
.surface-soft{
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:14px;
}
.surface-strong{
  background:var(--surface-3);
  border:1px solid var(--border-strong);
  border-radius:var(--radius);
  box-shadow:var(--shadow-md);
}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  transition:all .2s cubic-bezier(.4,0,.2,1);
  border-radius:14px; font-weight:600; padding:.7rem 1.2rem;
  border:1px solid transparent;
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn-primary{
  background:var(--gradient-brand); color:#fff;
  box-shadow:0 14px 30px -10px rgba(168,85,247,.55), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-primary:hover{filter:brightness(1.08); box-shadow:var(--shadow-glow)}
.btn-ghost{background:var(--surface-2); color:var(--text); border:1px solid var(--border)}
.btn-ghost:hover{background:var(--surface); border-color:var(--border-strong)}
.btn-outline{background:transparent; color:var(--brand); border:1px solid var(--brand)}
.btn-outline:hover{background:var(--brand); color:#fff}

/* Inputs */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,textarea{
  background:var(--surface-2)!important;
  color:var(--text)!important;
  border:1px solid var(--border)!important;
  border-radius:12px!important;
  transition:all .15s ease;
}
input:focus,select:focus,textarea:focus{
  outline:none!important;
  border-color:var(--brand)!important;
  box-shadow:0 0 0 4px rgba(99,102,241,.18)!important;
}
input::placeholder,textarea::placeholder{color:var(--text-soft)}
label{color:var(--text-muted)}

/* Dark-mode override สำหรับ Tailwind utility ที่ใช้สีคงที่ */
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-600{color:var(--text-muted)!important}
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900{color:var(--text)!important}
html[data-theme="dark"] .bg-white{background:var(--surface)!important;color:var(--text)}
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-t,
html[data-theme="dark"] .border-b{border-color:var(--border)!important}

/* Sidebar nav */
.nav a{
  display:flex; align-items:center; gap:.6rem;
  padding:.7rem .9rem; border-radius:12px;
  color:var(--text-muted); transition:all .2s ease;
  font-weight:500;
}
.nav a:hover{background:var(--surface-2); color:var(--text); transform:translateX(2px)}
.nav a.active{
  background:var(--gradient-brand); color:#fff;
  box-shadow:0 10px 24px -10px rgba(168,85,247,.6);
}
.nav a.active svg{color:#fff}
.nav a svg{flex-shrink:0; opacity:.85}

/* Brand text gradient */
.brand-text,.text-gradient{
  background:var(--gradient-brand);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  font-weight:800;
}
.text-gradient-cool{background:var(--gradient-cool);-webkit-background-clip:text;background-clip:text;color:transparent}
.text-gradient-warm{background:var(--gradient-warm);-webkit-background-clip:text;background-clip:text;color:transparent}

/* Cards (เน้น gradient border / hover) */
.card-modern{
  position:relative; background:var(--surface);
  border-radius:var(--radius-lg); padding:1.25rem;
  border:1px solid var(--border);
  transition:all .25s ease;
  backdrop-filter:blur(18px);
}
.card-modern:hover{transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:transparent}
.card-modern::before{
  content:""; position:absolute; inset:0; border-radius:inherit; padding:1px;
  background:var(--gradient-brand);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite:exclude;
  opacity:0; transition:opacity .25s ease; pointer-events:none;
}
.card-modern:hover::before{opacity:1}

/* Badge / chips */
.chip{display:inline-flex;align-items:center;gap:.35rem;padding:.3rem .7rem;border-radius:9999px;font-size:.72rem;font-weight:600;background:var(--surface-2);border:1px solid var(--border);color:var(--text-muted)}
.chip-brand{background:linear-gradient(135deg,rgba(99,102,241,.15),rgba(236,72,153,.15));color:var(--brand);border-color:rgba(99,102,241,.25)}
.chip-success{background:rgba(16,185,129,.12);color:#10b981;border-color:rgba(16,185,129,.25)}
.chip-warn{background:rgba(245,158,11,.12);color:#f59e0b;border-color:rgba(245,158,11,.25)}
.chip-danger{background:rgba(239,68,68,.12);color:#ef4444;border-color:rgba(239,68,68,.25)}

/* Floating action dock (bottom-right) */
.fab-dock{
  position:fixed; right:18px; bottom:18px; z-index:60;
  display:flex; flex-direction:column; gap:10px;
}
.fab{
  width:46px; height:46px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background:var(--surface-3); color:var(--text);
  border:1px solid var(--border-strong);
  box-shadow:var(--shadow-md);
  cursor:pointer;
  transition:all .2s ease;
}
.fab:hover{transform:translateY(-2px); border-color:var(--brand); color:var(--brand)}
.fab.primary{background:var(--gradient-brand); color:#fff; border:none; box-shadow:var(--shadow-glow)}
.fab.primary:hover{color:#fff; filter:brightness(1.1)}
.fab[hidden]{display:none}

/* Print stylesheet */
@media print{
  .fab-dock,.no-print,aside,#topbar,.toast,header nav,.site-footer,.site-cta,.lb,.lb-btn,iframe{display:none!important}
  html,body{background:#fff!important;color:#000!important}
  body *{box-shadow:none!important;text-shadow:none!important}
  .glass,.card,.surface,.surface-strong,.bg-white,.card-modern{background:#fff!important;color:#000!important;border:1px solid #ddd!important;backdrop-filter:none!important}
  a{color:#000!important;text-decoration:none!important}
  img{max-width:100%!important;page-break-inside:avoid;break-inside:avoid}
  section,article{page-break-inside:avoid;break-inside:avoid}
  h1,h2,h3{page-break-after:avoid}
  .hero-bg,.hero-blur,.hero-overlay,[class*="hero-"]{filter:none!important;background:#fff!important;color:#000!important}
  @page{size:A4;margin:14mm}
}

/* Smooth focus rings */
:focus-visible{outline:2px solid var(--brand); outline-offset:2px; border-radius:10px}

/* Toast */
.toast{
  position:fixed; bottom:18px; left:18px; z-index:70;
  padding:.75rem 1.1rem; border-radius:14px; color:#fff;
  box-shadow:var(--shadow-lg); display:none; font-weight:600;
}
.toast.ok{background:linear-gradient(135deg,#10b981,#059669)}
.toast.err{background:linear-gradient(135deg,#ef4444,#b91c1c)}

/* Dashboard helpers */
.section-title{font-size:1.5rem;font-weight:700;letter-spacing:-.02em}
.section-eyebrow{display:inline-flex;align-items:center;gap:.4rem;padding:.35rem .8rem;border-radius:9999px;font-size:.7rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase;background:linear-gradient(135deg,rgba(99,102,241,.15),rgba(236,72,153,.15));color:var(--brand);border:1px solid rgba(99,102,241,.2)}

/* SVG icon defaults */
svg{vertical-align:middle}
.icon-grad{stroke:url(#gradStroke)}

/* Reveal on scroll */
.reveal{opacity:0;transform:translateY(18px);transition:all .7s ease}
.reveal.in{opacity:1;transform:none}

/* Hero slider (portfolio) */
.hero-slider{position:absolute;inset:0;overflow:hidden}
.hero-slide{position:absolute;inset:0;background-size:cover;background-position:center;opacity:0;animation:heroFade 18s infinite}
.hero-slide.s2{animation-delay:6s}
.hero-slide.s3{animation-delay:12s}
@keyframes heroFade{0%,28%{opacity:0}33%,60%{opacity:1}65%,100%{opacity:0}}
.hero-dots{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);display:flex;gap:6px;z-index:5}
.hero-dots span{width:8px;height:8px;border-radius:9999px;background:rgba(255,255,255,.55)}
