/* GuardPress Admin Styles - Enhanced UI v2.0 */

/* ========================================
   Submenu Icons in WordPress Sidebar
   ======================================== */
#adminmenu .toplevel_page_guardpress ul.wp-submenu li a[href$="page=guardpress"]:before,
#adminmenu .toplevel_page_guardpress ul.wp-submenu li.current a[href$="page=guardpress"]:before {
    content: "\f226";
    font-family: dashicons;
    margin-right: 6px;
    opacity: 0.8;
    font-size: 16px;
    vertical-align: middle;
}

#adminmenu .toplevel_page_guardpress ul.wp-submenu li a[href*="guardpress_settings"]:before,
#adminmenu .toplevel_page_guardpress ul.wp-submenu li.current a[href*="guardpress_settings"]:before {
    content: "\f107";
    font-family: dashicons;
    margin-right: 6px;
    opacity: 0.8;
    font-size: 16px;
    vertical-align: middle;
}

#adminmenu .toplevel_page_guardpress ul.wp-submenu li a[href*="guardpress_pro"]:before,
#adminmenu .toplevel_page_guardpress ul.wp-submenu li.current a[href*="guardpress_pro"]:before {
    content: "\f155";
    font-family: dashicons;
    margin-right: 6px;
    opacity: 0.8;
    font-size: 16px;
    vertical-align: middle;
}

/* ========================================
   CSS Variables for easy theming
   ======================================== */
:root {
  --gp-primary: #0073aa;
  --gp-primary-dark: #005a87;
  --gp-success: #00a32a;
  --gp-success-light: #d4edda;
  --gp-success-dark: #0f5132;
  --gp-warning: #dba617;
  --gp-warning-light: #fff3cd;
  --gp-warning-dark: #664d03;
  --gp-danger: #d63638;
  --gp-danger-light: #f8d7da;
  --gp-danger-dark: #842029;
  --gp-info: #72aee6;
  --gp-info-light: #cfe2ff;
  --gp-info-dark: #084298;
  --gp-gray-50: #f8fafc;
  --gp-gray-100: #f1f5f9;
  --gp-gray-200: #e2e8f0;
  --gp-gray-300: #cbd5e1;
  --gp-gray-400: #94a3b8;
  --gp-gray-500: #64748b;
  --gp-gray-600: #475569;
  --gp-gray-700: #334155;
  --gp-gray-800: #1e293b;
  --gp-gray-900: #0f172a;
  --gp-radius: 8px;
  --gp-radius-lg: 12px;
  --gp-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --gp-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --gp-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* ========================================
   Main Container
   ======================================== */
.guardpress-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* ========================================
   Header Section
   ======================================== */
.gp-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.gp-logo {
  /* Logo art is 2400x500 (4.8:1). 125px height keeps the same ~600px on-screen
     width as the previous 2400x600 logo, just a touch shorter. */
  height: 125px;
  width: auto;
}

/* ========================================
   Section Titles (for combined pages)
   ======================================== */
.gp-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--gp-gray-800);
  margin: 30px 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gp-primary);
}

.gp-section-title .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
  color: var(--gp-primary);
}

/* ========================================
   Status Badge
   ======================================== */
.gp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.gp-status-badge.gp-status-secure {
  background: var(--gp-success-light);
  color: var(--gp-success-dark);
}

.gp-status-badge.gp-status-warning {
  background: var(--gp-warning-light);
  color: var(--gp-warning-dark);
}

.gp-status-badge.gp-status-danger {
  background: var(--gp-danger-light);
  color: var(--gp-danger-dark);
}

.gp-status-badge .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* ========================================
   Quick Stats Bar
   ======================================== */
.gp-quick-stats {
  display: flex;
  gap: 16px;
  margin: 16px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--gp-gray-800) 0%, var(--gp-gray-900) 100%);
  border-radius: var(--gp-radius-lg);
  color: #fff;
}

.gp-quick-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gp-quick-stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
}

.gp-quick-stat-icon .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.gp-quick-stat-content {
  display: flex;
  flex-direction: column;
}

.gp-quick-stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.gp-quick-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.gp-quick-stat-divider {
  width: 1px;
  background: rgba(255,255,255,0.2);
  margin: 0 8px;
}

/* ========================================
   Notice Messages
   ======================================== */
.gp-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--gp-radius);
  margin: 12px 0;
  font-size: 14px;
  border-left: 4px solid;
}

