/* ==========================================================================
   UltraGuard Pro — Utilities, Grids, Animations & Lists
   
   Contains: grid system, animations, utility classes, lists,
   circular progress, info panels. 
   Does NOT duplicate: buttons, tabs, toasts, toggles, stat-cards, 
   card-headers — those live in admin-components.css.
   ========================================================================== */

/* ==========================================================================
   GRID SYSTEM
   ========================================================================== */
.ultraguard-grid {
  display: grid;
  width: 100%;
  gap: var(--ug-spacing-lg);
  margin-bottom: var(--ug-spacing-lg);
}

.ultraguard-grid-12 {
  grid-template-columns: repeat(12, 1fr);
}

.ultraguard-auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--ug-spacing-lg);
  margin-bottom: var(--ug-spacing-lg);
}

/* Grid item */
.ultraguard-grid-item {
  min-width: 0;
  width: 100%;
}

.ultraguard-grid-item > *:last-child {
  margin-bottom: 0;
}

/* Column spans */
.ultraguard-col-1  { grid-column: span 1; }
.ultraguard-col-2  { grid-column: span 2; }
.ultraguard-col-3  { grid-column: span 3; }
.ultraguard-col-4  { grid-column: span 4; }
.ultraguard-col-5  { grid-column: span 5; }
.ultraguard-col-6  { grid-column: span 6; }
.ultraguard-col-7  { grid-column: span 7; }
.ultraguard-col-8  { grid-column: span 8; }
.ultraguard-col-9  { grid-column: span 9; }
.ultraguard-col-10 { grid-column: span 10; }
.ultraguard-col-11 { grid-column: span 11; }
.ultraguard-col-12 { grid-column: span 12; }

/* ==========================================================================
   ANIMATIONS (single keyframe registry — no duplicates)
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes progress-bar-stripes {
  from { background-position: 10px 0; }
  to   { background-position: 0 0; }
}

/* ==========================================================================
   DISPLAY UTILITIES
   ========================================================================== */
.ultraguard-hidden        { display: none !important; }
.ultraguard-visible       { display: block !important; }
.ultraguard-block         { display: block !important; }
.ultraguard-inline        { display: inline !important; }
.ultraguard-inline-block  { display: inline-block !important; }
.ultraguard-flex          { display: flex !important; }
.ultraguard-inline-flex   { display: inline-flex !important; }

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

/* Flex utilities */
.ultraguard-flex-column     { flex-direction: column !important; }
.ultraguard-flex-row        { flex-direction: row !important; }
.ultraguard-flex-wrap       { flex-wrap: wrap !important; }
.ultraguard-align-center    { align-items: center !important; }
.ultraguard-align-start     { align-items: flex-start !important; }
.ultraguard-align-end       { align-items: flex-end !important; }
.ultraguard-justify-center  { justify-content: center !important; }
.ultraguard-justify-between { justify-content: space-between !important; }
.ultraguard-justify-start   { justify-content: flex-start !important; }
.ultraguard-justify-end     { justify-content: flex-end !important; }
.ultraguard-flex-1          { flex: 1 !important; min-width: 0; }
.ultraguard-flex-none       { flex: none !important; }

/* Spacing */
.ultraguard-m-0  { margin: 0 !important; }
.ultraguard-mt-0 { margin-top: 0 !important; }
.ultraguard-mb-0 { margin-bottom: 0 !important; }
.ultraguard-p-0  { padding: 0 !important; }
.ultraguard-pt-0 { padding-top: 0 !important; }
.ultraguard-pb-0 { padding-bottom: 0 !important; }

