/*
   Security Toolbox — Shared Premium Components (Super Pro)
   These styles are loaded in both Admin and Frontend to ensure
   visual parity between preview and shortcodes.
*/

/* ── Base Scoping (Forcing Theme) ── */
.stb-modern-ui {
  --stb-primary-rgb: 14, 165, 233; /* Fallback */
  background: var(--stb-bg-dark, #0f172a) !important;
  color: var(--stb-text-primary, #f1f5f9) !important;
  font-family: var(--stb-font, 'Inter', sans-serif) !important;
}

.stb-modern-ui .stb-widget,
.stb-modern-ui.stb-widget {
  background: var(--stb-bg-card, #1e293b) !important;
  border: 1px solid var(--stb-border, #334155) !important;
  border-radius: var(--stb-radius, 12px) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

:root {
    --stb-primary: #0ea5e9;
    --stb-primary-rgb: 14, 165, 233;
    --stb-success: #10b981;
    --stb-danger: #ef4444;
    --stb-warning: #f59e0b;
    --stb-bg-dark: #0f172a;
    --stb-bg-card: rgba(30, 41, 59, 0.5);
    --stb-border: rgba(255, 255, 255, 0.1);
    --stb-text-dim: #94a3b8;
    --stb-accent-glow: rgba(14, 165, 233, 0.15);
}

/* ── Grid & Cards ── */
.stb-v2-grid { 
    display: grid !important; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important; 
    gap: 15px !important; 
    margin-bottom: 20px !important; 
}

.stb-result-card-v2 { 
    background: var(--stb-bg-card) !important; 
    border: 1px solid var(--stb-border) !important; 
    border-radius: 12px !important; 
    display: flex !important; 
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    color: inherit !important;
}

.stb-result-card-v2:hover { 
    background: rgba(30, 41, 59, 0.8) !important; 
    border-color: var(--stb-primary) !important; 
    transform: translateY(-4px) !important; 
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.3), 0 0 15px rgba(var(--stb-primary-rgb), 0.1);
}

.stb-card-icon-min { 
    width: 32px !important; 
    height: 32px !important; 
    border-radius: 8px !important; 
    background: rgba(14,165,233,0.1) !important; 
    color: var(--stb-primary) !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
}

.stb-card-icon-min .dashicons { 
    font-size: 16px !important; 
    width: 16px !important; 
    height: 16px !important; 
}

.stb-card-content { 
    display: flex !important; 
    flex-direction: column !important; 
    flex: 1 !important; 
}

.stb-card-label { 
    font-size: 10px !important; 
    text-transform: uppercase !important; 
    opacity: 0.5 !important; 
    font-weight: 700 !important; 
    letter-spacing: 0.05em !important; 
}

.stb-card-val { 
    font-size: 13px !important; 
    font-weight: 600 !important; 
    color: #fff !important; 
    font-family: monospace !important; 
}

.stb-mini-copy-v2 { 
    background: transparent !important; 
    border: none !important; 
    color: #94a3b8 !important; 
    cursor: pointer !important; 
    opacity: 0 !important; 
    transition: opacity 0.2s !important; 
    padding: 4px !important;
}

.stb-result-card-v2:hover .stb-mini-copy-v2 { opacity: 1 !important; }
.stb-mini-copy-v2:hover { color: var(--stb-primary) !important; }

/* ── Specialized Boxes ── */
.stb-vlan-binary-box { 
    background: rgba(0,0,0,0.2) !important; 
    border: 1px solid rgba(255,255,255,0.05) !important; 
    border-radius: 8px !important; 
    padding: 12px !important; 
    margin-bottom: 15px !important; 
    text-align: center !important; 
}

.stb-binary-display { 
    font-family: 'Fira Code', monospace !important; 
    color: var(--stb-primary) !important; 
    font-size: 14px !important; 
    letter-spacing: 0.1em !important; 
}

/* ── Tables ── */
.stb-premium-table { 
    font-size: 12px !important; 
    border-collapse: separate !important; 
    border-spacing: 0 !important; 
    width: 100% !important; 
    background: transparent !important;
    color: inherit !important;
}

.stb-premium-table th { 
    text-align: left !important; 
    padding: 8px !important; 
    opacity: 0.5 !important; 
    border-bottom: 1px solid rgba(255,255,255,0.05) !important; 
}

.stb-premium-table td { 
    padding: 8px !important; 
    border-bottom: 1px solid rgba(255,255,255,0.03) !important; 
}

.stb-row-active { 
    background: rgba(14,165,233,0.1) !important; 
    color: var(--stb-primary) !important; 
    font-weight: 700 !important; 
}

/* ── Radar & Scanning ── */
.stb-vlan-radar { 
    position: relative !important; 
    width: 120px !important; 
    height: 120px !important; 
    margin: 0 auto 20px !important; 
    border: 2px solid rgba(14,165,233,0.2) !important; 
    border-radius: 50% !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important;
}

.stb-radar-ping { 
    position: absolute !important; 
    inset: 0 !important; 
    border-radius: 50% !important; 
    border: 2px solid var(--stb-primary) !important; 
    animation: stb-ping 2s infinite !important; 
}

.stb-vlan-steps { 
    margin-top: 15px !important; 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 8px !important; 
}

.stb-vlan-step { 
    font-size: 11px !important; 
    opacity: 0.4 !important; 
    display: flex !important; 
    align-items: center !important; 
    gap: 8px !important; 
    transition: all 0.3s !important; 
}

.stb-vlan-step.active { opacity: 1 !important; color: var(--stb-primary) !important; font-weight: 700 !important; }
.stb-vlan-step.done { opacity: 0.8 !important; color: var(--stb-success) !important; }

/* ── Animations ── */
@keyframes stb-fade-in { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes stb-ping {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ── Email Validator specific (Safe names) ── */
.stb-ev-results {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 15px !important;
    margin: 20px 0 !important;
}

.stb-ev-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stb-ev-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.stb-ev-msg { font-size: 12px; opacity: 0.8; margin-bottom: 8px; }
.stb-ev-suggest { font-size: 11px; color: var(--stb-warning); font-style: italic; }

/* Gauges */
.stb-ev-stats-mini {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.stb-ev-gauge {
    text-align: center;
}

.stb-ev-gauge-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--g-color) var(--g-pct), rgba(255,255,255,0.05) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.stb-ev-gauge-circle::before {
    content: "";
    position: absolute;
    inset: 6px;
    background: var(--stb-bg-dark);
    border-radius: 50%;
}

.stb-ev-gauge-val {
    position: relative;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.stb-ev-gauge-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.6;
}

/* Status variants */
.stb-ev-card.stb-ev-success { border-left-color: var(--stb-success) !important; background: rgba(16,185,129,0.05) !important; }
.stb-ev-card.stb-ev-warning { border-left-color: var(--stb-warning) !important; background: rgba(245,158,11,0.05) !important; }
.stb-ev-card.stb-ev-danger { border-left-color: var(--stb-danger) !important; background: rgba(239,68,68,0.05) !important; }

.stb-ev-status.ok { background: var(--stb-success); color: #fff; }
.stb-ev-status.warn { background: var(--stb-warning); color: #000; }
.stb-ev-status.error { background: var(--stb-danger); color: #fff; }

/* --- WP TOOLS SPECIFIC --- */
.stb-wp-results-container {
    margin-top: 15px;
}

.stb-tool-card h3 {
    color: #f1f5f9 !important;
    font-size: 16px !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.stb-hooks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--stb-border);
}

.stb-hooks-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    border-bottom: 1px solid var(--stb-border);
}

.stb-hooks-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.stb-hooks-table tr:last-child td {
    border-bottom: none;
}

.stb-hooks-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.stb-plugin-row {
    transition: all 0.2s ease;
}

.stb-plugin-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

.stb-wptools-widget .stb-tab-bar {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--stb-border);
    justify-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stb-wptools-widget .stb-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: transparent;
    color: #94a3b8;
}

.stb-wptools-widget .stb-tab-btn.active {
    background: var(--stb-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Radar scanning styles for WP Tools */
.stb-wptools-widget .stb-ev-scanning-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--stb-border);
    border-radius: 16px;
    margin-top: 15px;
}

/* --- WP SNIPPETS --- */
.stb-snip-pub-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--stb-border) !important;
    border-radius: 12px !important;
    margin-bottom: 15px !important;
    overflow: hidden !important;
}

.stb-snip-pub-header {
    padding: 12px 15px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.stb-snip-pub-header strong {
    flex: 1 !important;
    font-size: 14px !important;
    color: #f1f5f9 !important;
}

.stb-snip-pub-code {
    margin: 0 !important;
    padding: 15px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    font-family: 'Fira Code', monospace !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    color: #cbd5e1 !important;
    overflow-x: auto !important;
}

.stb-lang-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    background: var(--stb-primary) !important;
    color: #fff !important;
    font-weight: 700 !important;
}

/* --- Global Improvements --- */
.stb-widget-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 15px 20px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid var(--stb-border) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.stb-widget-header span:first-child {
    font-size: 20px !important;
}

.stb-v2-label {
    font-size: 9px !important;
    text-transform: uppercase !important;
    color: var(--stb-primary) !important;
    font-weight: 800 !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 4px !important;
}

.stb-v2-val {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #f1f5f9 !important;
}

/* --- Radio & Animation Cards --- */
.stb-radio-card, .stb-anim-card {
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
}

.stb-radio-card:hover, .stb-anim-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.stb-radio-card.active, .stb-anim-card.active {
    background: rgba(var(--stb-primary-rgb), 0.15) !important;
    border-color: var(--stb-primary) !important;
    color: var(--stb-primary) !important;
    box-shadow: 0 0 20px rgba(var(--stb-primary-rgb), 0.2);
}

.stb-radio-card input[type="radio"], .stb-anim-card input[type="radio"] {
    display: none !important;
}

.stb-anim-card-icon { font-size: 20px; margin-bottom: 4px; display: block; }
/* --- Hardware-Themed Scanning Container (Super Pro) --- */
.stb-hw-scanning-v3 {
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 20px !important;
    padding: 15px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 1px 1px rgba(255,255,255,0.05) !important;
    position: relative !important;
    overflow: hidden !important;
}
.stb-hw-decor-tl, .stb-hw-decor-tr, .stb-hw-decor-bl, .stb-hw-decor-br {
    position: absolute !important;
    width: 8px !important;
    height: 8px !important;
    background: #334155 !important;
    border: 1px solid rgba(0,0,0,0.3) !important;
    border-radius: 50% !important;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.1) !important;
    z-index: 2 !important;
}
.stb-hw-decor-tl { top: 12px; left: 12px; }
.stb-hw-decor-tr { top: 12px; right: 12px; }
.stb-hw-decor-bl { bottom: 12px; left: 12px; }
.stb-hw-decor-br { bottom: 12px; right: 12px; }

.stb-hw-screen {
    background: #0f172a !important;
    border: 2px solid #334155 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-shadow: inset 0 0 20px rgba(0,0,0,1) !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.stb-hw-progress {
    display: flex !important;
    gap: 4px !important;
    height: 14px !important;
    margin-top: 5px !important;
}
.stb-hw-bar {
    width: 10px !important;
    height: 100% !important;
    background: rgba(255,255,255,0.03) !important;
    border-radius: 2px !important;
    transition: all 0.2s !important;
}
.stb-hw-bar.active {
    background: var(--stb-primary) !important;
    box-shadow: 0 0 10px var(--stb-primary) !important;
}

.stb-hw-led-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 5px !important;
}
.stb-hw-led {
    width: 12px !important;
    height: 12px !important;
    background: #1e293b !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    transition: all 0.2s !important;
}
.stb-hw-led.active {
    background: #10b981 !important;
    box-shadow: 0 0 12px #10b981 !important;
}
.stb-hw-led-label {
    font-size: 9px !important;
    font-weight: 900 !important;
    opacity: 0.5 !important;
    letter-spacing: 0.1em !important;
    color: #fff !important;
}

.stb-radar-v3-wrap {
    width: 140px !important;
    height: 140px !important;
    background: radial-gradient(circle, rgba(14,165,233,0.05) 0%, transparent 70%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@keyframes stb-led-blink {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 15px #10b981; }
}
.stb-blink { animation: stb-led-blink 0.4s infinite !important; }

/* --- Robo Assistant (B0T) --- */
.stb-robo-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    position: relative !important;
    min-height: 180px !important;
    background: radial-gradient(circle at 50% 50%, rgba(14,165,233,0.1) 0%, transparent 70%) !important;
    width: 100% !important;
}
.stb-robo-b0t {
    width: 60px !important;
    height: 70px !important;
    position: relative !important;
    animation: stb-robo-float 3s ease-in-out infinite !important;
    z-index: 2 !important;
}
.stb-robo-head {
    width: 50px !important;
    height: 40px !important;
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    border: 2px solid var(--stb-primary) !important;
    border-radius: 12px !important;
    position: relative !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 20px rgba(14,165,233,0.3) !important;
}
.stb-robo-eyes {
    display: flex !important;
    gap: 10px !important;
}
.stb-robo-eye {
    width: 8px !important;
    height: 8px !important;
    background: var(--stb-primary) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 10px var(--stb-primary) !important;
    animation: stb-robo-blink 4s infinite !important;
}
.stb-robo-body {
    width: 40px !important;
    height: 25px !important;
    background: linear-gradient(to bottom, #1e293b, #0f172a) !important;
    border: 2px solid var(--stb-primary) !important;
    border-radius: 8px !important;
    margin: 5px auto 0 !important;
    position: relative !important;
}
.stb-robo-msg {
    margin-top: 15px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: var(--stb-primary) !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    text-shadow: 0 0 10px rgba(14,165,233,0.5) !important;
    animation: stb-robo-pulse 2s infinite !important;
}
.stb-robo-particle {
    position: absolute !important;
    font-family: monospace !important;
    font-weight: 900 !important;
    pointer-events: none !important;
    z-index: 1 !important;
}
.stb-particle-bit {
    color: var(--stb-primary) !important;
    font-size: 14px !important;
    animation: stb-particle-flow 1s linear forwards !important;
}
.stb-particle-port {
    color: var(--stb-primary) !important;
    font-size: 12px !important;
    animation: stb-particle-burst 0.6s ease-out forwards !important;
}
.stb-robo-world {
    position: absolute !important;
    font-size: 40px !important;
    opacity: 0.3 !important;
    animation: stb-world-rotate 10s linear infinite !important;
    filter: drop-shadow(0 0 15px var(--stb-primary)) !important;
}

@keyframes stb-robo-float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(2deg); }
}
@keyframes stb-robo-blink {
    0%, 95%, 100% { transform: scaleY(1); }
    97.5% { transform: scaleY(0.1); }
}
@keyframes stb-robo-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
@keyframes stb-particle-flow {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, 100px) scale(0.5); opacity: 0; }
}
@keyframes stb-particle-burst {
    0% { transform: scale(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(var(--tx, 20px), var(--ty, -20px)) scale(1.5); opacity: 0; }
}
@keyframes stb-world-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stb-robo-ok { color: #10b981 !important; text-shadow: 0 0 10px rgba(16,185,129,0.5) !important; }
.stb-robo-lost { color: #ef4444 !important; text-shadow: 0 0 10px rgba(239,68,68,0.5) !important; }

/* ── Tab System & Tool Cards (Shared) ── */
.stb-net-tabs { display: flex !important; flex-direction: column !important; gap: 0 !important; }
.stb-tab-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin-bottom: 16px !important;
  border-bottom: 2px solid var(--stb-border, #1e293b) !important;
  padding-bottom: 8px !important;
}
.stb-tab-btn {
  background: transparent !important;
  border: 1px solid var(--stb-border, #1e293b) !important;
  color: var(--stb-text-secondary, #94a3b8) !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  transition: all .15s !important;
  white-space: nowrap !important;
}
.stb-tab-btn:hover { border-color: var(--stb-primary) !important; color: var(--stb-primary) !important; }
.stb-tab-btn.active { background: var(--stb-primary) !important; border-color: var(--stb-primary) !important; color: #fff !important; }
.stb-tab-pane { display: none !important; }
.stb-tab-pane.active { display: block !important; }

.stb-tool-card {
  background: rgba(255,255,255,.03) !important;
  border: 1px solid var(--stb-border, #1e293b) !important;
  border-radius: 12px !important;
  padding: 20px !important;
}
.stb-tool-card h3 { margin: 0 0 14px !important; font-size: 15px !important; color: #fff !important; }
.stb-tool-input-row { display: flex !important; gap: 8px !important; }
.stb-net-input {
  flex: 1 !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--stb-border, #1e293b) !important;
  color: var(--stb-text-primary, #f1f5f9) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  transition: border-color .2s !important;
}
.stb-net-input:focus { outline: none !important; border-color: var(--stb-primary) !important; }
.stb-net-result { margin-top: 12px !important; min-height: 40px !important; }