.gp-notice .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.gp-notice-success {
  background: var(--gp-success-light);
  border-color: var(--gp-success);
  color: var(--gp-success-dark);
}

.gp-notice-warning {
  background: var(--gp-warning-light);
  border-color: var(--gp-warning);
  color: var(--gp-warning-dark);
}

.gp-notice-error {
  background: var(--gp-danger-light);
  border-color: var(--gp-danger);
  color: var(--gp-danger-dark);
}

.gp-notice-info {
  background: var(--gp-info-light);
  border-color: var(--gp-info);
  color: var(--gp-info-dark);
}

.gp-scan-msg {
  font-size: 16px;
  font-weight: 600;
  color: var(--gp-success-dark);
  margin: 8px 0 10px;
  padding: 12px 16px;
  background: var(--gp-success-light);
  border-radius: var(--gp-radius);
  border-left: 4px solid var(--gp-success);
}

/* ========================================
   Action Buttons
   ======================================== */
.gp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.gp-actions .gp-form {
  margin: 0;
}

.gp-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  border-radius: var(--gp-radius) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  box-sizing: border-box !important;
  min-height: 42px !important;
}

.gp-btn .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.gp-btn-primary {
  background: var(--gp-primary) !important;
  color: #fff !important;
  border-color: var(--gp-primary) !important;
}

.gp-btn-primary:hover {
  background: var(--gp-primary-dark) !important;
  border-color: var(--gp-primary-dark) !important;
  color: #fff !important;
}

.gp-btn-success {
  background: var(--gp-success) !important;
  color: #fff !important;
  border-color: var(--gp-success) !important;
}

.gp-btn-success:hover {
  background: #008a20 !important;
  border-color: #008a20 !important;
  color: #fff !important;
}

.gp-btn-secondary {
  background: #fff !important;
  color: var(--gp-gray-700) !important;
  border-color: var(--gp-gray-300) !important;
}

.gp-btn-secondary:hover {
  background: var(--gp-gray-50) !important;
  border-color: var(--gp-gray-400) !important;
  color: var(--gp-gray-800) !important;
}

.gp-btn-warning {
  background: var(--gp-warning) !important;
  color: #fff !important;
  border-color: var(--gp-warning) !important;
}

.gp-btn-lg {
  padding: 12px 22px !important;
  font-size: 15px !important;
  min-height: 48px !important;
}

/* Old button compat */
.gp-actions .button.gp-big,
.gp-actions a.button.gp-big,
.gp-actions input.button.gp-big[type="submit"] {
  font-size: 14px !important;
  padding: 10px 18px !important;
  line-height: 1.4 !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  border-radius: var(--gp-radius) !important;
}

/* ========================================
   Summary Cards
   ======================================== */
.gp-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
}

@media (max-width: 900px) {
  .gp-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .gp-cards { grid-template-columns: 1fr; }
}

.gp-card {
  background: #fff;
  border: 1px solid var(--gp-gray-200);
  border-radius: var(--gp-radius-lg);
  padding: 20px;
  box-shadow: var(--gp-shadow);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.gp-card:hover {
  box-shadow: var(--gp-shadow-md);
  transform: translateY(-2px);
}

.gp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gp-gray-300);
}

.gp-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--gp-gray-100);
}

.gp-card-icon .dashicons {
  font-size: 22px;
  width: 22px;
  height: 22px;
  color: var(--gp-gray-600);
}

.gp-card-title {
  font-size: 12px;
  color: var(--gp-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  margin-bottom: 6px;
}

.gp-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gp-gray-800);
  line-height: 1.2;
}

.gp-card-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gp-gray-500);
  line-height: 1.4;
}

.gp-card-success::before { background: var(--gp-success); }
.gp-card-success .gp-card-icon { background: var(--gp-success-light); }
.gp-card-success .gp-card-icon .dashicons { color: var(--gp-success); }

.gp-card-warn::before { background: var(--gp-warning); }
.gp-card-warn .gp-card-icon { background: var(--gp-warning-light); }
.gp-card-warn .gp-card-icon .dashicons { color: var(--gp-warning); }
.gp-card-warn .gp-card-value { color: var(--gp-warning-dark); }

.gp-card-info::before { background: var(--gp-info); }
.gp-card-info .gp-card-icon { background: var(--gp-info-light); }
.gp-card-info .gp-card-icon .dashicons { color: var(--gp-info); }

