/*
Theme Name: SupportDesk
Theme URI: https://example.com/supportdesk
Author: Custom
Description: A refined dark support desk shell theme. Deep navy-indigo palette with magenta accents. Auth and content are handled by your plugin via shortcode. Guests see only the header and footer.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: supportdesk
Tags: dark, support, minimal, custom-logo, custom-menu
*/

/* =========================================================
   TOKENS
   ========================================================= */
:root {
  /* Core palette */
  --ink-0:   #07071a;
  --ink-1:   #0c0c22;
  --ink-2:   #10102e;
  --ink-3:   #16163d;
  --ink-4:   #1e1e50;
  --ink-5:   #282864;

  /* Borders */
  --line:      rgba(255,255,255,0.065);
  --line-soft: rgba(255,255,255,0.035);

  /* Magenta */
  --rose:       #e8197e;
  --rose-dim:   rgba(232,25,126,0.14);
  --rose-glow:  rgba(232,25,126,0.28);

  /* Text */
  --t1: #f0f0fc;
  --t2: #9090c0;
  --t3: #50507a;

  /* Status colours */
  --s-green:  #22d49a;
  --s-amber:  #f5a524;
  --s-red:    #e8197e;
  --s-slate:  #7070a8;

  /* Geometry */
  --r:    6px;
  --r-lg: 10px;
  --hh:   62px;        /* header height */
  --max:  1140px;      /* content max-width */
  --px:   36px;        /* horizontal gutter */

  /* Type */
  --f-display: 'Bricolage Grotesque', 'DM Sans', sans-serif;
  --f-body:    'Plus Jakarta Sans', 'DM Sans', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  160ms;
}

/* =========================================================
   RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  background-color: var(--ink-1);
  color: var(--t1);
  font-family: var(--f-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* Subtle noise texture via SVG data URI */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

a { color: var(--rose); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: color-mix(in srgb, var(--rose) 75%, #fff); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }
p { color: var(--t2); }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--t1);
}

h1 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); }
h3 { font-size: 1.125rem; }

code {
  font-family: var(--f-mono);
  font-size: 0.8125em;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.12em 0.45em;
  color: var(--rose);
}

pre {
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--f-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--t1);
}
pre code { background: none; border: none; padding: 0; color: inherit; }

/* =========================================================
   BUTTONS  (plugin-friendly: targets native submit elements too)
   ========================================================= */
.btn,
.button,
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--rose);
  color: #fff !important;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-family: var(--f-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition:
    background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform   var(--dur) var(--ease);
  box-shadow: 0 0 0 0 var(--rose-glow);
  position: relative;
  overflow: hidden;
}

/* Shine sweep on hover */
.btn::after,
.button::after,
input[type="submit"]::after,
button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 380ms var(--ease);
}

.btn:hover::after,
.button:hover::after,
input[type="submit"]:hover::after,
button[type="submit"]:hover::after {
  transform: translateX(100%);
}

.btn:hover,
.button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  background: color-mix(in srgb, var(--rose) 88%, #000);
  box-shadow: 0 0 28px var(--rose-glow);
  transform: translateY(-1px);
  color: #fff !important;
}

.btn:active,
.button:active,
input[type="submit"]:active,
button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Ghost variant */
.btn-ghost,
.button-secondary {
  background: transparent;
  color: var(--t1) !important;
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:hover,
.button-secondary:hover {
  background: var(--ink-3);
  border-color: rgba(255,255,255,0.12);
  box-shadow: none;
  transform: translateY(-1px);
  color: var(--t1) !important;
}

/* =========================================================
   FORM ELEMENTS  (plugin-friendly)
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--t1);
  padding: 10px 13px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  line-height: 1.5;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-dim);
}
::placeholder { color: var(--t3); }

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--t2);
  margin-bottom: 6px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2350507a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 108px; }

/* =========================================================
   TABLES
   ========================================================= */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  background: var(--ink-3);
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 11px 14px;
  color: var(--t2);
  border-bottom: 1px solid var(--line-soft);
}
tbody tr:hover { background: var(--ink-2); }

/* =========================================================
   ALERTS / NOTICES  (plugin-friendly)
   ========================================================= */
.notice,
.alert,
.message,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 0.875rem;
  border-left: 3px solid;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notice-success, .alert-success, .notice-updated { background: rgba(34,212,154,.08);  border-color: var(--s-green); color: var(--s-green); }
.notice-warning, .alert-warning                  { background: rgba(245,165,36,.08);  border-color: var(--s-amber); color: var(--s-amber); }
.notice-error,   .alert-error,   .notice-danger  { background: rgba(232,25,126,.08);  border-color: var(--rose);    color: var(--rose);    }
.notice-info,    .alert-info                     { background: rgba(100,100,200,.08); border-color: var(--s-slate); color: #a0a0d8;        }

/* =========================================================
   PAGE SHELL
   ========================================================= */
#page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#main {
  flex: 1;
  width: 100%;
}

