/* ============================================================
   WordAI Admin Global Stylesheet
   For all WordAI Admin Pages (API, Content, Image, Key, etc.)
   ------------------------------------------------------------
   Includes:
   1. Font Definitions
   2. Icons & Branding Elements
   3. Buttons & Controls
   4. Premium Table & Layout Structure
   5. Messages & Alerts
   6. Inputs & Form Fields
   7. Generated Content Areas
   8. Animations
   9. Modern Enhancements (hover polish, slider)
   10. Dark Mode Adaptive Styling
   11. Minimal Mode Toggle
   12. Section Dividers
   ============================================================ */


/* ------------------------------------------------------------
   1️⃣ FONT DEFINITIONS
   ------------------------------------------------------------ */
@font-face {
  font-family: 'Merienda';
  src: url(../fonts/Merienda-VariableFont_wght.ttf);
}
@font-face {
  font-family: 'Monoton';
  src: url(../fonts/Monoton-Regular.ttf);
}


/* ------------------------------------------------------------
   2️⃣ ICONS & BRANDING ELEMENTS
   ------------------------------------------------------------ */
.sc-wordai-icon { margin-right: 5px; }
.boost-your-productivity-icon { color: #2271b1; }

.sc-wordai-apisettings-icon {
  margin-right: 15px;
  font-size: 30px;
  font-weight: bolder;
  margin-top: -5px;
}

.sc-wordai-apisettings-custom-icon {
  background-image: url(images/wordai-light-48x48.svg);
  background-repeat: no-repeat;
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 3px;
}

.sc-wordai-metabox-button-custom-icon {
  background-image: url(images/wordai-light-20x20.svg);
  background-repeat: no-repeat;
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: sub;
  border-radius: 3px;
}

.sc-wordai-metabox-popup-window-title-icon {
  background-image: url(images/wordai-light-20x20.svg);
  background-repeat: no-repeat;
  display: inline-block;
  width: 20px;
  height: 20px;
  padding-right: 5px;  
  vertical-align: bottom;
  border-radius: 1px;
}
.sc-wordai-suggest-titles-row-icon {
  background-image: url(images/wordai-light-16x16.svg);
  background-repeat: no-repeat;
  display: inline-block;
  width: 16px;
  height: 16px;
  padding-right: 3px;  
  vertical-align: bottom;
  border-radius: 1px;
}

.wordai-image-icon-wrapper-div { position: relative; }
.wordai-image-icon-wrapper-div img {
  border-radius: 5px;
  margin-right: 10px;
}

.wordai-all-page-top-label-name {
  position: absolute;
  top: 17px;
  font-size: 30px;
  font-weight: 800;
  font-family: 'Monoton', Arial, Helvetica, sans-serif;
}

.sc-wordai-settings-icon {
  font-size: 28px !important;
  font-weight: bold !important;
  padding-right: 15px;
  vertical-align: text-top;
  color: #2271b1 !important;
}

/* legacy hint text spacing kept for compatibility */
.sc-wordai-settings-text-hints { padding-top: 4%; }

.sc-wordai-apikey-require-hints {
  font-size: 16px;
  color: coral;
  font-family: 'Merienda', Arial, Helvetica, sans-serif;
  line-height: 1.7em;
}


/* ------------------------------------------------------------
   3️⃣ BUTTONS & CONTROLS
   ------------------------------------------------------------ */
button.button-primary.button-large.metabox-content-writer-btn {
  font-size: 18px !important;
  width: 100%;
}

.metabox-content-writer-btn {
  padding: 5px !important;
  border-radius: 5px;
  box-shadow: 0 0 5px #2271b1;
  min-height: 40px !important;
  color: #fff;
  font-weight: bold;
  /* width: 50%; */
}

.sc-wordai-items-label {
  font-size: 14px;
  vertical-align: middle;
  font-weight: bold;
  cursor: pointer;
}


/* ------------------------------------------------------------
   4️⃣ PREMIUM TABLE & LAYOUT STRUCTURE
   (Replaces previous ridge/dashed borders with modern container)
   ------------------------------------------------------------ */
#openai-settings-div-wrapper,
#openai-content-settings-div-wrapper,
#openai-image-settings-div-wrapper,
#openai-agent-settings-wrapper,
#wordai-chat-settings-wrapper {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  border: 1px solid #d0d7de;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 25px 30px;
  margin: 20px 0;
  animation: fadeSlideIn 0.6s ease both;
}

/* Headings inside wrappers */
#openai-settings-div-wrapper h3,
#openai-content-settings-div-wrapper h3,
#openai-image-settings-div-wrapper h3,
#openai-agent-settings-wrapper h3,
#wordai-chat-settings-wrapper h3 {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 15px;
  color: #1d2327;
}

/* Tables */
#openai-settings-div-wrapper table,
#openai-content-settings-div-wrapper table,
#openai-image-settings-div-wrapper table,
#openai-agent-settings-wrapper table,
#wordai-chat-settings-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
}

/* Rows */
#openai-settings-div-wrapper tr,
#openai-content-settings-div-wrapper tr,
#openai-image-settings-div-wrapper tr,
#openai-agent-settings-wrapper tr,
#wordai-chat-settings-wrapper tr {
  background: #fff;
  border-bottom: 1px solid #ebeff3; /* thin, premium divider */
  transition: background-color 0.25s ease, transform 0.2s ease;
  animation: fadeUpRow 0.5s ease both;
}
#openai-settings-div-wrapper tr:hover,
#openai-content-settings-div-wrapper tr:hover,
#openai-image-settings-div-wrapper tr:hover,
#openai-agent-settings-wrapper tr:hover,
#wordai-chat-settings-wrapper tr:hover {
  background-color: #f0f7ff;
  transform: scale(1.002);
}

/* Cells */
#openai-settings-div-wrapper td,
#openai-content-settings-div-wrapper td,
#openai-image-settings-div-wrapper td,
#openai-agent-settings-wrapper td,	
#wordai-chat-settings-wrapper td {
  padding: 18px 15px;
  vertical-align: top;
}

/* First column titles */
#openai-settings-div-wrapper td:first-child h4,
#openai-content-settings-div-wrapper td:first-child h4,
#openai-image-settings-div-wrapper td:first-child h4,
#openai-agent-settings-wrapper td:first-child h4,	
#wordai-chat-settings-wrapper td:first-child h4 {
  font-family: 'Merienda', Arial, Helvetica, sans-serif;
  font-weight: 700;
  color: #1d2327;
  margin-bottom: 6px;
}

/* First column selects */
#openai-settings-div-wrapper td:first-child select,
#openai-content-settings-div-wrapper td:first-child select,
#openai-image-settings-div-wrapper td:first-child select,
#openai-agent-settings-wrapper td:first-child select,
#wordai-chat-settings-wrapper td:first-child select,
#wa-embed-model,
#sc-wordai-ai-provider,
.sc-wordai-select-wrapper select {
  /* width: 95%; */
  /* padding: 8px 10px; */
  padding: 8px 20px;
  font-size: 14px;
  border: 1px solid #ccd0d4;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.2s ease;
}
#openai-settings-div-wrapper td:first-child select:focus,
#openai-content-settings-div-wrapper td:first-child select:focus,
#openai-image-settings-div-wrapper td:first-child select:focus,
#openai-agent-settings-wrapper td:first-child select:focus,
#wordai-chat-settings-wrapper td:first-child select:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}