.gp-card-danger::before { background: var(--gp-danger); }
.gp-card-danger .gp-card-icon { background: var(--gp-danger-light); }
.gp-card-danger .gp-card-icon .dashicons { color: var(--gp-danger); }
.gp-card-danger .gp-card-value { color: var(--gp-danger); }

/* ========================================
   Security Checklist
   ======================================== */
.gp-checklist {
  background: #fff;
  border: 1px solid var(--gp-gray-200);
  border-radius: var(--gp-radius-lg);
  padding: 20px;
  margin: 20px 0;
}

.gp-checklist-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gp-gray-800);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gp-checklist-title .dashicons {
  color: var(--gp-primary);
}

.gp-checklist-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 700px) {
  .gp-checklist-items { grid-template-columns: 1fr; }
}

.gp-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--gp-gray-50);
  border-radius: var(--gp-radius);
  font-size: 13px;
  transition: all 0.2s;
}

.gp-checklist-item:hover {
  background: var(--gp-gray-100);
}

.gp-checklist-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.gp-checklist-icon .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.gp-checklist-item.gp-check-pass .gp-checklist-icon {
  background: var(--gp-success-light);
  color: var(--gp-success);
}

.gp-checklist-item.gp-check-fail .gp-checklist-icon {
  background: var(--gp-danger-light);
  color: var(--gp-danger);
}

.gp-checklist-item.gp-check-warn .gp-checklist-icon {
  background: var(--gp-warning-light);
  color: var(--gp-warning-dark);
}

.gp-checklist-text {
  flex: 1;
  color: var(--gp-gray-700);
}

.gp-checklist-action {
  font-size: 12px;
  color: var(--gp-primary);
  text-decoration: none;
}

.gp-checklist-action:hover {
  text-decoration: underline;
}

/* ========================================
   Data Table
   ======================================== */
.gp-table-wrap {
  background: #fff;
  border: 1px solid var(--gp-gray-200);
  border-radius: var(--gp-radius-lg);
  overflow: hidden;
  margin: 20px 0;
}

.gp-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--gp-gray-50);
  border-bottom: 1px solid var(--gp-gray-200);
}

.gp-table-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gp-gray-800);
  margin: 0;
}

.gp-details-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.gp-filter-label {
  font-weight: 500;
  color: var(--gp-gray-600);
  font-size: 13px;
}

.gp-filter {
  padding: 6px 10px;
  border: 1px solid var(--gp-gray-300);
  border-radius: var(--gp-radius);
  font-size: 13px;
  background: #fff;
}

.gp-copy-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: var(--gp-radius) !important;
}

.gp-copy-msg {
  font-size: 12px;
  color: var(--gp-success);
  margin-left: 8px;
}

table.gp-table {
  width: 100%;
  border-collapse: collapse;
}

table.gp-table thead th {
  background: var(--gp-gray-50);
  padding: 12px 16px;
  /* FIX (April 2026): use logical `start` instead of physical `left` so
     headers align with the start of the inline axis — which is left in
     LTR locales (English) and right in RTL locales (Hebrew, Arabic).
     Combined with the matching rule on tbody td below, this keeps
     column headers and their data cells perfectly aligned regardless
     of the site language. */
  text-align: start;
  font-size: 12px;
  font-weight: 600;
  color: var(--gp-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gp-gray-200);
}

table.gp-table tbody td {
  padding: 14px 16px;
  /* Match the header alignment — see note on `thead th` above. Without
     this explicit rule, cells would inherit the browser default which
     differs between LTR and RTL contexts, causing mis-aligned columns. */
  text-align: start;
  border-bottom: 1px solid var(--gp-gray-100);
  font-size: 13px;
  color: var(--gp-gray-700);
}

table.gp-table tbody tr:hover {
  background: var(--gp-gray-50);
}

table.gp-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.gp-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.gp-status.gp-changed {
  background: var(--gp-warning-light);
  color: var(--gp-warning-dark);
}

.gp-status.gp-new {
  background: var(--gp-info-light);
  color: var(--gp-info-dark);
}

.gp-status.gp-deleted {
  background: var(--gp-danger-light);
  color: var(--gp-danger-dark);
}

/* Details Accordion */
.gp-details summary {
  cursor: pointer;
  color: var(--gp-primary);
  font-size: 12px;
}