.site-main {
  padding: 40px 0 60px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--px);
}

/* entry content from WP */
.entry-content > * + * { margin-top: 1em; }
.entry-content h2,
.entry-content h3 { margin-top: 2em; }
.entry-content ul { list-style: disc; padding-left: 1.4em; }
.entry-content ol { list-style: decimal; padding-left: 1.4em; }
.entry-content a { color: var(--rose); }

/* =========================================================
   HEADER
   ========================================================= */
#masthead {
  height: var(--hh);
  position: sticky;
  top: 0;
  z-index: 900;

  /* Glass layer */
  background: rgba(10, 10, 28, 0.78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);

  /* Single bottom hairline */
  border-bottom: 1px solid var(--line-soft);

  /* Lifted shadow on scroll — toggled via JS class */
  transition: border-color var(--dur) var(--ease), box-shadow 300ms var(--ease);
}

#masthead.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 var(--line), 0 8px 32px rgba(0,0,0,.45);
}

.header-wrap {
  height: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--px);
  display: flex;
  align-items: center;
  gap: 32px;
}

/* ── Logo ── */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--t1);
}
.site-logo a:hover { color: var(--t1); }

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  /* Soft glow rings */
  box-shadow:
    0 0 0 1px rgba(232,25,126,.35),
    0 0 12px rgba(232,25,126,.30),
    0 0 24px rgba(232,25,126,.12);
}

.logo-mark svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.logo-text {
  font-family: var(--f-display);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--t1);
  line-height: 1;
}

.logo-custom-img {
  height: 32px;
  width: auto;
}

/* ── Nav ── */
.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-nav a {
  display: block;
  padding: 6px 13px;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--t2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.header-nav a:hover,
.header-nav .current-menu-item > a,
.header-nav .current_page_item > a {
  background: var(--ink-3);
  color: var(--t1);
}

/* ── Header slot for plugin ── */
.header-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =========================================================
   FOOTER
   ========================================================= */
#colophon {
  background: var(--ink-0);
  border-top: 1px solid var(--line-soft);
  padding: 22px 0;
}

.footer-wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Logo in footer */
.footer-logo a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--t1);
}
.footer-logo a:hover { color: var(--t1); }

.footer-logo .logo-mark {
  width: 26px;
  height: 26px;
}
.footer-logo .logo-mark svg { width: 13px; height: 13px; }
.footer-logo .logo-text { font-size: 0.9375rem; }
.footer-logo .logo-custom-img { height: 26px; }

/* Copyright */
.footer-copy {
  font-size: 0.8125rem;
  color: var(--t3);
  white-space: nowrap;
}

/* ── Status Pill ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid;
  white-space: nowrap;
  transition: box-shadow 300ms var(--ease);
}
.status-pill:hover {
  box-shadow: 0 0 12px currentColor;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.75); }
}

/* Colour variants */
.status-pill.operational {
  color: var(--s-green);
  background: rgba(34,212,154,.07);
  border-color: rgba(34,212,154,.22);
}
.status-pill.operational .status-dot { background: var(--s-green); }

.status-pill.degraded,
.status-pill.partial_outage {
  color: var(--s-amber);
  background: rgba(245,165,36,.07);
  border-color: rgba(245,165,36,.22);
}
.status-pill.degraded .status-dot,
.status-pill.partial_outage .status-dot { background: var(--s-amber); }

.status-pill.major_outage {
  color: var(--s-red);
  background: rgba(232,25,126,.07);
  border-color: rgba(232,25,126,.22);
}
.status-pill.major_outage .status-dot { background: var(--s-red); }

.status-pill.maintenance {
  color: var(--s-slate);
  background: rgba(112,112,168,.07);
  border-color: rgba(112,112,168,.22);
}
.status-pill.maintenance .status-dot { background: var(--s-slate); }

/* Footer nav */
.footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-nav a {
  font-size: 0.8125rem;
  color: var(--t3);
  transition: color var(--dur) var(--ease);
}
.footer-nav a:hover { color: var(--t2); }

/* =========================================================
   SELECTION & SCROLLBAR
   ========================================================= */
::selection { background: var(--rose); color: #fff; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--ink-1); }
::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* =========================================================
   WP CORE HELPERS
   ========================================================= */
.alignleft  { float: left;  margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text { font-size: 0.8125rem; color: var(--t3); margin-top: 6px; }

.admin-bar #masthead { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #masthead { top: 46px; }
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  :root { --px: 24px; }
  .header-nav { display: none; }
}

@media (max-width: 560px) {
  :root { --px: 16px; --hh: 56px; }
  .footer-wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-copy { display: none; }
}