/* Text */
.ultraguard-text-center    { text-align: center !important; }
.ultraguard-text-right     { text-align: right !important; }
.ultraguard-text-left      { text-align: left !important; }
.ultraguard-text-uppercase { text-transform: uppercase !important; }
.ultraguard-text-lowercase { text-transform: lowercase !important; }
.ultraguard-text-capitalize{ text-transform: capitalize !important; }
.ultraguard-text-muted     { color: var(--ug-gray) !important; }
.ultraguard-text-primary   { color: var(--ug-primary) !important; }
.ultraguard-text-success   { color: var(--ug-success) !important; }
.ultraguard-text-error     { color: var(--ug-error) !important; }
.ultraguard-text-warning   { color: var(--ug-warning) !important; }
.ultraguard-font-weight-bold { font-weight: 700 !important; }
.ultraguard-font-small     { font-size: var(--ug-font-size-sm) !important; }

/* Border */
.ultraguard-border        { border: 1px solid var(--ug-border) !important; }
.ultraguard-border-0      { border: none !important; }
.ultraguard-rounded       { border-radius: var(--ug-radius-md) !important; }
.ultraguard-rounded-lg    { border-radius: var(--ug-radius-lg) !important; }
.ultraguard-rounded-full  { border-radius: var(--ug-radius-round) !important; }

/* Overflow */
.ultraguard-overflow-hidden { overflow: hidden !important; }
.ultraguard-overflow-auto   { overflow: auto !important; }
.ultraguard-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Width / sizing */
.ultraguard-w-full  { width: 100% !important; }
.ultraguard-w-auto  { width: auto !important; }
.ultraguard-h-full  { height: 100% !important; }
.ultraguard-h-auto  { height: auto !important; }

/* Color backgrounds */
.ultraguard-bg-primary   { background: var(--ug-bg-primary) !important; }
.ultraguard-bg-secondary { background: var(--ug-bg-secondary) !important; }

/* ==========================================================================
   LISTS
   ========================================================================== */
.ultraguard-list {
  list-style: none;
  /* Single padding declaration — original had a duplicate (padding:0 then padding:lg) */
  padding: var(--ug-spacing-md);
  margin: 0 0 var(--ug-spacing-lg) 0;
  background: var(--ug-bg-primary);
  border: 1px solid var(--ug-border);
  border-radius: var(--ug-radius-md);
}

.ultraguard-list-title {
  margin: 0 0 var(--ug-spacing-md) 0;
  font-size: var(--ug-font-size-lg);
  font-weight: 600;
  color: var(--ug-dark);
}

.ultraguard-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--ug-spacing-sm);
  padding: var(--ug-spacing-sm) 0;
  border-bottom: 1px solid var(--ug-border);
  transition: background var(--ug-transition-fast);
}

.ultraguard-list-item:last-child {
  border-bottom: none;
}

.ultraguard-list-item:hover {
  background: var(--ug-bg-secondary);
  padding: var(--ug-spacing-sm);
  border-radius: var(--ug-radius-sm);
}

.ultraguard-list-item > .dashicons {
  color: var(--ug-primary);
  flex-shrink: 0;
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 2px;
}

.ultraguard-list-item-text {
  flex: 1;
  display: block;
  font-size: 13px;
  color: var(--ug-dark);
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ultraguard-list-item-description {
  font-size: 12px;
  color: var(--ug-gray);
  margin-top: 2px;
  line-height: 1.4;
}

.ultraguard-list-badge {
  margin-left: auto;
  flex-shrink: 0;
}

.ultraguard-list-item-actions {
  margin-left: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   CIRCULAR PROGRESS
   ========================================================================== */
.ultraguard-security-suitegress-circle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--ug-spacing-lg);
  background: var(--ug-bg-primary);
  border: 1px solid var(--ug-border);
  border-radius: var(--ug-radius-md);
  padding: var(--ug-spacing-lg);
}

.ultraguard-security-suitegress-circle-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin: var(--ug-spacing-md) 0;
}

.ultraguard-security-suitegress-circle {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ultraguard-security-suitegress-circle-bg {
  fill: none;
  stroke: var(--ug-bg-tertiary);
  stroke-width: 7;
}

.ultraguard-security-suitegress-circle-fill {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--ug-transition-slow);
}