.gp-details summary:hover {
  text-decoration: underline;
}

.gp-details > div {
  margin-top: 8px;
  padding: 10px;
  background: var(--gp-gray-50);
  border-radius: var(--gp-radius);
  font-size: 12px;
  color: var(--gp-gray-600);
}

.gp-details strong {
  color: var(--gp-gray-700);
}

.gp-form-inline {
  display: inline;
}

.gp-ignore-btn button {
  color: var(--gp-gray-500);
  font-size: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.gp-ignore-btn button:hover {
  background: var(--gp-gray-100);
  color: var(--gp-gray-700);
}

/* ========================================
   Ignored Files Section
   ======================================== */
.gp-ignored-section {
  background: var(--gp-gray-50);
  border: 1px solid var(--gp-gray-200);
  border-radius: var(--gp-radius-lg);
  padding: 16px 20px;
  margin: 20px 0;
}

.gp-ignored-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 13px;
  color: var(--gp-gray-600);
}

.gp-ignored-count {
  font-weight: 600;
  color: var(--gp-gray-700);
}

.gp-ignored-toggle {
  color: var(--gp-primary);
  text-decoration: none;
}

.gp-ignored-toggle:hover {
  text-decoration: underline;
}

.gp-ignored-list {
  margin: 12px 0 0 0;
  padding: 0;
  list-style: none;
}

.gp-ignored-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fff;
  border-radius: var(--gp-radius);
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--gp-gray-600);
}

/* ========================================
   Settings Page
   ======================================== */
.gp-settings-section {
  background: #fff;
  border: 1px solid var(--gp-gray-200);
  border-radius: var(--gp-radius-lg);
  padding: 24px;
  margin: 20px 0;
}

.gp-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--gp-gray-800);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gp-gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gp-subtitle .dashicons {
  color: var(--gp-primary);
}

.gp-settings-section .form-table th {
  width: 200px;
  padding: 16px 10px 16px 0;
  font-weight: 500;
  color: var(--gp-gray-700);
}

.gp-settings-section .form-table td {
  padding: 16px 0;
}

.gp-settings-section .form-table input[type="text"],
.gp-settings-section .form-table textarea,
.gp-settings-section .form-table select {
  border-radius: var(--gp-radius);
}

.gp-settings-section .description {
  color: var(--gp-gray-500);
  font-size: 12px;
  margin-top: 6px;
}

/* ========================================
   Help Section
   ======================================== */
.gp-help {
  background: var(--gp-gray-50);
  border: 1px solid var(--gp-gray-200);
  border-radius: var(--gp-radius-lg);
  padding: 16px 20px;
  margin: 16px 0;
}

.gp-help p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gp-gray-600);
}

.gp-help strong {
  color: var(--gp-gray-800);
}

/* ========================================
   Scan Metadata
   ======================================== */
.gp-scan-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--gp-gray-500);
}

.gp-scan-meta .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

/* ========================================
   Tip Box
   ======================================== */
.gp-ignore-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gp-info-light);
  border-radius: var(--gp-radius);
  margin: 12px 0;
  font-size: 13px;
  color: var(--gp-info-dark);
}

.gp-ignore-tip::before {
  content: '💡';
}

/* ========================================
   Footer
   ======================================== */
.gp-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gp-gray-200);
  color: var(--gp-gray-500);
  font-size: 12px;
}

.gp-footer a {
  color: var(--gp-primary);
}

.gp-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--gp-gray-200);
}

.gp-toplinks {
  margin: 12px 0;
}

.gp-toplinks .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   Empty State
   ======================================== */
.gp-none {
  text-align: center;
  padding: 40px 20px;
  color: var(--gp-gray-500);
  font-size: 14px;
}

.gp-none .dashicons {
  font-size: 48px;
  width: 48px;
  height: 48px;
  color: var(--gp-gray-300);
  display: block;
  margin: 0 auto 12px;
}

/* ========================================
   Progress Overlay
   ======================================== */
#gpProgressOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

.gp-progress-card {
  background: linear-gradient(135deg, var(--gp-gray-800) 0%, var(--gp-gray-900) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  width: min(480px, calc(100vw - 40px));
  padding: 28px;
  box-shadow: var(--gp-shadow-lg);
}

.gp-progress-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.2);
  border-radius: 50%;
}