/* Hint callouts (overrides the earlier spacing-only class) */
.sc-wordai-settings-text-hints {
  color: #50575e;
  font-size: 13.5px;
  line-height: 1.6em;
  background: #f9fafb;
  padding: 10px 14px;
  border-left: 3px solid #2271b1;
  border-radius: 6px;
  margin: 6px 0 4px 0;
  box-shadow: inset 0 0 4px rgba(34,113,177,0.08);
  transition: background 0.25s ease;
  animation: fadeSlideIn 0.6s ease both;
}
.sc-wordai-settings-text-hints:hover { background: #f2f8ff; }

/* Variant accents */
.sc-wordai-settings-text-hints.alert-success { border-left-color: #4BB543; color: #2d5c2d; }
.sc-wordai-settings-text-hints.alert-error   { border-left-color: #d63638; color: #792c2d; }
.sc-wordai-settings-text-hints.alert-warning { border-left-color: #f1b50f; color: #7a6200; }
.sc-wordai-settings-text-hints.alert-info    { border-left-color: #36BCD1; color: #185e72; }

/* Links inside hint */
.sc-wordai-settings-text-hints a {
  color: #2271b1;
  font-weight: 600;
  text-decoration: underline;
}
.sc-wordai-settings-text-hints a:hover {
  color: #1d5c8a;
  text-decoration: none;
}

/* API Key panel (kept, but modernized slightly) */
.openai-api-key-save-div-wrapper {
  background: linear-gradient(180deg, #ffffff 0%, #f8f0ff 100%);
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 3%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.openai-api-key-save-div-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

/* Hover color accent for H4s */
#openai-settings-div-wrapper tr:hover td h4,
#openai-content-settings-div-wrapper tr:hover td h4,
#openai-image-settings-div-wrapper tr:hover td h4,
#openai-agent-settings-wrapper tr:hover td h4,
#wordai-chat-settings-wrapper tr:hover td h4 {
  color: #2271b1;
}


/* ------------------------------------------------------------
   5️⃣ MESSAGES & ALERTS
   ------------------------------------------------------------ */
.success-msg { color: #4BB543; font-weight: 600; }
.alert-msg   { color: cornflowerblue; font-weight: 600; }
.error-msg   { color: red; font-weight: 600; }
.alert-change { color: blueviolet; }
.warning-msg  { color: #ffc107; font-weight: 600; }
.alert-remind { color: #36BCD1; font-weight: bold; }
.alert-success { color: #4BB543; }
.alert-error { color: red; }

.wordai-api-key-save-feedback-msg-td {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.5s ease;
  text-align: center ! important;
  padding-bottom: 15px;
}


/* ------------------------------------------------------------
   6️⃣ INPUTS & FORM FIELDS (incl. range)
   ------------------------------------------------------------ */
input.wordai-api-key-data,
input.wordai-openai-api-key-data,
input.wordai-google-gemini-api-key-data {
  height: 50px !important;
  width: 100%;
  font-size: 16px;
}

.api-key-label-td {
  font-size: 14px;
  font-weight: 600;
  width: 20%;
  font-family: 'Merienda', Arial, Helvetica, sans-serif;
}

.api-key-input-data-td { width: 70%; }
.wordai-google-gemini-api-key-show-td, .wordai-openai-api-key-show-td { width: 8%; padding-left: 2%;}
.sc-wordai-save-apikey-submit-btn-td {
  text-align: center;
  width: 8%;
}
.sc-wordai-save-apikey-submit-btn {
  padding: 8px 15px !important;
  font-size: 16px !important;
  font-weight: bold;
}


#openai-content-settings-div-wrapper select { width: 90%; }
input.scwordai-prompt { min-width: 750px; min-height: 50px; }

/* Generic fields */
input[type="text"],
input[type="number"],
select,
textarea {
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  background-color: #fff;
  color: #1d2327;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34,113,177,0.2);
  outline: none;
}

/* Range (with CSS var fallback) */
input[type="range"] {
  width: 80%;
  height: 6px;
  border-radius: 4px;
  background: #ddd; /* default; JS enhances to gradient */
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
/* WebKit thumb */
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2271b1;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  transition: transform 0.2s, background-color 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  background-color: #1d5c8a;
  transform: scale(1.1);
}
/* Firefox fills */
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #2271b1; cursor: pointer;
}
input[type="range"]::-moz-range-progress {
  background-color: #2271b1; height: 6px; border-radius: 4px;
}
input[type="range"]::-moz-range-track {
  background-color: #ddd; height: 6px; border-radius: 4px;
}
/* IE/Edge legacy fallback */
input[type="range"]::-ms-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #2271b1;
}
input[type="range"]::-ms-fill-lower { background-color: #2271b1; border-radius: 4px; }
input[type="range"]::-ms-fill-upper { background-color: #ddd; border-radius: 4px; }

/* Tiny value pill (your existing readout) */
.range-selected-value {
  font-size: 16px;
  text-align: center;
  font-weight: bold;
  background-color: honeydew;
  width: 50px;
  margin: 0 auto;
  border-radius: 40%;
  padding: 5px;
}


/* ------------------------------------------------------------
   7️⃣ GENERATED CONTENT AREAS
   ------------------------------------------------------------ */
.sc-wordai-generated-title,
.sc-wordai-generated-tags,
.sc-wordai-generated-seo-title,
.sc-wordai-generated-seo-meta-description,
.sc-wordai-generated-seo-meta-focus-keyword {
  min-width: 750px;
  font-size: 16px;
  background-color: #fff;
  color: #000;
}
.sc-wordai-generated-content {
  min-width: 750px; min-height: 350px;
  font-size: 16px; background-color: #fff; color: #000;
}
.sc-wordai-generated-excerpt {
  min-width: 750px; 
  /* min-height: 200px; */
  font-size: 16px; background-color: #fff; color: #000;
}
.update-suggested-title-msg span {
  vertical-align: bottom;
  padding-left: 10px;
}
.sc-wordai-generated-image-wrapper {
  display: flex;
  flex-direction: row;
  margin: 0 auto;
  align-items: flex-start;
  max-width: 650px;
}
.sc-wordai-generated-image-wrapper img {
  max-width: 150px; max-height: 150px;
  margin-right: 10px;
  border-radius: 5px;
  box-shadow: rgba(0,0,0,0.35) 0 5px 15px;
}


/* ------------------------------------------------------------
   8️⃣ ANIMATIONS (subtle)
   ------------------------------------------------------------ */
@keyframes fadeUpRow {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ------------------------------------------------------------
   9️⃣ MODERN ENHANCEMENTS (hover polish, buttons)
   ------------------------------------------------------------ */
#openai-settings-div-wrapper table tr,
#openai-content-settings-div-wrapper table tr,
#openai-image-settings-div-wrapper table tr,
.openai-api-key-save-div-wrapper table tr,
#openai-agent-settings-wrapper table tr,
#wordai-chat-settings-wrapper table tr {
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
#openai-settings-div-wrapper table tr:hover,
#openai-content-settings-div-wrapper table tr:hover,
#openai-image-settings-div-wrapper table tr:hover,
.openai-api-key-save-div-wrapper table tr:hover,
#openai-agent-settings-wrapper table tr:hover,
#wordai-chat-settings-wrapper table tr:hover {
  background-color: #f6faff;
  box-shadow: inset 0 0 6px rgba(34,113,177,0.15);
}

/* Buttons (primary/secondary) */
button.button-primary,
button.button-secondary {
  padding: 8px 18px !important;
  font-size: 15px !important;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s;
}
button.button-primary {
  background-color: #2271b1 !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(34,113,177,0.3);
}
button.button-primary:hover {
  background-color: #1d5c8a !important;
  box-shadow: 0 3px 8px rgba(34,113,177,0.45);
  transform: translateY(-1px);
}
button.button-secondary {
  background-color: #f6f7f7 !important;
  color: #1d2327 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
button.button-secondary:hover {
  background-color: #e9f0f8 !important;
  box-shadow: 0 3px 6px rgba(34,113,177,0.3);
  transform: translateY(-1px);
}


/* ------------------------------------------------------------
   🔟 DARK MODE ADAPTIVE STYLING
   (WordPress admin adds body.is-dark-theme)
   ------------------------------------------------------------ */
body.is-dark-theme,
.wp-admin.is-dark-theme {
  --panel: #2c3338;
  --border: #444;
  --accent: #3398db;
  --text: #e0e0e0;
  --muted: #aaaaaa;
}

body.is-dark-theme #openai-settings-div-wrapper,
body.is-dark-theme #openai-content-settings-div-wrapper,
body.is-dark-theme #openai-image-settings-div-wrapper,
body.is-dark-theme .openai-api-key-save-div-wrapper,
body.is-dark-theme #openai-agent-settings-wrapper,
body.is-dark-theme #wordai-chat-settings-wrapper {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

body.is-dark-theme tr { border-color: var(--border); }
body.is-dark-theme tr:hover {
  background-color: #283038;
  box-shadow: inset 0 0 5px rgba(51,152,219,0.25);
}

body.is-dark-theme h3,
body.is-dark-theme h4,
body.is-dark-theme td,
body.is-dark-theme th,
body.is-dark-theme p,
body.is-dark-theme small,
body.is-dark-theme label {
  color: var(--text) !important;
}

body.is-dark-theme input,
body.is-dark-theme select,
body.is-dark-theme textarea {
  background-color: #181d20;
  border: 1px solid var(--border);
  color: var(--text);
}
body.is-dark-theme input:focus,
body.is-dark-theme select:focus,
body.is-dark-theme textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(51,152,219,0.25);
}

/* Range in dark */
body.is-dark-theme input[type="range"] {
  background: #555; /* Firefox/Legacy base */
}
body.is-dark-theme input[type="range"]::-webkit-slider-thumb,
body.is-dark-theme input[type="range"]::-moz-range-thumb {
  background-color: #3398db;
}
body.is-dark-theme input[type="range"]::-moz-range-progress,
body.is-dark-theme input[type="range"]::-ms-fill-lower {
  background-color: #3398db;
}

/* Message colors in dark */
body.is-dark-theme .success-msg { color: #5cff9d; }
body.is-dark-theme .alert-msg   { color: #6ab8ff; }
body.is-dark-theme .error-msg   { color: #ff7676; }
body.is-dark-theme .warning-msg { color: #ffcd58; }
body.is-dark-theme .sc-wordai-apikey-require-hints { color: #ffa57f; }
body.is-dark-theme .range-selected-value {
  background-color: #333b40;
  color: var(--text);
}


/* ------------------------------------------------------------
   1️⃣1️⃣ MINIMAL MODE TOGGLE & HELP HINT STYLING
   ------------------------------------------------------------ */
.sc-wordai-compact-toggle {
  text-align: right;
  margin: -10px 10px 10px 0;
  font-weight: 600;
  color: #2271b1;
  user-select: none;
}
.sc-wordai-compact-toggle input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 6px;
  cursor: pointer;
  accent-color: #2271b1;
}

.sc-wordai-settings-text-hints {
  position: relative;
  padding: 10px 14px;
  margin-top: 10px;
  border-left: 3px solid #2271b1;
  background-color: #f9fbff;
  border-radius: 4px;
  line-height: 1.6em;
  font-size: 14px;
  color: #1d2327;
  box-shadow: 0 0 4px rgba(34,113,177,0.08);
}
.sc-wordai-settings-text-hints::before {
  content: "💡 ";
  font-weight: bold;
  color: #2271b1;
}

/* Collapse hints in minimal mode */
body.sc-wordai-minimal-mode .sc-wordai-settings-text-hints {
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  transition: all 0.3s ease-in-out;
}

/* Dark mode for hints/toggle */
body.is-dark-theme .sc-wordai-settings-text-hints {
  background-color: #2c3338;
  border-left-color: #3398db;
  color: #e0e0e0;
  box-shadow: 0 0 6px rgba(51,152,219,0.2);
}
body.is-dark-theme .sc-wordai-settings-text-hints::before { color: #3398db; }
body.is-dark-theme .sc-wordai-compact-toggle { color: #3398db; }
body.is-dark-theme.sc-wordai-minimal-mode .sc-wordai-settings-text-hints {
  background: transparent;
  box-shadow: none;
}


/* ------------------------------------------------------------
   1️⃣2️⃣ SECTION DIVIDERS (visual grouping)
   ------------------------------------------------------------ */
.wordai-section-divider {
  position: relative;
  text-align: left;
  margin: 25px 0 15px;
  padding-bottom: 4px;
  font-weight: 700;
  font-family: 'Merienda', sans-serif;
  color: #2271b1;
  animation: fadeSlideIn 0.6s ease both;
}
.wordai-section-divider::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: linear-gradient(to right, #2271b1 0%, transparent 80%);
  margin-top: 6px;
}
body.is-dark-theme .wordai-section-divider { color: #3398db; }
body.is-dark-theme .wordai-section-divider::after {
  background: linear-gradient(to right, #3398db 0%, transparent 80%);
}
.wordai-section-divider {
  margin-top: 35px;
}
.wordai-section-divider:first-of-type {
  margin-top: 10px; /* tighter on first section */
}

/* ============================================================
   💬 Global WordAI jQuery Dialog Styling – Final Contrast-Fixed
   ============================================================ */

.ui-dialog.sc-wordai-dialog-reset,
.ui-dialog.sc-wordai-dialog,
.ui-dialog {
	border: none;
	border-radius: 8px;
	box-shadow: 0 12px 28px rgba(0,0,0,0.25);
	overflow: hidden;
	font-family: "Merienda", Arial, sans-serif;
}

/* Titlebar */
.ui-dialog .ui-dialog-titlebar {
	background: linear-gradient(90deg, #0073aa, #005177);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	padding: 10px 15px;
	border: none;
}
.ui-dialog .ui-dialog-titlebar-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 16px;
	opacity: 0.8;
}
.ui-dialog .ui-dialog-titlebar-close:hover {
	opacity: 1;
}

/* Content */
.ui-dialog .ui-dialog-content {
	padding: 18px 20px;
	background: #fff;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.6em;
}

/* Buttons Area */
.ui-dialog .ui-dialog-buttonpane {
	background: #f6f7f7;
	border-top: 1px solid #ccd0d4;
	padding: 10px 15px;
	text-align: right;
}
.ui-dialog .ui-dialog-buttonpane button {
	border-radius: 5px;
	padding: 7px 18px;
	font-weight: 600;
	border: none;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0,0,0,0.1);
	transition: all 0.25s ease;
}

/* ✅ Primary (Yes, Reset) — vivid blue with white text */
.ui-dialog .ui-dialog-buttonpane button:first-child {
	background: linear-gradient(180deg, #0073aa 0%, #005f8a 100%);
	color: #ffffff;                    /* Bright white text */
	text-shadow: 0 1px 2px rgba(0,0,0,0.25); /* Adds clarity on grayish screens */
}
.ui-dialog .ui-dialog-buttonpane button:first-child:hover {
	background: linear-gradient(180deg, #00639a 0%, #004d78 100%);
	color: #ffffff;
	box-shadow: 0 3px 6px rgba(0,0,0,0.25);
	transform: translateY(-1px);
}

/* ⚪ Secondary (Cancel) */
.ui-dialog .ui-dialog-buttonpane button:last-child {
	background-color: #e2e4e7;
	color: #1d2327;
	border: 1px solid #ccd0d4;
}
.ui-dialog .ui-dialog-buttonpane button:last-child:hover {
	background-color: #d7d9dc;
	color: #000;
}

/* Dark Mode */
body.is-dark-theme .ui-dialog .ui-dialog-titlebar {
	background: linear-gradient(90deg, #3398db, #1a5d8f);
}
body.is-dark-theme .ui-dialog .ui-dialog-content {
	background: #22272b;
	color: #e0e0e0;
}
body.is-dark-theme .ui-dialog .ui-dialog-buttonpane {
	background: #2c3338;
	border-top: 1px solid #444;
}
body.is-dark-theme .ui-dialog .ui-dialog-buttonpane button:first-child {
	background: linear-gradient(180deg, #3398db 0%, #1a6fa8 100%);
	color: #ffffff;
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
body.is-dark-theme .ui-dialog .ui-dialog-buttonpane button:last-child {
	background-color: #3a4248;
	color: #e0e0e0;
}
/* Highlight dialog top border based on tone */
.ui-dialog.sc-wordai-dialog .ui-dialog-titlebar {
	border-top: 4px solid var(--sc-wordai-dialog-accent, #0073aa);
}
.ui-dialog.sc-wordai-dialog.warning .ui-dialog-titlebar {
	--sc-wordai-dialog-accent: #dba617;
}
.ui-dialog.sc-wordai-dialog.error .ui-dialog-titlebar {
	--sc-wordai-dialog-accent: #d63638;
}
.ui-dialog.sc-wordai-dialog.success .ui-dialog-titlebar {
	--sc-wordai-dialog-accent: #00a32a;
}
.ui-dialog.sc-wordai-dialog.warning .ui-dialog-titlebar {
	border-top: 4px solid #dba617;
}

/* ============================================================
   💎 WordAI Scoped Global Modal Styling
   Safe within .sc-wordai-global-dialog only
   ============================================================ */

/* ============================================================
   🎯 Modal Buttons + Select Uniform Sizing & Alignment
   ============================================================ */

/* Shared sizing for buttons and select */
.sc-wordai-global-dialog button.button,
.sc-wordai-global-dialog select#scwordai-suggested-titles-number {
	height: 50px;
	line-height: 48px;
	font-size: 15px;
	vertical-align: middle;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Select box aligned with button height and limited width */
.sc-wordai-global-dialog select#scwordai-suggested-titles-number {
	max-width: 100px;
	min-width: 80px;
	border-radius: 6px;
	border: 1px solid #ccd0d4;
	background-color: #fff;
	color: #1d2327;
	padding: 0 10px;
	cursor: pointer;
	transition: all 0.2s ease;
}
.sc-wordai-global-dialog select#scwordai-suggested-titles-number:hover,
.sc-wordai-global-dialog select#scwordai-suggested-titles-number:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px rgba(34,113,177,0.25);
	outline: none;
}

/* Buttons next to selects */
.sc-wordai-global-dialog button.button + select#scwordai-suggested-titles-number,
.sc-wordai-global-dialog select#scwordai-suggested-titles-number + button.button {
	margin-left: 10px;
}

/* Vertically centered button icons */
.sc-wordai-global-dialog button.button i,
.sc-wordai-global-dialog button.button svg {
	font-size: 17px;
	margin-right: 6px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transform: translateY(1px); /* subtle optical balance */
}

/* Prevent text shifting if no icon */
.sc-wordai-global-dialog button.button span {
	display: inline-flex;
	align-items: center;
}

/* Optional subtle press-down effect */
.sc-wordai-global-dialog button.button:active {
	transform: translateY(1px);
}

/* Prevent conflicts — only style our dialogs */
.ui-dialog.sc-wordai-global-dialog {
	border: none;
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(0,0,0,0.25);
	overflow: hidden;
	font-family: "Merienda", Arial, sans-serif;
}

/* Titlebar */
.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar {
	background: linear-gradient(135deg, #0073aa 0%, #2296e3 100%);
	color: #fff !important;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 48px 0 16px;
	min-height: 52px;
	border: none !important;
	border-radius: 8px 8px 0 0;
	box-sizing: border-box;
}

/* Title text + icon */
.ui-dialog.sc-wordai-global-dialog .ui-dialog-title {
	display: flex;
	align-items: center;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.3;
	color: #fff;
	margin: 0;
  padding: 2px;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-title i,
.ui-dialog.sc-wordai-global-dialog .ui-dialog-title svg {
	margin-right: 8px;
	font-size: 18px;
	color: #fff;
}

/* Close button */
.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar-close {
	position: absolute !important;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent !important;
	border: none !important;
	color: #fff !important;
	font-weight: 900 !important;
	font-size: 22px !important;
	width: 32px;
	height: 32px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	line-height: 1;
	cursor: pointer;
	z-index: 100000;
	opacity: 1 !important;
	transition: all 0.25s ease-in-out;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar-close::before {
	content: "✕";
	display: inline-block;
	color: inherit;
	font-weight: 800;
	font-size: 22px;
	line-height: 1;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar-close span.ui-icon {
	width: 18px;
  height: 18px;
  top: 70%;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar-close:hover {
	transform: translateY(-50%) scale(1.1);
	text-shadow: 0 0 8px rgba(255,255,255,0.85);
}

/* Content area */
.ui-dialog.sc-wordai-global-dialog .ui-dialog-content {
	padding: 20px 24px;
	background: #fff;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.6em;
	overflow-y: auto;
	max-height: 75vh;
}

/* Button pane */
.ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane {
	background: #f6f7f7;
	border-top: 1px solid #ccd0d4;
	padding: 10px 15px;
	text-align: right;
}

/* Buttons inside dialog */
.ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button {
	border-radius: 5px;
	padding: 8px 18px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.25s ease;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button:first-child {
	background: linear-gradient(135deg, #0073aa 0%, #005f8a 100%);
	color: #fff;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button:first-child:hover {
	background: linear-gradient(135deg, #00639a 0%, #004d78 100%);
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button:last-child {
	background: #e2e4e7;
	color: #1d2327;
	border: 1px solid #ccd0d4;
}
.ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button:last-child:hover {
	background: #d7d9dc;
	color: #000;
}

/* Dark mode adaptation */
body.is-dark-theme .ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar {
	background: linear-gradient(135deg, #3398db 0%, #1a5d8f 100%);
}
body.is-dark-theme .ui-dialog.sc-wordai-global-dialog .ui-dialog-content {
	background: #22272b;
	color: #e0e0e0;
}
body.is-dark-theme .ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane {
	background: #2c3338;
	border-top: 1px solid #444;
}
body.is-dark-theme .ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button:first-child {
	background: linear-gradient(135deg, #3398db 0%, #1a6fa8 100%);
	color: #fff;
}
body.is-dark-theme .ui-dialog.sc-wordai-global-dialog .ui-dialog-buttonpane button:last-child {
	background-color: #3a4248;
	color: #e0e0e0;
}

/* Responsive */
@media (max-width: 600px) {
	.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar {
		font-size: 15px;
		padding: 0 40px 0 12px;
		min-height: 46px;
	}
	.ui-dialog.sc-wordai-global-dialog .ui-dialog-titlebar-close {
		right: 10px;
		font-size: 20px !important;
	}
}

/* ============================================================
   💎 WordAI Global Buttons — Primary & Secondary Enhancements
   ============================================================ */

/* 🔵 Shared button base for perfect alignment */
button.button-primary,
button.button-secondary,
.sc-wordai-global-dialog .button-primary,
.sc-wordai-global-dialog .button-secondary {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	height: 48px;
	line-height: 1 !important;
	padding: 0 22px !important;
	font-size: 15px !important;
	font-weight: 600;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	box-sizing: border-box;
	transition: all 0.25s ease;
}

/* Uniform icon styling inside buttons */
button.button-primary i,
button.button-secondary i,
.sc-wordai-global-dialog .button-primary i,
.sc-wordai-global-dialog .button-secondary i {
	font-size: 16px;
	margin-right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* ============================================================
   🔵 Primary Buttons (Save / Generate / Apply / Confirm / Update)
   ============================================================ */

@keyframes wordaiGlowPulse {
	0% {
		box-shadow: 0 0 6px rgba(34, 113, 177, 0.2),
		            0 0 12px rgba(34, 113, 177, 0.15);
	}
	50% {
		box-shadow: 0 0 10px rgba(34, 113, 177, 0.45),
		            0 0 20px rgba(34, 113, 177, 0.35);
	}
	100% {
		box-shadow: 0 0 6px rgba(34, 113, 177, 0.2),
		            0 0 12px rgba(34, 113, 177, 0.15);
	}
}

button.button-primary,
button.button-primary.save-license-key-btn,
button.button-primary.save-wordai-settings-btn,
button.button-primary.generate-wordai-content-btn,
button.button-primary.apply-wordai-settings-btn,
button.button-primary.confirm-wordai-action-btn,
button.button-primary.update-wordai-btn,
.sc-wordai-global-dialog .button-primary {
	background: linear-gradient(135deg, #0073aa 0%, #2296e3 100%);
	color: #fff;
	border: none;
	box-shadow: 0 4px 10px rgba(0, 115, 170, 0.25);
}

button.button-primary:hover,
button.button-primary.save-license-key-btn:hover,
button.button-primary.save-wordai-settings-btn:hover,
button.button-primary.generate-wordai-content-btn:hover,
button.button-primary.apply-wordai-settings-btn:hover,
button.button-primary.confirm-wordai-action-btn:hover,
button.button-primary.update-wordai-btn:hover,
.sc-wordai-global-dialog .button-primary:hover {
	background: linear-gradient(135deg, #2296e3 0%, #0073aa 100%);
	animation: wordaiGlowPulse 1.5s ease-in-out infinite;
	transform: translateY(-1px);
}

button.button-primary:active,
.sc-wordai-global-dialog .button-primary:active {
	transform: translateY(1px);
	animation: none;
	box-shadow: 0 2px 6px rgba(0, 115, 170, 0.25);
}

/* Dark mode adaptation */
body.is-dark-theme button.button-primary,
body.is-dark-theme .sc-wordai-global-dialog .button-primary {
	background: linear-gradient(135deg, #3398db 0%, #1a6fa8 100%);
	color: #ffffff;
}
body.is-dark-theme button.button-primary:hover,
body.is-dark-theme .sc-wordai-global-dialog .button-primary:hover {
	animation: wordaiGlowPulse 1.5s ease-in-out infinite;
	box-shadow: 0 0 12px rgba(51, 152, 219, 0.6);
}


/* ============================================================
   ⚪ Secondary Buttons (Cancel / Close / Dismiss)
   ============================================================ */

@keyframes wordaiGrayGlow {
	0% {
		box-shadow: 0 0 4px rgba(200, 200, 200, 0.2),
		            0 0 8px rgba(200, 200, 200, 0.15);
	}
	50% {
		box-shadow: 0 0 8px rgba(200, 200, 200, 0.35),
		            0 0 14px rgba(180, 180, 180, 0.25);
	}
	100% {
		box-shadow: 0 0 4px rgba(200, 200, 200, 0.2),
		            0 0 8px rgba(200, 200, 200, 0.15);
	}
}

button.button-secondary,
.sc-wordai-global-dialog .button-secondary,
button.button.cancel-wordai-btn,
button.button.close-wordai-btn,
button.button.dismiss-wordai-btn {
	background: linear-gradient(135deg, #f6f7f7 0%, #e2e4e7 100%);
	color: #1d2327;
	border: 1px solid #ccd0d4;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

button.button-secondary:hover,
.sc-wordai-global-dialog .button-secondary:hover,
button.button.cancel-wordai-btn:hover,
button.button.close-wordai-btn:hover,
button.button.dismiss-wordai-btn:hover {
	background: linear-gradient(135deg, #ffffff 0%, #e5e9ee 100%);
	animation: wordaiGrayGlow 1.8s ease-in-out infinite;
	transform: translateY(-1px);
}

button.button-secondary:active,
.sc-wordai-global-dialog .button-secondary:active {
	transform: translateY(1px);
	animation: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Dark mode for secondary buttons */
body.is-dark-theme button.button-secondary,
body.is-dark-theme .sc-wordai-global-dialog .button-secondary {
	background: linear-gradient(135deg, #3a4248 0%, #2c3338 100%);
	color: #e0e0e0;
	border: 1px solid #444;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
body.is-dark-theme button.button-secondary:hover,
body.is-dark-theme .sc-wordai-global-dialog .button-secondary:hover {
	background: linear-gradient(135deg, #434b52 0%, #3a4248 100%);
	animation: wordaiGrayGlow 1.8s ease-in-out infinite;
	box-shadow: 0 0 10px rgba(200, 200, 200, 0.25);
}
/* ============================================================
   ⚙️ Respect Inline Display Rules for Dynamic Show/Hide Buttons
   ============================================================ */

/* Ensure inline display:none or jQuery .hide() always takes effect */
button[style*="display: none"],
button[style*="display:none"],
.sc-wordai-global-dialog button[style*="display: none"],
.sc-wordai-global-dialog button[style*="display:none"],
button.hidden,
.sc-wordai-global-dialog button.hidden {
	display: none !important;
	visibility: hidden !important;
}

/* Allow jQuery .show() / fadeIn() to work naturally */
button:not([style*="display: none"]):not([style*="display:none"]),
.sc-wordai-global-dialog button:not([style*="display: none"]):not([style*="display:none"]) {
	visibility: visible;
}


/* =======================================================
   WordAI SEO MetaBox – Professional Guided Editor Styling
   ======================================================= */

/* Base Wrapper */
.wordai-seo-metabox-wrapper {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 6px;
	margin: 12px 0 18px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.wordai-seo-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
	padding: 10px 12px;
	cursor: pointer;
}
.wordai-seo-header strong {
	font-size: 14px;
	color: #1d2327;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
}
.wordai-seo-header .dashicons-chart-line {
	color: #2271b1;
	font-size: 18px;
	margin-right: 3px;
}
.wordai-seo-header .toggle-seo-panel {
	background: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	transition: transform 0.25s ease;
}
.wordai-seo-header .toggle-seo-panel[aria-expanded="false"] .dashicons-arrow-up-alt2 {
	transform: rotate(180deg);
}

/* Accordion Body */
.wordai-seo-body {
	padding: 14px 16px;
	animation: fadeIn 0.3s ease;
}
.wordai-seo-body.hidden { display: none; }

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Field Blocks */
.wordai-seo-field {
	margin-bottom: 16px;
	position: relative;
}
.wordai-seo-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
	color: #1d2327;
	font-size: 13px;
}
.wordai-seo-field textarea,
.wordai-seo-field input[type="text"],
.wordai-seo-field input[type="url"],
.wordai-seo-field select {
	width: 100%;
	padding: 7px 8px;
	font-size: 13px;
	border: 1px solid #d0d1d3;
	border-radius: 4px;
	background: #fff;
	box-shadow: inset 0 1px 1px rgba(0,0,0,0.03);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wordai-seo-field input:focus,
.wordai-seo-field textarea:focus,
.wordai-seo-field select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}
.wordai-seo-field input::placeholder,
.wordai-seo-field textarea::placeholder {
	color: #a0a5aa;
}

/* Tooltip Hint */
.wordai-seo-hint {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 4px;
	background: #f0f6fc;
	border: 1px solid #cce3f0;
	color: #0a4b78;
	font-size: 12px;
	padding: 6px 8px;
	border-radius: 4px;
	line-height: 1.4;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	display: none;
	z-index: 99;
	width: calc(100% - 4px);
}
.wordai-seo-field:focus-within .wordai-seo-hint {
	display: block;
	animation: fadeIn 0.2s ease;
}

/* Checkbox */
.wordai-seo-checkbox {
	margin: 10px 0 8px;
	display: flex;
	align-items: center;
}
.wordai-seo-checkbox label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
}
.wordai-seo-checkbox input[type="checkbox"] {
	accent-color: #2271b1;
	width: 16px;
	height: 16px;
	cursor: pointer;
}

/* Status Message */
.wordai-seo-meta-tags-status-msg {
	font-size: 12.5px;
	margin-top: 10px;
	padding-top: 4px;
	border-top: 1px solid #eee;
	color: #2b6a24;
	line-height: 1.5;
}
.alert-success { color: #1a7f37; font-weight: 500; }
.alert-error { color: #b52727; font-weight: 500; }

/* Responsive */
@media (max-width: 782px) {
	.wordai-seo-header strong { font-size: 13px; }
	.wordai-seo-body { padding: 12px; }
	.wordai-seo-field textarea,
	.wordai-seo-field input,
	.wordai-seo-field select { font-size: 12.5px; }
}

/* Character Counter & Rating */
.wordai-seo-counter {
	margin-top: 5px;
	font-size: 12px;
	color: #1d2327;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wordai-seo-badge {
	display: inline-flex;
	align-items: center;
	padding: 1px 6px;
	border-radius: 4px;
	font-size: 11.5px;
	font-weight: 600;
	margin-left: 8px;
}

/* Rating Colors */
.wordai-seo-badge.good {
	background-color: #e5f5e9;
	color: #1a7f37;
	border: 1px solid #a8e0b5;
}

.wordai-seo-badge.warning {
	background-color: #fff5e5;
	color: #b86d00;
	border: 1px solid #f2d68f;
}

.wordai-seo-badge.bad {
	background-color: #fdeaea;
	color: #b52727;
	border: 1px solid #f2b4b4;
}

/* =========================================
   Google Search Preview Styling
   ========================================= */
.wordai-seo-serp-preview {
	margin-top: 18px;
	padding-top: 10px;
	border-top: 1px solid #e2e4e7;
}

.wordai-seo-serp-preview h4 {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 5px;
}

.serp-preview-box {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 12px 14px;
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.serp-title {
	color: #1a0dab;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	margin-bottom: 3px;
	word-break: break-word;
}

.serp-url {
	color: #006621;
	font-size: 13px;
	margin-bottom: 4px;
	word-break: break-all;
}

.serp-description {
	color: #545454;
	font-size: 13px;
	line-height: 1.4;
	word-break: break-word;
}

/* When over limit — highlight for warning */
.serp-overlimit .serp-title,
.serp-overlimit .serp-description {
	color: #b52727 !important;
}

/* Responsive */
@media (max-width: 782px) {
	.serp-preview-box {
		padding: 10px;
	}
	.serp-title { font-size: 14px; }
	.serp-description { font-size: 12.5px; }
}
/* =========================================
   SERP Preview – View Toggle + Responsive
   ========================================= */
.serp-view-toggle {
	display: flex;
	justify-content: space-around;
	gap: 6px;
	margin-bottom: 6px;
}

.serp-view-toggle button {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	color: #1d2327;
	font-size: 12.5px;
	padding: 3px 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	transition: all 0.2s ease;
}

.serp-view-toggle button.active {
	background: #2271b1;
	color: #fff;
	border-color: #1b4b7d;
	box-shadow: 0 0 0 1px #2271b1;
}

/* Mobile SERP Simulation */
.serp-preview-box.mobile-view {
	max-width: 360px;
	margin: 0 auto;
	border: 1px solid #d0d1d3;
	border-radius: 10px;
	padding: 10px;
	box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

.serp-preview-box.mobile-view .serp-title {
	font-size: 14px;
	line-height: 1.4;
}
.serp-preview-box.mobile-view .serp-url {
	font-size: 12.5px;
}
.serp-preview-box.mobile-view .serp-description {
	font-size: 12.5px;
}

/* Adjust right padding for selects near edges */
.wordai-seo-field select,
.wordai-seo-field input,
.wordai-seo-field textarea {
	box-sizing: border-box;
	width: calc(100% - 2px);
}

/* Smooth color fade for preview updates */
.serp-preview-box {
	transition: background 0.2s ease, color 0.2s ease;
}
.wordai-seo-meta-tags-status-msg {
	margin-top: 6px;
	font-size: 13px;
}
.wordai-seo-meta-tags-status-msg .alert-success {
	color: #007cba;
	font-weight: 500;
}
.wordai-seo-meta-tags-status-msg .alert-error {
	color: #d63638;
	font-weight: 500;
}
.wordai-seo-status-notice {
	margin-top: 10px;
}

.wordai-seo-status-notice.notice-success {
	border-left-color: #46b450 !important;
}

.wordai-seo-status-notice.notice-info {
	border-left-color: #2271b1 !important;
}

/* ===== WordAI SEO Rank Styles ===== */

.wordai-seo-field-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 5px;
}

.wordai-seo-rank-circle {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #dcdcde;
	color: #1d2327;
	font-size: 10px;
	font-weight: 600;
	transition: all 0.25s ease-in-out;
}

.wordai-seo-rank-circle.good {
	background: #00a32a;
	color: #fff;
}

.wordai-seo-rank-circle.average {
	background: #ffb900;
	color: #222;
}

.wordai-seo-rank-circle.poor {
	background: #d63638;
	color: #fff;
}

.wordai-seo-char-counter {
	font-size: 11px;
	color: #50575e;
	text-align: right;
	margin-top: 2px;
}

/* Hover and focus consistency */
.wordai-seo-field textarea,
.wordai-seo-field input,
.wordai-seo-field select {
	width: 100%;
	border-radius: 4px;
	border: 1px solid #ccd0d4;
	padding: 6px 8px;
	box-sizing: border-box;
}

.wordai-seo-field textarea:focus,
.wordai-seo-field input:focus,
.wordai-seo-field select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

/* Header and accordion toggle */
.wordai-seo-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	background: #f6f7f7;
	border-bottom: 1px solid #ccd0d4;
	border-radius: 4px 4px 0 0;
}

.wordai-seo-body {
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-top: none;
	border-radius: 0 0 4px 4px;
}

/* SEO toggle accordion */
.toggle-seo-panel {
	background: none;
	border: none;
	cursor: pointer;
	color: #50575e;
}
/* ============================================================
   🌗 WordAI SEO Metabox – Dark Mode Enhancements
   Improves readability, contrast, and animations in dark theme.
   Safe to append at the end of stylesheet.
   ============================================================ */

/* Pulse animation for rank circles */
@keyframes wordaiPulse {
	0%   { transform: scale(1); box-shadow: 0 0 0 rgba(34,113,177,0); }
	50%  { transform: scale(1.1); box-shadow: 0 0 10px rgba(34,113,177,0.35); }
	100% { transform: scale(1); box-shadow: 0 0 0 rgba(34,113,177,0); }
}
.wordai-seo-rank-circle.pulse {
	animation: wordaiPulse 0.6s ease;
}

/* Flash animation when SERP updates */
@keyframes wordaiFlash {
	0%   { background-color: rgba(34,113,177,0.15); }
	50%  { background-color: rgba(34,113,177,0.25); }
	100% { background-color: transparent; }
}
.flash {
	animation: wordaiFlash 0.8s ease;
}

/* Character counter state colors */
.wordai-seo-char-counter.good span.current { color: #1a7f37; font-weight: 600; }
.wordai-seo-char-counter.warning span.current { color: #b86d00; font-weight: 600; }
.wordai-seo-char-counter.danger span.current { color: #b52727; font-weight: 600; }

/* Dark Mode Overrides */
body.is-dark-theme .wordai-seo-metabox-wrapper {
	background: #1e1f21;
	border-color: #3a3b3d;
	box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
body.is-dark-theme .wordai-seo-header {
	background: #2a2d30;
	border-bottom-color: #444;
}
body.is-dark-theme .wordai-seo-field label {
	color: #e0e0e0;
}
body.is-dark-theme .wordai-seo-field textarea,
body.is-dark-theme .wordai-seo-field input,
body.is-dark-theme .wordai-seo-field select {
	background: #2a2d30;
	border-color: #444;
	color: #e0e0e0;
}
body.is-dark-theme .wordai-seo-field textarea:focus,
body.is-dark-theme .wordai-seo-field input:focus,
body.is-dark-theme .wordai-seo-field select:focus {
	border-color: #3398db;
	box-shadow: 0 0 0 1px #3398db;
}

/* SERP Preview Box */
body.is-dark-theme .serp-preview-box {
	background: #181a1c;
	border-color: #333;
	box-shadow: inset 0 0 6px rgba(0,0,0,0.4);
}
body.is-dark-theme .serp-title {
	color: #79b8ff;
}
body.is-dark-theme .serp-url {
	color: #30c08e;
}
body.is-dark-theme .serp-description {
	color: #bdbdbd;
}

/* SERP Overlimit Warning (Dark Mode) */
body.is-dark-theme .serp-overlimit .serp-title,
body.is-dark-theme .serp-overlimit .serp-description {
	color: #ff7676 !important;
}

/* Rank Circles */
body.is-dark-theme .wordai-seo-rank-circle {
	background: #3b3d41;
	color: #e0e0e0;
}
body.is-dark-theme .wordai-seo-rank-circle.good {
	background: #00b65c;
	color: #fff;
	box-shadow: 0 0 6px rgba(0,255,128,0.4);
}
body.is-dark-theme .wordai-seo-rank-circle.average {
	background: #ffb900;
	color: #222;
	box-shadow: 0 0 6px rgba(255,185,0,0.4);
}
body.is-dark-theme .wordai-seo-rank-circle.poor {
	background: #d63638;
	color: #fff;
	box-shadow: 0 0 6px rgba(214,54,56,0.4);
}

/* SERP View Toggle Buttons */
body.is-dark-theme .serp-view-toggle button {
	background: #2c2f34;
	color: #e0e0e0;
	border-color: #444;
}
body.is-dark-theme .serp-view-toggle button.active {
	background: #3398db;
	color: #fff;
	border-color: #1a5d8f;
	box-shadow: 0 0 6px rgba(51,152,219,0.6);
}

/* Checkbox + Status */
body.is-dark-theme .wordai-seo-checkbox label {
	color: #e0e0e0;
}
body.is-dark-theme .wordai-seo-meta-tags-status-msg {
	color: #b5e1ff;
}
body.is-dark-theme .alert-success {
	color: #5cff9d;
}
body.is-dark-theme .alert-error {
	color: #ff7676;
}
/* ============================================================
   🎯 WordAI SEO Rank Circle Alignment (next to labels)
   ============================================================ */

/* Container for label + badge */
.wordai-seo-field-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

/* Label styling */
.wordai-seo-field-top label {
	font-weight: 600;
	font-size: 14px;
	color: #1d2327;
	display: flex;
	align-items: center;
}

/* Rank circle aligned to right of label */
.wordai-seo-rank-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	margin-left: 10px;
	border-radius: 50%;
	font-size: 10px;
	font-weight: 600;
	background: #f3f4f6;
	color: #333;
	border: 2px solid #ccc;
	transition: all 0.25s ease;
}

/* Status colors */
.wordai-seo-rank-circle.good {
	background: #00b65c;
	color: #fff;
	border-color: #009c50;
	box-shadow: 0 0 6px rgba(0, 255, 128, 0.4);
}
.wordai-seo-rank-circle.average {
	background: #ffb900;
	color: #222;
	border-color: #d49a00;
	box-shadow: 0 0 6px rgba(255, 185, 0, 0.4);
}
.wordai-seo-rank-circle.poor {
	background: #d63638;
	color: #fff;
	border-color: #b11d1f;
	box-shadow: 0 0 6px rgba(214, 54, 56, 0.4);
}

/* Hover glow */
.wordai-seo-rank-circle:hover {
	transform: scale(1.08);
}

/* Counter placement below field (balanced spacing) */
.wordai-seo-char-counter {
	margin-top: 4px;
	margin-bottom: 4px;
	font-size: 12px;
	color: #666;
}

/* Dark mode adjustments */
body.is-dark-theme .wordai-seo-field-top label {
	color: #ddd;
}
body.is-dark-theme .wordai-seo-rank-circle {
	background: #2d2f33;
	color: #e0e0e0;
	border-color: #444;
}
/* ============================================================
   📱 Mobile-Responsive Layout for SEO Rank Circles
   ============================================================ */

@media (max-width: 480px) {
	.wordai-seo-field-top {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.wordai-seo-field-top label {
		font-size: 13px;
		margin-bottom: 2px;
	}

	.wordai-seo-rank-circle {
		margin-left: 0;
		margin-top: 4px;
		align-self: flex-start;
		transform: none !important;
	}

	.wordai-seo-char-counter {
		font-size: 11px;
		color: #777;
	}
}


/* ============== WordAI Modal – Clean Reset ============== */
/* 1) Leave the original div hidden until jQuery UI opens it */
#metabox-button-click-dialog.sc-wordai-global-dialog {
  display: none;
}

/* 2) jQuery UI wrapper (NO extra inner window, minimal padding) */
.ui-dialog.metabox-button-click-popup-dialog-class {
  border: none !important;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: wordaiFadeIn 240ms ease-out;
  z-index: 100002 !important;
}

/* 3) Actual content area — keep padding modest to avoid “big padding” look */
.ui-dialog.metabox-button-click-popup-dialog-class .ui-dialog-content {
  padding: 18px 22px !important;
  max-height: 80vh;
  overflow-y: auto;
}

/* 4) Overlay (subtle dim) */
.ui-widget-overlay {
  background: rgba(0,0,0,0.24) !important;
}

/* 5) Fade-in keyframes */
@keyframes wordaiFadeIn {
  from { opacity: 0; transform: translateY(-10px) }
  to   { opacity: 1; transform: translateY(0) }
}

/* ============== WordAI Content Generation Modal Window - Checkbox “Pill” Look (keep native checkbox visible) ============== */
/* Layout: label already wraps: [input.checkbox][span.sc-wordai-items-label] */
.wordai-metabox-wrapper-table label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 8px 6px 0;
}

/* Keep native checkbox for clarity & accessibility */
.sc-wordai-content-generate-options {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #007cba; /* clear WP blue tick */
}

/* The pill */
.sc-wordai-items-label {
  line-height: 1;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d3d7dc;
  background: #f6f7f7;
  color: #1d2327;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
  user-select: none;
  cursor: pointer;
}

/* Hover */
label:hover .sc-wordai-items-label {
  background: #eaf4ff;
  border-color: #7cc1ea;
}

/* Checked state: style the pill via sibling selector */
.sc-wordai-content-generate-options:checked + .sc-wordai-items-label {
  background: #007cba;
  border-color: #007cba;
  color: #fff;
}

/* Group headings and inputs spacing tidy-up */
.wordai-prompt-hints-label,
.seo-feature-label { margin: 6px 0 4px; font-weight: 600; color: #1d2327; }
.scwordai-prompt { width: 100%; padding: 9px 11px; border: 1px solid #ccd0d4; border-radius: 6px; }
.wordai-metabox-wrapper-table { width: 100%; }
.wordai-metabox-wrapper-table td { padding: 8px 6px; vertical-align: top; }

/* ============== END WordAI Content Generation Modal – Clean Reset ============== */

/* =============== Start WordAI Options Grid =============== */
.wordai-options-grid {
	display: flex;
	gap: 16px;
	align-items: stretch;
	justify-content: space-between;
	flex-wrap: wrap;
	box-sizing: border-box;
	padding-right: 8px; /* avoid touching right border */
}

.wordai-card {
	flex: 1 1 calc(33.333% - 12px); /* evenly distributed, respects gap */
	min-width: 260px;                /* avoid squish on mid-size */
	background: #f9f9f9;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 16px 18px;
	box-sizing: border-box;          /* important! prevents width blowout */
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
	transition: box-shadow 0.25s ease;
}

/* Hover lift */
.wordai-card:hover {
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.wordai-card-header {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 10px;
	padding-left: 8px;
	border-left: 3px solid #007cba;
	color: #1d2327;
}

.wordai-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
}

.wordai-checkbox-group label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

/* Compact secondary buttons inside generated content sections */
.button.button-secondary.small-btn {
	font-size: 12px;
	padding: 2px 10px;
	height: auto;
	line-height: 1.5;
}

.scwordai-title button.button-secondary,
.scwordai-content button.button-secondary,
.scwordai-excerpt button.button-secondary,
.scwordai-tags button.button-secondary,
.scwordai-seo-title button.button-secondary,
.scwordai-seo-meta-description button.button-secondary,
.scwordai-seo-meta-focus-keyword button.button-secondary,
.scwordai-image button.button-secondary {
	font-size: 12px;
	padding: 2px 10px;
	margin-right: 6px;
	margin-top: 4px;
}


/* Responsive breakpoints */
@media (max-width: 1280px) {
	.wordai-card { flex: 1 1 calc(50% - 10px); }
}
@media (max-width: 760px) {
	.wordai-card { flex: 1 1 100%; }
}

/* Fade-in animation for generated result sections */
/* Smooth fade-in for dynamically shown result sections (auto-detect display change) */
.wordai-generated-block {
	display: none;                 /* default hidden state */
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

/* When shown (via jQuery .show()), fade-in automatically */
.wordai-generated-block[style*="display: block"],
.wordai-generated-block[style*="display: inline-block"],
.wordai-generated-block[style*="display: flex"],
.wordai-generated-block[style*="display: grid"] {
	opacity: 1 !important;
	transform: translateY(0);
}

/* Slight delay between multiple blocks appearing for smooth sequence */
.wordai-generated-block + .wordai-generated-block {
	transition-delay: 0.05s;
}


/* Small buttons */
.small-btn {
	font-size: 12px !important;
	padding: 2px 10px !important;
	line-height: 1.5;
	height: auto !important;
}

/* =============== END WordAI Options Grid =============== */

/* ========== 1) Prompt / Actions spacing ========== */
.wordai-prompt-section input.scwordai-prompt {
  margin-bottom: 12px; /* adds breathing space before buttons */
}
.wordai-actions-row {
  gap: 10px;
  margin-top: 6px; /* ensures no edge-touching with input */
}
.wordai-actions-row .button {
  min-width: 120px;
}

/* ========== 2) Options Grid: 3 cards inline, responsive ========== */
.wordai-options-grid {
  display: flex;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: nowrap;            /* keep 3 in a single line when space allows */
  margin-top: 10px;
}

.wordai-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

/* headings + vertical list inside cards */
.wordai-card-header {
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
  padding-left: 8px; border-left: 3px solid #007cba; color: #1d2327;
}
.wordai-checkbox-group { display: flex; flex-direction: column; gap: 6px; }

/* Wrap gracefully on narrower widths */
@media (max-width: 1280px) {
  .wordai-options-grid { flex-wrap: wrap; }
  .wordai-card { flex: 0 0 calc(50% - 8px); } /* 2 columns */
}
@media (max-width: 760px) {
  .wordai-card { flex: 0 0 100%; }            /* 1 column */
}

/* ========== 3) Modal vertical scrolling only (no horizontal) ========== */
/* Ensure the dialog content is the scroll container, vertical only */
.ui-dialog.metabox-button-click-popup-dialog-class .ui-dialog-content {
  max-height: 80vh;               /* keeps it within viewport */
  overflow-y: auto;               /* vertical scroll when results grow */
  overflow-x: hidden;             /* prevent horizontal scroll */
}

/* Make internal blocks behave nicely within width */
#metabox-button-click-dialog.sc-wordai-global-dialog,
#metabox-button-click-dialog .wordai-metabox-wrapper-table {
  width: 100%;
}
#metabox-button-click-dialog textarea,
#metabox-button-click-dialog input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Optional: modern scrollbar for WebKit (vertical only) */
.ui-dialog.metabox-button-click-popup-dialog-class .ui-dialog-content::-webkit-scrollbar {
  width: 10px;
}
.ui-dialog.metabox-button-click-popup-dialog-class .ui-dialog-content::-webkit-scrollbar-thumb {
  background-color: #c7ccd1;
  border-radius: 10px;
}

/* Keep the dialog pinned left (no right-sidebar overlap, no big left gap) */
.ui-dialog.metabox-button-click-popup-dialog-class {
  left: 20px !important;
  right: auto !important;
  transform: none !important;
}

/* Small result buttons (copy/insert) – already used */
.button.button-secondary.small-btn {
  font-size: 12px !important;
  padding: 2px 10px !important;
  line-height: 1.5;
  height: auto !important;
}

/* =============== END WordAI Modal =============== */


/* ===========================
   Sticky Subheader – Optimized (No Flicker)
   =========================== */

/* Base sticky container */
.wordai-options-grid {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #f8f9fa;
  padding: 10px 0;
  border-bottom: 1px solid #e2e4e7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

  /* ✅ No transition or GPU transform (these cause flicker in growing modals) */
  transition: none !important;
  transform: none !important;
  backface-visibility: hidden;
  will-change: auto;
}

/* Individual cards inside sticky area */
.wordai-card {
  background: #ffffff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: none !important; /* ✅ disable per-frame box-shadow transitions */
}

/* Sticky active compression (visual polish only) */
.wordai-options-grid.is-stuck {
  background-color: #f5f6f8;
  padding: 6px 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* Subtle compression for each card */
.wordai-options-grid.is-stuck .wordai-card {
  padding: 10px 14px;
}

/* Title style */
.wordai-card-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid #007cba;
  color: #1d2327;
}

/* No animation during height growth */
@keyframes wordaiStickyFade {}

/* Responsive safeguard */
@media (max-width: 760px) {
  .wordai-options-grid {
    position: static;
    box-shadow: none;
    border-bottom: none;
  }
}

/* ================================================
   Modal Growth Stability – Containment & Isolation
   ================================================ */

/* Contain modal internal reflows so sticky area doesn’t jitter */
.ui-dialog.metabox-button-click-popup-dialog-class .ui-dialog-content {
  contain: layout paint;
  overflow-x: hidden;
  transform: none !important;
}

/* Prevent the dialog itself from animating height */
#metabox-button-click-dialog {
  transition: none !important;
}




/* Start Enaable Social Meta Box */
.wordai-seo-toggle {
	margin-top: 8px;
}
.wordai-seo-toggle label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}
.wordai-seo-toggle .description {
	display: block;
	margin-top: 4px;
	color: #646970;
}
/* End Enaable Social Meta Box */

/* ==============================================================
   WordAI API Content Generation – Horizontal Wave Loader
   Premium | Compact | Flowing Gradient | Dark Mode | Responsive
   ============================================================== */
.sc-wave {
  display: flex;
  flex-direction: row;          /* 👈 arrange bars horizontally */
  align-items: flex-end;        /* align bottoms of bars */
  justify-content: center;      /* center within table cell */
  gap: 4px;                     /* space between bars */
  margin: 10px auto;
  padding: 6px 0;
  opacity: 0.95;
  user-select: none;
}

/* --- Wave Bars --- */
.sc-wave .wave {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, #007cba, #00b3ee);
  background-size: 200% 200%;
  animation:
    scWavePulse 1.1s ease-in-out infinite,
    scGradientShift 2.8s linear infinite;
  transform-origin: center bottom;
  box-shadow: 0 0 4px rgba(0, 124, 186, 0.35);
}

/* Gradient animation (color flow illusion) */
@keyframes scGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pulse motion (vertical stretch) */
@keyframes scWavePulse {
  0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
  50%      { transform: scaleY(1.1); opacity: 1;   }
}

/* Staggered delays for wave rhythm */
.sc-wave .wave:nth-child(1)  { animation-delay: 0s, 0s; }
.sc-wave .wave:nth-child(2)  { animation-delay: 0.08s, 0.15s; }
.sc-wave .wave:nth-child(3)  { animation-delay: 0.16s, 0.3s; }
.sc-wave .wave:nth-child(4)  { animation-delay: 0.24s, 0.45s; }
.sc-wave .wave:nth-child(5)  { animation-delay: 0.32s, 0.6s; }
.sc-wave .wave:nth-child(6)  { animation-delay: 0.40s, 0.75s; }
.sc-wave .wave:nth-child(7)  { animation-delay: 0.48s, 0.9s; }
.sc-wave .wave:nth-child(8)  { animation-delay: 0.56s, 1.05s; }
.sc-wave .wave:nth-child(9)  { animation-delay: 0.64s, 1.2s; }
.sc-wave .wave:nth-child(10) { animation-delay: 0.72s, 1.35s; }

/* --- Label below the waves --- */
/* ==============================================================
   Centered "Generating…" Label with Soft Glow
   ============================================================== */
.sc-wave-label {
  display: block;
  width: 100%;
  text-align: center;             /* ⬅ centers text horizontally */
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #1d2327;
  opacity: 0.9;
  text-shadow: 0 0 6px rgba(0, 124, 186, 0.3); /* subtle glow */
  animation: scLabelGlow 2.2s ease-in-out infinite;
}

@keyframes scLabelGlow {
  0%, 100% {
    opacity: 0.75;
    text-shadow: 0 0 6px rgba(0, 124, 186, 0.3);
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 10px rgba(0, 124, 186, 0.6);
  }
}

/* Dark mode variant */
@media (prefers-color-scheme: dark) {
  .sc-wave-label {
    color: #f1f5f9;
    text-shadow: 0 0 8px rgba(0, 179, 255, 0.6);
  }
}

/* ==============================================================
   End WordAI API Content Generation – Horizontal Wave Loader
   Premium | Compact | Flowing Gradient | Dark Mode | Responsive
   ============================================================== */

   /* =============================================================
   🟡 WordAI — Spacing Polish - AI Agent Chat Settings Tab Page
   *  Spacing polish for radios/checkboxes
   ============================================================= */	
.wa-fieldset label { display:inline-flex; align-items:center; gap:6px; margin-right:16px; margin-bottom:8px; }
.wa-col-600 .regular-text, .wa-col-600 textarea { max-width:600px; width:100%; }
.wa-color-field { max-width:160px; }

/* ==========================================================
   AI Chat — Embedding Status Notices
   ========================================================== */
.wordai-embedding-warning,
.wordai-embedding-success {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 6px;
  line-height: 1.6;
  font-size: 14px;
  display: block;
}

.wordai-embedding-warning {
  background: #fff8e5;
  border: 1px solid #e2c045;
  color: #7a5c00;
}

.wordai-embedding-success {
  background: #e8f8ee;
  border: 1px solid #3bb26b;
  color: #1f5133;
}

.wordai-embedding-warning .dashicons,
.wordai-embedding-success .dashicons {
  vertical-align: middle;
  margin-right: 6px;
  font-size: 16px;
}

/* Subtle fade animation for polish */
.wordai-embedding-warning,
.wordai-embedding-success {
  animation: fadeSlideIn 0.35s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/** ==============================================================
 * AI Agent: Contents Embedding Tab. Helper: Progress Bar + Remaining Time
 * ============================================================== */
.wa-progress-bar {
  transition: width 0.4s ease-in-out;
  background-color: #2271b1; /* WP blue */
}
.wa-progress-label {
  font-weight: 600;
  color: #1d2327;
}
.wa-progress-eta {
  font-size: 13px;
  color: #50575e;
  margin-top: 4px;
  display: block;
}

/* ==================================================================
   🔧 WordAI Agent — Failed Items Modal Table Enhancements
   ------------------------------------------------------------------
   - Compact text size for dense data (hundreds of rows)
   - Consistent column spacing + horizontal scroll for long messages
   - Word-break handling for error messages
   ================================================================== */
#wa-failed-modal {
  font-size: 12px;
  color: #333;
}

#wa-failed-modal table.widefat {
  font-size: 12px;
  line-height: 1.4;
}

#wa-failed-modal th {
  background: #f6f7f7;
  font-weight: 600;
  text-align: left;
  padding: 6px 8px;
}

#wa-failed-modal td {
  padding: 5px 8px;
  vertical-align: top;
}

#wa-failed-modal td a {
  color: #0073aa;
  text-decoration: none;
}

#wa-failed-modal td a:hover {
  text-decoration: underline;
}

#wa-failed-modal .ui-dialog-titlebar {
  font-size: 13px;
  font-weight: 600;
}

#wa-failed-modal .ui-dialog-content {
  padding: 6px 8px !important;
}

#wa-failed-list td:nth-child(4) {
  white-space: normal;
  word-break: break-word;
  max-width: 350px;
}

/* Add light zebra and hover for readability */
#wa-failed-list tr:nth-child(even) {
  background: #fafafa;
}
#wa-failed-list tr:hover {
  background: #f1f5f9;
}

.sc-wordai-modal-default .ui-dialog-titlebar {
    background: #007cba;
    color: #fff;
    border: none;
}

.sc-wordai-modal-default .ui-dialog-buttonpane {
    border-top: 1px solid #ddd;
    padding-top: 10px;
}
.sc-wordai-admin-notice-missing-key {
    border-left: 5px solid #673ab7 !important;
    background: #f6f0ff !important;
}

.sc-wordai-admin-notice-missing-key .button-primary {
    background: #673ab7 !important;
    border-color: #562da0 !important;
    box-shadow: none !important;
}
/* =========================================================
   WORDAI ADMIN HEADER (Layout)
   ========================================================= */
.sc-wordai-admin-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 0 10px;
  border-bottom:1px solid #e5e5e5;
  margin-bottom:20px;
}

.sc-wordai-header-left{
  display:flex;
  align-items:center;
  gap:12px;
}

.sc-wordai-header-logo{
  width:48px;
  height:48px;
}

.sc-wordai-header-title{
  font-size:28px;
  font-weight:700;
  color:#333;
  letter-spacing:.5px;
}

.sc-wordai-header-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}

/* Responsive for small screens */
@media (max-width:700px){
  .sc-wordai-admin-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .sc-wordai-header-right{
    align-items:flex-start;
    margin-top:15px;
  }
}


/* =========================================================
   PROVIDER PICKER (Global - works everywhere)
   - Keep existing classes for backward compatibility
   - Use data-context to adjust layout per placement
   ========================================================= */
.sc-wordai-provider-picker{
  display:flex;
  flex-direction:column; /* default vertical (settings header style) */
  gap:6px;
}

.sc-wordai-provider-label{
  font-size:14px;
  font-weight:600;
  color:#444;
  margin:0;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.sc-wordai-select-wrapper{
  display:block;
}

.sc-wordai-provider-select{
  appearance:auto;
  padding:7px 10px;
  font-size:14px;
  line-height:1.2;
  min-width:180px;
  border-radius:8px;
  border:1px solid #c7c7c7;
  background:#fff;
  color:#1d2327;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* Focus = WP-like but nicer */
.sc-wordai-provider-select:focus{
  outline:none;
  border-color:#2271b1;
  box-shadow:0 0 0 2px rgba(34,113,177,.18);
}

/* Hover */
.sc-wordai-provider-select:hover{
  border-color:#a7a7a7;
}

/* Optgroup styling (browser-limited, still helps) */
.sc-wordai-provider-select optgroup{
  font-weight:700;
}


/* =========================================================
   CONTEXT OVERRIDES (same HTML, different look)
   Uses your existing data-context attribute
   ========================================================= */

/* Popup/modal: label + dropdown inline */
.sc-wordai-provider-picker .sc-wordai-ai-provider-select[data-context="suggest_title_popup"],
.sc-wordai-provider-picker .sc-wordai-ai-provider-select[data-context="content_popup"],
.sc-wordai-provider-picker .sc-wordai-ai-provider-select[data-context="popup"]{
  /* no direct styling needed here; parent handles layout below */
}

/* When selector is in popups, force horizontal/inline layout */
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="suggest_title_popup"]),
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="content_popup"]),
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="popup"]){
  flex-direction:row;
  align-items:center;
  gap:10px;
}

/* Make label compact in popups */
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="suggest_title_popup"]) .sc-wordai-provider-label,
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="content_popup"]) .sc-wordai-provider-label,
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="popup"]) .sc-wordai-provider-label{
  margin:0;
  white-space:nowrap;
  font-size:13px;
}

/* Slightly smaller select in popups */
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="suggest_title_popup"]) .sc-wordai-provider-select,
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="content_popup"]) .sc-wordai-provider-select,
.sc-wordai-provider-picker:has(.sc-wordai-ai-provider-select[data-context="popup"]) .sc-wordai-provider-select{
  min-width:200px;
  padding:6px 10px;
  border-radius:8px;
}


/* =========================================================
   POPUP PROVIDER BLOCK (your existing modal layout)
   - Keeps your 2-row structure stable
   ========================================================= */
.sc-wordai-popup-provider-block{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:10px;
}

.sc-wordai-popup-provider-row{
  display:flex;
  align-items:center;
}

.sc-wordai-popup-provider-row--right{
  justify-content:flex-end;
}

/* Keep picker compact */
.sc-wordai-popup-provider-row .sc-wordai-provider-picker{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
}

/* Provider switch message */
.sc-wordai-provider-switch-msg{
  display:none;
  text-align:right;
  font-size:12px;
  padding:6px 10px;
  border-radius:8px;
  line-height:1.35;
  box-sizing:border-box;
}

.sc-wordai-provider-switch-msg.is-success{
  background:#e7f7ed;
  border-left:4px solid #00a32a;
  color:#14532d;
}

.sc-wordai-provider-switch-msg.is-error{
  background:#fde8e8;
  border-left:4px solid #d63638;
  color:#7f1d1d;
}


/* =========================================================
   DISABLED STATE (provider lock)
   - Works with your existing class
   ========================================================= */
.sc-wordai-provider-picker--disabled{
  opacity:.65;
}

.sc-wordai-provider-picker--disabled .sc-wordai-provider-select{
  background:#f6f7f7;
  border-color:#dcdcde;
  color:#646970;
  cursor:not-allowed;
  box-shadow:none;
}

/* Cleaner disabled select appearance */
.sc-wordai-provider-picker select:disabled{
  opacity: .65;
  background-color: #f6f7f7;
  color: #50575e;
  cursor: not-allowed;
}

/* Reduce ugly arrow emphasis on disabled select (browser-dependent) */
.sc-wordai-provider-picker select:disabled{
  background-image: none !important;
}

/* Remove arrow indicator on disabled SEO selects in metabox */
.wordai-seo-field select:disabled,
.wordai-seo-metabox-wrapper select:disabled{
  background-image: none !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.sc-wordai-provider-picker--disabled .sc-wordai-provider-select:hover{
  border-color:#dcdcde; /* no hover change */
}
.sc-wordai-provider-picker--disabled{
  pointer-events: none;
}


/* =========================================================
   WRAP PANEL (kept as-is but slightly refined)
   ========================================================= */
.wrap{
  font-family:"Segoe UI","Roboto",sans-serif;
  color:#23282d;
  background:#fff;
  padding:20px;
  border:1px solid #e5e5e5;
  border-radius:10px;
  box-shadow:0 3px 8px rgba(0,0,0,.07);
}

.sc-wordai-api-key-missing-notice{
  padding:15px;
  display:flex;
  align-items:center;
  gap:15px;
  margin:10px 20px 0 2px;
}
.sc-wordai-notice-warning{
  background:#fff8e5;
  border:1px solid #e2c045;
  border-left:4px solid #dba617;
  box-shadow:0 1px 3px rgba(0,0,0,0.08);
  border-radius:6px;
}
.sc-wordai-inline-icon{
  margin-right:6px;
  vertical-align:middle;
  font-size:16px;
  line-height:1;
  display:inline-block;
}

/* =========================================================
   PRO LOCK BANNER + SOFT DISABLED LOOK
   ========================================================= */
.sc-wordai-pro-banner{
  background:#fff4cc;
  border:1px solid #f0d28a;
  border-radius:6px;
  padding:10px 12px;
  margin:10px 0 16px;
  display:flex;
  flex-direction:column;
  gap:4px;
  color:#5a3f00;
}
.sc-wordai-pro-banner strong{
  font-weight:700;
}
.sc-wordai-pro-locked .wordai-card,
.sc-wordai-pro-locked .wordai-options-grid,
.sc-wordai-pro-locked table,
.sc-wordai-pro-locked .card-actions,
.sc-wordai-pro-locked .wordai-card-header{
  opacity:0.85;
}
.sc-wordai-pro-locked input:disabled,
.sc-wordai-pro-locked select:disabled,
.sc-wordai-pro-locked textarea:disabled,
.sc-wordai-pro-locked button:disabled{
  opacity:0.85;
}

/* Keep AI Agent primary buttons looking active while disabled (Free) */
#openai-agent-settings-wrapper.sc-wordai-pro-locked .button.button-primary:disabled,
#openai-agent-settings-wrapper.sc-wordai-pro-locked .button.button-primary[disabled]{
  background-color:#2271b1 !important;
  border-color:#2271b1 !important;
  color:#fff !important;
  opacity:0.9;
  box-shadow:none !important;
}

#wordai-chat-settings-wrapper .wa-avatar-color-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
}
#wordai-chat-settings-wrapper .wa-avatar-color-row label{
  margin:0;
  min-width:120px;
}
#wordai-chat-settings-wrapper .wa-avatar-color-row .wp-picker-container,
#wordai-chat-settings-wrapper .wa-avatar-color-row #wa-chat-avatar-color{
  vertical-align:middle;
}

/* Keep color pickers visible but clearly disabled in Free mode */
.sc-wordai-pro-locked .wp-picker-container .wp-color-result,
.sc-wordai-pro-locked .wp-picker-container .wp-color-result-text,
.sc-wordai-pro-locked .wp-picker-container .wp-picker-input-wrap .button{
  opacity:0.75;
  pointer-events:none;
}