.ultraguard-security-suitegress-circle-fill.ultraguard-security-suitegress-primary { stroke: var(--ug-primary); }
.ultraguard-security-suitegress-circle-fill.ultraguard-security-suitegress-success { stroke: var(--ug-success); }
.ultraguard-security-suitegress-circle-fill.ultraguard-security-suitegress-warning { stroke: var(--ug-warning); }
.ultraguard-security-suitegress-circle-fill.ultraguard-security-suitegress-error   { stroke: var(--ug-error); }

.ultraguard-security-suitegress-circle-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ultraguard-security-suitegress-circle-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ug-dark);
  line-height: 1;
}

.ultraguard-security-suitegress-circle-label {
  font-size: 11px;
  color: var(--ug-gray);
  margin-top: 2px;
}

/* ==========================================================================
   INFO PANELS
   ========================================================================== */
.ultraguard-info-panel {
  display: flex;
  gap: var(--ug-spacing-lg);
  align-items: flex-start;
  padding: var(--ug-spacing-lg);
  background: var(--ug-bg-primary);
  border: 1px solid var(--ug-border);
  border-radius: var(--ug-radius-md);
  margin-bottom: var(--ug-spacing-lg);
}

.ultraguard-info-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ug-gradient-primary);
  color: #fff;
  border-radius: var(--ug-radius-md);
  flex-shrink: 0;
}

.ultraguard-info-content { flex: 1; min-width: 0; }

.ultraguard-info-title {
  margin: 0 0 var(--ug-spacing-sm) 0;
  font-size: var(--ug-font-size-lg);
  font-weight: 600;
  color: var(--ug-dark);
}

.ultraguard-info-description {
  margin: 0 0 var(--ug-spacing-md) 0;
  font-size: var(--ug-font-size-md);
  color: var(--ug-gray);
  line-height: 1.6;
}

.ultraguard-info-actions {
  display: flex;
  gap: var(--ug-spacing-sm);
  align-items: center;
}

.ultraguard-info-panel-success .ultraguard-info-icon { background: var(--ug-gradient-success); }
.ultraguard-info-panel-warning .ultraguard-info-icon { background: var(--ug-gradient-warning); }
.ultraguard-info-panel-error   .ultraguard-info-icon { background: var(--ug-gradient-error); }

/* ==========================================================================
   PAGE-LEVEL RESPONSIVE (supplement to theme breakpoints)
   ========================================================================== */
/* ==========================================================================
   MODULE MANAGER (kept here — only used in one place)
   ========================================================================== */
.ug-module-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--ug-bg-primary);
  border: 1px solid var(--ug-border);
  border-radius: var(--ug-radius-lg);
  margin-bottom: 10px;
  position: relative;
  transition: background var(--ug-transition-fast), box-shadow var(--ug-transition-fast);
}

.ug-module-card:last-child { margin-bottom: 0; }

.ug-module-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ug-primary);
  border-radius: var(--ug-radius-lg) 0 0 var(--ug-radius-lg);
  opacity: 0;
  transition: opacity var(--ug-transition-fast);
}

.ug-module-card:hover::before { opacity: 1; }
.ug-module-card:hover { box-shadow: var(--ug-shadow-sm); }

.ug-module-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--ug-radius-md);
  background: var(--ug-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ug-module-icon {
  font-size: 22px;
  width: 22px;
  height: 22px;
  color: #fff;
}

.ug-module-body { flex: 1; min-width: 0; }

.ug-module-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ug-dark);
  margin: 0 0 3px;
  line-height: 1.2;
}

.ug-module-desc {
  font-size: 12px;
  color: var(--ug-gray);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.ug-module-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ug-module-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--ug-bg-tertiary);
  color: var(--ug-gray);
  line-height: 1.4;
}

.ug-module-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.ug-module-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--ug-gray);
  gap: 12px;
}

.ug-module-empty .dashicons {
  font-size: 36px;
  width: 36px;
  height: 36px;
  color: var(--ug-gray-lighter);
}

.ug-module-empty p {
  margin: 0;
  font-size: 14px;
  max-width: 360px;
  line-height: 1.6;
}