.gp-progress-icon .dashicons {
  font-size: 30px;
  width: 30px;
  height: 30px;
  color: #22d3ee;
  animation: gp-pulse 2s ease-in-out infinite;
}

@keyframes gp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.gp-progress-title {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 18px;
  text-align: center;
  margin-bottom: 8px;
}

.gp-progress-subtitle {
  color: var(--gp-gray-400);
  font-size: 13px;
  text-align: center;
  margin-bottom: 20px;
}

.gp-progress-track {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.gp-progress-bar {
  height: 100%;
  width: 100%;
  background: transparent;
  position: relative;
}

.gp-progress-bar.gp-progress-bar--indeterminate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -35%;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee, #0ea5e9);
  border-radius: 999px;
  animation: gp-indeterminate 1.2s ease-in-out infinite;
}

@keyframes gp-indeterminate {
  0% { transform: translateX(0); }
  100% { transform: translateX(400%); }
}

.gp-progress-meta {
  margin-top: 16px;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: var(--gp-gray-400);
}

.gp-progress-meta .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.gp-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Button loading state */
.gp-btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}
.gp-btn-loading .gp-btn-text {
  visibility: hidden;
}
.gp-btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gp-spin 0.8s linear infinite;
}
.button-secondary.gp-btn-loading::after {
  border-color: rgba(0,0,0,0.2);
  border-top-color: var(--gp-primary);
}

.gp-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid var(--gp-gray-300);
  border-top-color: var(--gp-primary);
  border-radius: 50%;
  animation: gp-spin 0.8s linear infinite;
}

/* Small inline spinner for buttons */
.gp-spinner-sm {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  vertical-align: middle;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gp-spin 0.8s linear infinite;
}
.button-secondary .gp-spinner-sm {
  border-color: rgba(0,0,0,0.2);
  border-top-color: var(--gp-primary);
}

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

/* Spinning animation for buttons */
.dashicons.spinning,
.spinning {
  animation: gp-spin 1s linear infinite;
}

/* ========================================
   Dashboard Widget
   ======================================== */
#guardpress_dashboard_widget .inside {
  padding: 0;
  margin: 0;
}

.gp-widget {
  padding: 12px;
}

.gp-widget-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--gp-radius);
  margin-bottom: 12px;
}

.gp-widget-status.status-ok {
  background: var(--gp-success-light);
}

.gp-widget-status.status-warning {
  background: var(--gp-warning-light);
}

.gp-widget-status.status-danger {
  background: var(--gp-danger-light);
}

.gp-widget-status .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.gp-widget-status.status-ok .dashicons { color: var(--gp-success); }
.gp-widget-status.status-warning .dashicons { color: var(--gp-warning); }
.gp-widget-status.status-danger .dashicons { color: var(--gp-danger); }

.gp-widget-status-text { flex: 1; }

.gp-widget-status-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--gp-gray-800);
}

.gp-widget-status-desc {
  font-size: 12px;
  color: var(--gp-gray-600);
}

.gp-widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.gp-widget-stat {
  text-align: center;
  padding: 10px;
  background: var(--gp-gray-50);
  border-radius: var(--gp-radius);
}

.gp-widget-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gp-gray-800);
}

.gp-widget-stat-label {
  font-size: 11px;
  color: var(--gp-gray-500);
  text-transform: uppercase;
}

.gp-widget-actions {
  display: flex;
  gap: 8px;
}

.gp-widget-actions .button { flex: 1; text-align: center; }

/* ========================================
   Admin Bar Status
   ======================================== */
#wp-admin-bar-guardpress-status > .ab-item {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#wp-admin-bar-guardpress-status .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

#wp-admin-bar-guardpress-status.gp-status-ok .dashicons { color: #46b450; }
#wp-admin-bar-guardpress-status.gp-status-warning .dashicons { color: #ffb900; }
#wp-admin-bar-guardpress-status.gp-status-danger .dashicons { color: #dc3232; }

/* ========================================
   Privacy Note
   ======================================== */
.gp-privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--gp-gray-50);
  border-radius: var(--gp-radius);
  font-size: 12px;
  color: var(--gp-gray-600);
}

.gp-privacy-note .dashicons {
  color: var(--gp-success);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 782px) {
  .gp-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .gp-actions .gp-btn,
  .gp-actions .button {
    width: 100%;
    justify-content: center;
  }
  
  .gp-quick-stats {
    flex-direction: column;
  }
  
  .gp-quick-stat-divider {
    width: 100%;
    height: 1px;
    margin: 8px 0;
  }
  
  .gp-checklist-items {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Code Modal Styles
   ======================================== */
.gp-code-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
}

.gp-code-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.gp-code-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--gp-gray-100);
  border-bottom: 1px solid var(--gp-gray-200);
}

.gp-code-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--gp-gray-700);
  word-break: break-all;
}

.gp-code-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gp-gray-500);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.gp-code-modal-close:hover {
  background: var(--gp-gray-200);
  color: var(--gp-gray-700);
}

.gp-code-modal-body {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.gp-code-loading {
  padding: 40px;
  text-align: center;
  color: var(--gp-gray-500);
}

.gp-code-content {
  margin: 0;
  padding: 20px;
  font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  background: #1e1e1e;
  color: #d4d4d4;
  overflow-x: auto;
  white-space: pre;
  min-height: 200px;
}

.gp-code-error {
  padding: 20px;
  color: var(--gp-danger);
  text-align: center;
}

/* ========================================
   Toggle Switch Styles
   ======================================== */
.gp-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.gp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.gp-toggle .slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: .3s;
}

.gp-toggle .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gp-toggle input:checked + .slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gp-toggle input:checked + .slider:before {
  transform: translateX(24px);
}

.gp-toggle input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* ON/OFF text labels */
.gp-toggle .slider:after {
  content: "OFF";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gp-toggle input:checked + .slider:after {
  content: "ON";
  left: 8px;
  right: auto;
  color: #fff;
}

/* Toggle with inline label */
.gp-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gp-toggle-row .gp-toggle-label {
  font-weight: 500;
  color: #1d2327;
}

.gp-toggle-row .gp-toggle-description {
  color: #646970;
  font-size: 13px;
  margin-top: 2px;
}

/* Disabled toggle */
.gp-toggle.disabled,
.gp-toggle input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Larger toggle for prominent settings */
.gp-toggle-lg {
  width: 60px;
  height: 32px;
}

.gp-toggle-lg .slider {
  border-radius: 32px;
}

.gp-toggle-lg .slider:before {
  height: 26px;
  width: 26px;
  bottom: 3px;
}

.gp-toggle-lg input:checked + .slider:before {
  transform: translateX(28px);
}

/* ========================================
   PRO Form Styles
   ======================================== */
.gp-pro-wrap {
  max-width: 1000px;
}

.gp-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 25px 30px;
  margin-bottom: 25px;
}

.gp-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
}

.gp-form-row {
  display: flex;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid #f3f4f6;
}

.gp-form-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.gp-form-row > label {
  flex: 0 0 200px;
  font-weight: 500;
  padding-top: 8px;
  color: #374151;
}