.ug-module-card--locked { opacity: 0.82; background: var(--ug-bg-secondary); }
.ug-module-card--locked::before { background: #f59e0b; }
.ug-module-card--locked:hover { background: #fffbeb; }
.ug-module-icon-wrap--locked { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.ug-module-icon-wrap--error  { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }

.ug-module-tag--pro-active {
  background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(99,102,241,.12));
  color: #4f46e5;
  border: 1px solid rgba(79,70,229,.2);
}

.ug-module-tag--pro-locked {
  background: rgba(245,158,11,.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,.2);
}

.ug-module-btn--upgrade {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #d97706;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(245,158,11,.30);
  transition: background var(--ug-transition-fast), box-shadow var(--ug-transition-fast),
              transform var(--ug-transition-fast);
}

.ug-module-btn--upgrade:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.45);
  transform: translateY(-1px);
}

/* Upload zone */
.ug-drop-zone {
  border: 2px dashed var(--ug-border);
  border-radius: var(--ug-radius-lg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ug-transition-fast), background var(--ug-transition-fast);
  background: var(--ug-bg-secondary);
}

.ug-drop-zone:hover,
.ug-drop-zone--over {
  border-color: var(--ug-primary);
  background: rgba(14,165,233,.03);
}

.ug-drop-icon { font-size: 40px; width: 40px; height: 40px; color: var(--ug-primary); display: block; margin: 0 auto 12px; }
.ug-drop-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ug-dark); }
.ug-drop-hint  { margin: 0; font-size: 12px; color: var(--ug-gray); }

/* Alias used by realtime JS toggle helpers */
.ug-hidden { display: none !important; }

/* ==========================================================================
   RESPONSIVE GRID UTILITIES
   ========================================================================== */

/* Tablet breakpoint responsive column helpers */
/* Mobile: all columns full-width */
/* Tablet-only hide */
/* Desktop-only show */
/* Touch-friendly spacing utilities */
/* Text truncation helper */
.ultraguard-text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive text sizes */
/* Responsive visibility helpers */
.ultraguard-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;
}

/* Horizontal scrollable wrapper */
.ultraguard-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ultraguard-scroll-x::-webkit-scrollbar {
  height: 4px;
}

.ultraguard-scroll-x::-webkit-scrollbar-thumb {
  background: var(--ug-border);
  border-radius: 2px;
}

/* ── Responsive breakpoints (consolidated) ──────────────────────────── */

@media (max-width: 1200px) {
.ultraguard-col-lg-1  { grid-column: span 1; }
  .ultraguard-col-lg-2  { grid-column: span 2; }
  .ultraguard-col-lg-3  { grid-column: span 3; }
  .ultraguard-col-lg-4  { grid-column: span 4; }
  .ultraguard-col-lg-5  { grid-column: span 5; }
  .ultraguard-col-lg-6  { grid-column: span 6; }
  .ultraguard-col-lg-7  { grid-column: span 7; }
  .ultraguard-col-lg-8  { grid-column: span 8; }
  .ultraguard-col-lg-9  { grid-column: span 9; }
  .ultraguard-col-lg-10 { grid-column: span 10; }
  .ultraguard-col-lg-11 { grid-column: span 11; }
  .ultraguard-col-lg-12 { grid-column: span 12; }
}

@media screen and (min-width: 783px) and (max-width: 1024px) {
.ultraguard-hide-tablet { display: none !important; }
}