.gp-form-row .gp-input {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.gp-form-row .gp-help {
  width: 100%;
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.gp-pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 10px;
  text-transform: uppercase;
}

/* Dashboard grid for stats */
.gp-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.gp-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.gp-stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

/* Smaller font for date values (longer text) */
.gp-stat-card .stat-value.stat-date {
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-stat-card .stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-top: 5px;
}

.gp-stat-card.success {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.gp-stat-card.success .stat-value {
  color: #10b981;
}

.gp-stat-card.warning {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.gp-stat-card.warning .stat-value {
  color: #f59e0b;
}

.gp-stat-card.danger {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.gp-stat-card.danger .stat-value {
  color: #ef4444;
}

.gp-stat-card.info {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.gp-stat-card.info .stat-value {
  color: #3b82f6;
}

/* Button with spinner */
.gp-btn-with-spinner {
  position: relative;
  min-width: 120px;
}

.gp-btn-with-spinner.loading {
  pointer-events: none;
}

.gp-btn-with-spinner.loading .btn-text {
  visibility: hidden;
}

.gp-btn-with-spinner.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gp-spin 0.8s linear infinite;
}

/* ========================================
   FIXED Toggle Switch Styles (v1.6.1)
   More specific selectors to override WP
   ======================================== */
.guardpress-wrap .gp-toggle,
.gp-pro-wrap .gp-toggle,
label.gp-toggle {
  position: relative !important;
  display: inline-block !important;
  width: 50px !important;
  height: 26px !important;
  cursor: pointer !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

.guardpress-wrap .gp-toggle input[type="checkbox"],
.gp-pro-wrap .gp-toggle input[type="checkbox"],
label.gp-toggle input[type="checkbox"] {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
}

.guardpress-wrap .gp-toggle .slider,
.gp-pro-wrap .gp-toggle .slider,
label.gp-toggle .slider,
label.gp-toggle span.slider {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 50px !important;
  height: 26px !important;
  background-color: #ccc !important;
  border-radius: 26px !important;
  transition: background-color 0.3s ease !important;
  display: block !important;
}

.guardpress-wrap .gp-toggle .slider:before,
.gp-pro-wrap .gp-toggle .slider:before,
label.gp-toggle .slider:before,
label.gp-toggle span.slider:before {
  position: absolute !important;
  content: "" !important;
  height: 20px !important;
  width: 20px !important;
  left: 3px !important;
  bottom: 3px !important;
  background-color: white !important;
  border-radius: 50% !important;
  transition: transform 0.3s ease !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  display: block !important;
}

.guardpress-wrap .gp-toggle input:checked + .slider,
.gp-pro-wrap .gp-toggle input:checked + .slider,
label.gp-toggle input:checked + .slider,
label.gp-toggle input[type="checkbox"]:checked + .slider,
label.gp-toggle input[type="checkbox"]:checked + span.slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.guardpress-wrap .gp-toggle input:checked + .slider:before,
.gp-pro-wrap .gp-toggle input:checked + .slider:before,
label.gp-toggle input:checked + .slider:before,
label.gp-toggle input[type="checkbox"]:checked + .slider:before,
label.gp-toggle input[type="checkbox"]:checked + span.slider:before {
  transform: translateX(24px) !important;
}

/* ========================================
   Dashboard Scan Details Section Enhancement
   ======================================== */
.gp-scan-details-section {
  margin-top: 30px !important;
  padding-top: 25px !important;
  border-top: 2px solid var(--gp-primary);
}

.gp-scan-details-title,
h2.gp-scan-details-title {
  font-size: 42px !important;
  font-weight: 700 !important;
  color: var(--gp-gray-800) !important;
  margin-bottom: 25px !important;
  margin-top: 40px !important;
  padding: 30px 20px !important;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-radius: 12px !important;
  border-top: 2px solid #e5e7eb !important;
  border-left: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 15px !important;
  text-align: center !important;
}

.gp-scan-details-title .dashicons {
  font-size: 42px !important;
  width: 42px !important;
  height: 42px !important;
  color: var(--gp-primary) !important;
}

/* ========================================
   Enhanced Section Cards
   ======================================== */
.gp-security-checklist-section,
.gp-database-scanner-section,
.gp-core-integrity-section {
  margin-top: 25px !important;
}

.gp-security-checklist-section h3,
.gp-database-scanner-section h3,
.gp-core-integrity-section h3,
.gp-section-header {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: var(--gp-gray-800) !important;
  padding: 12px 16px !important;
  background: var(--gp-gray-50) !important;
  border-radius: 8px 8px 0 0 !important;
  border-bottom: 1px solid var(--gp-gray-200) !important;
  margin: 0 !important;
}

/* Card improvements */
.gp-card.gp-security-checklist,
.gp-card.gp-database-scanner,
.gp-card.gp-core-integrity {
  margin-top: 20px !important;
  border: 1px solid var(--gp-gray-200) !important;
  border-radius: 12px !important;
  box-shadow: var(--gp-shadow-md) !important;
}

/* Stats row spacing before scan details */
.gp-stats-row + .gp-scan-details-section,
.gp-pro-stats + .gp-scan-details-section {
  margin-top: 40px !important;
}

/* ========================================
   Cloud Storage Connect Buttons
   ======================================== */
.gp-cloud-connect-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.gp-cloud-connect-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.gp-cloud-connect-btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.gp-cloud-help-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  color: var(--gp-primary) !important;
  font-size: 13px !important;
  text-decoration: none !important;
  margin-top: 8px !important;
}

.gp-cloud-help-link:hover {
  text-decoration: underline !important;
}

/* ========================================
   Form Row Help Text
   ======================================== */
.gp-form-row .gp-help,
.gp-input .gp-help {
  font-size: 13px !important;
  color: var(--gp-gray-500) !important;
  margin-top: 6px !important;
  line-height: 1.5 !important;
}