@media screen and (max-width: 1024px) {
.ultraguard-col-md-1  { grid-column: span 1; }
  .ultraguard-col-md-2  { grid-column: span 2; }
  .ultraguard-col-md-3  { grid-column: span 3; }
  .ultraguard-col-md-4  { grid-column: span 4; }
  .ultraguard-col-md-6  { grid-column: span 6; }
  .ultraguard-col-md-12 { grid-column: span 12; }

  /* Auto-collapse cols > 8 to full width */
  .ultraguard-grid-12 > .ultraguard-col-9,
  .ultraguard-grid-12 > .ultraguard-col-10,
  .ultraguard-grid-12 > .ultraguard-col-11,
  .ultraguard-grid-12 > .ultraguard-col-12 {
    grid-column: span 12;
  }

  /* Auto-collapse cols 7-8 to 6 */
  .ultraguard-grid-12 > .ultraguard-col-7,
  .ultraguard-grid-12 > .ultraguard-col-8 {
    grid-column: span 6;
  }

  /* Reduce grid gap on tablet */
  .ultraguard-grid,
  .ultraguard-grid-12 {
    gap: 14px;
  }
.ultraguard-mt-touch { margin-top: 12px; }
  .ultraguard-mb-touch { margin-bottom: 12px; }
  .ultraguard-p-touch  { padding: 12px; }
}

@media (max-width: 1024px) {
.ultraguard-grid-responsive {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important;
  }

  .ultraguard-grid-responsive > .ultraguard-grid-item {
    grid-column: auto !important;
  }

  .ultraguard-col-md-1  { grid-column: span 1; }
  .ultraguard-col-md-2  { grid-column: span 2; }
  .ultraguard-col-md-3  { grid-column: span 3; }
  .ultraguard-col-md-4  { grid-column: span 4; }
  .ultraguard-col-md-5  { grid-column: span 5; }
  .ultraguard-col-md-6  { grid-column: span 6; }
  .ultraguard-col-md-7  { grid-column: span 6; }
  .ultraguard-col-md-8  { grid-column: span 6; }
  .ultraguard-col-md-9  { grid-column: span 6; }
  .ultraguard-col-md-10 { grid-column: span 6; }
  .ultraguard-col-md-11 { grid-column: span 6; }
  .ultraguard-col-md-12 { grid-column: span 6; }
}

@media (max-width: 900px) {
.ug-module-card { flex-wrap: wrap; }
  .ug-module-desc { max-width: 100%; white-space: normal; }
  .ug-module-actions { width: 100%; justify-content: flex-end; padding-top: 8px; }
}

@media screen and (max-width: 782px) {
.ultraguard-grid-12 > [class*="ultraguard-col-"] {
    grid-column: span 12;
  }

  .ultraguard-grid,
  .ultraguard-grid-12 {
    gap: 10px;
  }

  /* Single-column auto-grid on mobile */
  .ultraguard-auto-grid {
    grid-template-columns: 1fr;
  }

  /* Hide desktop-only utilities */
  .ultraguard-hide-mobile { display: none !important; }
.ultraguard-show-mobile-only { display: block !important; }
.ultraguard-text-responsive-sm { font-size: 12px; }
  .ultraguard-text-responsive-md { font-size: 13px; }
}

@media (max-width: 680px) {
.ultraguard-grid-responsive,
  .ultraguard-grid-12 {
    grid-template-columns: 1fr;
  }
  .ultraguard-col-sm-1,
  .ultraguard-col-sm-2,
  .ultraguard-col-sm-3,
  .ultraguard-col-sm-4,
  .ultraguard-col-sm-5,
  .ultraguard-col-sm-6,
  .ultraguard-col-sm-7,
  .ultraguard-col-sm-8,
  .ultraguard-col-sm-9,
  .ultraguard-col-sm-10,
  .ultraguard-col-sm-11,
  .ultraguard-col-sm-12,
  .ultraguard-col-1,
  .ultraguard-col-2,
  .ultraguard-col-3,
  .ultraguard-col-4,
  .ultraguard-col-5,
  .ultraguard-col-6,
  .ultraguard-col-7,
  .ultraguard-col-8,
  .ultraguard-col-9,
  .ultraguard-col-10,
  .ultraguard-col-11,
  .ultraguard-col-12 {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
.ug-module-card { padding: 14px; gap: 12px; }
  .ug-module-icon-wrap { width: 40px; height: 40px; }
}

@media screen and (min-width: 783px) {
.ultraguard-show-mobile-only { display: none !important; }
}
