/*--- spwai-styles.css ---*/
/* ==========================================================================
   BASE METABOX STYLES
   ========================================================================== */
div.spwai-meta-box {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    margin: 20px 0;
}

#woocommerce-product-data div.spwai-variation-meta-box h2 {
    padding: 0;
    font-weight: bold;
    margin-bottom: 5px;
}

label.spwai-prompt-label {
    display: block;
    margin-bottom: 5px;
}

.spwai-prompt {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

/* .spwai-generate {
    background-color: #4caf50;
    color: white;
    padding: 7px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    float: left;
}

.spwai-generate:hover {
    background-color: #45a049;
} */

/*-- loader --*/
.spwai-button-container {
    position: relative;
    display: inline-block;
    /* Ensure the container only takes as much width as needed */
}

.spwai-loader {
    float: left;
}

.spwai-loader img {
    width: 30px;
}


div.spwai-output {
    margin-top: 15px;
}

div.spwai-output label {
    /* display: block; */
    margin-bottom: 0px;
}

div.spwai-output input,
div.spwai-output textarea {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    margin-top: 5px;
}

.spwai-output input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 0;
}

.spwai-error-message {
    color: #ff0000;
    /* Red color for error messages */
    margin-top: 5px;
}

.spwai-error-message a {
    color: #ff0000;
    /* Red color for error messages */
    text-decoration: underline;
}


/*---- Settings page ----*/
.spwai-settings .wrap {
    /* max-width: 800px; */
    margin: 20px auto;
    padding: 20px;
    /* background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
}

.spwai-settings h2 {
    color: #0073aa;
}

.spwai-settings form {
    margin-top: 20px;
}

.spwai-settings input[type="text"],
.spwai-settings select {
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Enhanced button styling - consolidated */
.spwai-settings button.button-primary,
.spwai-settings .spwai-tab-content .button-primary,
.spwai-form-row button.button-primary,
.spwai-tab-content .button-primary {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.spwai-settings .spwai-help-link {
    display: inline-block;
    margin-left: 0.5em;
    font-size: 14px;
    padding: 5px;
    border: 1px solid #0073aa;
    color: #0073aa;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}
.spwai-settings .spwai-help-link:hover {
    background-color: #0073aa;
    color: #fff;
}
span.spwai-by-text {
    display: flex;
    float: right;
    margin-top: -46px;
    padding: 20px;
    align-items: center;
    gap: 15px;
}
.toplevel_page_ai-product-content-creator-for-woocommerce input[type="text"],
.toplevel_page_ai-product-content-creator-for-woocommerce select,
.toplevel_page_ai-product-content-creator-for-woocommerce .spwai-credits {
    max-width: 60%;
}

.spwai-credits #spwai-credit-progress {
    position: relative; 
    height: 25px; 
    background-color: #e0e0e0; 
    border-radius: 8px; 
    overflow: hidden;
} 

.spwai-credits #spwai-credit-bar {
    height: 100%; 
    background: linear-gradient(90deg, #8BC34A, #8BC34A);
    transition: width 0.5s;
}

.spwai-credits .spwai-credits-info {
    margin-top: 5px;
}
.spwai-credits-info div{
    line-height: 1.5;
}
.spwai-credits .spwai-credits-info span{
    font-weight: bold;
    margin-left: 2px;
}
.spwai-credits .spwai-help-link{
    margin-left: 0;
}

/* Progress text styles - consolidated */
.spwai-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: white;
    font-size: 14px;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Add styles for copy icon and hover text */
.spwai-meta-box .copy-icon {
    cursor: pointer;
    margin-left: 5px;
    font-size: 16px;
    vertical-align: middle;
    color: #0073aa;
}

.copy-icon:hover::after {
    content: attr(title);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    margin-left: 10px;
}

/* tab style */

/* General styling for the meta box - merged duplicate rules */

/* Nav-tab-wrapper container */
.spwai-meta-box .nav-tab-wrapper {
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

/* Style for individual tabs */
.spwai-meta-box .nav-tab {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    margin-right: 2px;
    color: #0073aa;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

/* Style for active tab */
.spwai-meta-box .nav-tab-active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
    font-weight: bold;
}

/* Tab content styling */
.spwai-tab-content {

    padding: 20px;
    border: 1px solid #ddd;
    background-color: #fff;
}

/* Style for input elements */

.spwai-meta-box input[type="text"],
.spwai-meta-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    /* margin-bottom: 10px; */
}

/* Styling the buttons */
.spwai-button-container button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    /* cursor: pointer;
    transition: background-color 0.3s ease; */
    float: left;
    padding: 7px 10px;
}

#spwai-save-button,
#spwai-rewrite-button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
}

.spwai-button-container button:hover,
#spwai-save-button:hover,
#spwai-rewrite-button:hover {
    background-color: #005177;
}

/* Loader styling */
.spwai-loader img {
    width: 20px;
    margin-left: 10px;
    margin-top: 5px;
    vertical-align: middle;
    
}

/* Error message */
#spwai-error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-weight: bold;
}

/* Label styling */
.spwai-meta-box label {
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
}

/* Additional padding for form elements */
.spwai-meta-box .spwai-output {
    margin-bottom: 20px;
}

#spwai-product-metabox>div.inside>div>h2 {
    padding: 8px 0px 0px;
}

.spwai-meta-box a.nav-tab {
    margin-left: 0px;
}

#wpbody-content > div.spwai-settings > div > h2.nav-tab-wrapper > a:nth-child(1){
    margin-left:0px;
}

/* 1.2 */
#spwai-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#spwai-popup {
    background: #fff;
    width: 75%;
    
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#spwai-popup h4 {
    margin-bottom: 10px;
}

#spwai-selected-products div {
    margin: 5px 0;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f9f9f9;
}

#spwai-close-popup {
    position: relative;
    float: right;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

#spwai-close-popup:hover {
    color: red;
}


button#spwai-bulk-generate {
    background-color: #0078d0;
    border: 0;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-family: system-ui, -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
    font-weight: 600;
    padding: 2px 10px;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: all .3s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

button#spwai-bulk-generate:before {
    background-color: initial;
    background-image: linear-gradient(#fff 0, rgba(255, 255, 255, 0) 100%);
    border-radius: 125px;
    content: "";
    height: 50%;
    left: 4%;
    opacity: .5;
    position: absolute;
    top: 0;
    transition: all .3s;
    width: 92%;
}

button#spwai-bulk-generate:hover {
    box-shadow: rgba(255, 255, 255, .2) 0 3px 15px inset, rgba(0, 0, 0, .1) 0 3px 5px, rgba(0, 0, 0, .1) 0 10px 13px;
    transform: scale(1.05);
}

div#spwai-completion-message {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
}

/* prompt customization on single product page */
.spwai-dropdowns {
    display: grid;
    /* Four label-select pairs in two columns on wide screens */
    grid-template-columns: auto 1fr auto 1fr;
    column-gap: 14px;
    row-gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.spwai-dropdowns label {
    margin-right: 10px;
    font-weight: bold;
}

.spwai-dropdowns select {
    /* padding: 5px; */
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Responsiveness for dropdowns in product metabox */
@media (max-width: 1024px) {
    .spwai-dropdowns {
        /* Two pairs per row */
        grid-template-columns: auto 1fr;
    }
}

@media (max-width: 782px) {
    .spwai-dropdowns {
        /* Stack label above select for each field */
        grid-template-columns: 1fr;
    }
    .spwai-dropdowns label {
        margin-right: 0;
    }
    .spwai-dropdowns select {
        width: 100%;
        max-width: 100%;
    }
}

#spwai-save-settings {
    /* padding: 0px 15px;
    font-size: 16px; */
    cursor: pointer;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
}

#spwai-save-settings:hover {
    background-color: #005177;
}

/* API Settings Tab styles */
.spwai-settings #api_settings #api-settings-disabled-notice {
    margin: 10px 0 20px 0;
    padding: 10px 15px;
    border-left: 4px solid #ffba00;
    background-color: #fff8e5;
}

.spwai-settings #api_settings #api-settings-disabled-notice p {
    margin: 0.5em 0;
    padding: 2px;
}

.spwai-settings .notice.inline {
    display: block;
    width: auto;
    box-sizing: border-box;
}
/* Style for disabled fields */
/* .spwai-settings #api_settings.disabled-tab input,
.spwai-settings #api_settings.disabled-tab select,
.spwai-settings #api_settings.disabled-tab textarea {
    background-color: #f5f5f5;
    cursor: not-allowed;
} */

.spwai-renewal-rowk {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}
/* Enhanced Global Tooltip Styles */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 6px;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #0873aa;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    text-align: center;
    line-height: 1;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: help;
}

.tooltip-icon:hover {
    background-color: #065a87;
    transform: scale(1.1);
}

.tooltip-text {
    visibility: hidden;
    background-color: #2c3e50;
    color: #fff;
    width: max-content;
    max-width: 300px;
    font-weight: 500;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    position: absolute;
    z-index: 10000;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #2c3e50;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
  .spwai-renewal-rowk > div {
    display: flex;
    align-items: center;
    /* gap: 5px; */
}

.form-table th {
    width: 225px;
}
.spwai-tab-content td .spwai-credits,.spwai-tab-content table.form-table select {
    max-width: 900px!important;
    width: 100%;
}

.spwai-tab-content table.form-table select,
.spwai-form-row select {
    background: #fff url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 10px top 55%!important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 35px !important;
}

.spwai-tab-content th .tooltip-wrapper {
    float: right;
    margin-right: 15px;
    margin-left: 0;
}

.spwai-tab-content th .tooltip-text {
    right: 0;
    left: auto;
    transform: translateX(0) translateY(5px);
}

.spwai-tab-content th .tooltip-text::after {
    right: 15px;
    left: auto;
    margin-left: 0;
}

.spwai-tab-content th .tooltip-wrapper:hover .tooltip-text {
    transform: translateX(0) translateY(0);
}

/* Fix tooltip position in form rows */
.spwai-form-row-label .tooltip-wrapper {
    margin-left: 6px;
    flex-shrink: 0;
}

.spwai-form-row-label .tooltip-text {
    width: auto;
    min-width: 200px;
    max-width: 250px;
    white-space: normal;
    z-index: 100001 !important;
}

span.badge-r {
    background: #FF5722;
    padding: 3px 11px;
    color: white;
    font-size: 12px;
    font-weight: 500!important;
    border-radius: 20px;
}
span.w-max {
    max-width: 174px!important;
    display: inline-block;
}
/* --27/03/2025 */
ul#bulk-titles-list{
    padding: 0!important;
}
#bulk-titles .ntdelitem {
    border-bottom: 1px solid #b74b3e;
    padding-left: 32px;
}

#bulk-titles .ntdelbutton:before {
    color: #31a435;
}

.spwai-popup-bulk-r{
  animation: scale-up-center-normal 1s ease 0s .8 normal none;
  padding: 0!important;
  overflow: hidden;
  max-width: 900px;
}
@keyframes scale-up-center-normal {
  0% {
    transform: scale(0.5);
  }
  100% {
    transform: scale(1);
  }
}
.spwai-popup-bulk-r #spwai-popup h4 {
  margin-top: 0;
}

.spwai-popup-titl-r {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  /* color: white; */
  background-color: #b74b3e;
  height: 30px;
  align-content: center;
  align-items: center;
}
.spwai-popup-titl-r #spwai-close-popup {
  font-size: 22px;
  color: white !important;
}
.spwai-popup-titl-r h2 {
  color: white;
  font-size: 18px;
  margin: 0;
}

.spwai-popup-bulk-r div#bulk-title-div {
  border: 1px solid #b74b3e;
  overflow: hidden;
  border-radius: 10px;
}
.spwai-popup-bulk-r div#bulk-title-div #bulk-titles {
  border: 0;
  padding: 0;
}

 
button.star-launch {
    margin: auto;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
    font-size: 17px;
    padding: 0.8em 1.3em 0.8em 0.9em;
    color: white;
    background: #b74b3e;
    background: linear-gradient(to right, #b74b3e, #f06c4f, #ff6f5e);
    
    border: none;
    letter-spacing: 0.05em;
    border-radius: 16px;
  }
  
  button.star-launch svg {
    margin-right: 3px;
    transform: rotate(30deg);
    transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
  }
  
  button.star-launch span {
    transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
  }
  
  button.star-launch:hover svg {
    transform: translateX(5px) rotate(90deg);
  }
  
  button.star-launch:hover span {
    transform: translateX(7px);
  }
  
  .spwai-progress-bar-none {
    display: none;
}

.spwai-popup-bulk-r  select {
    border-radius: 20px!important;
    width: 100%;
}

#spwai-completion-message:empty {
    display: none;
}
.spwai-popup-bulk-r #loading-icon {
    display: none;
}


.spwai-popup-titl-r + div {
    max-height: 80vh;
    overflow: auto;
}

/* Firefox (uncomment to work in Firefox, although other properties will not work!)  */
/** {
  scrollbar-width: thin;
  scrollbar-color: #B74B3E #DFE9EB;
}*/

/* Chrome, Edge and Safari */

.spwai-popup-titl-r + div::-webkit-scrollbar {
    height: 3px;
    width: 3px;
  }
  
.spwai-popup-titl-r + div::-webkit-scrollbar-track {
    border-radius: 0px;
    background-color: #DFE9EB;
  }
  
  
.spwai-popup-titl-r + div::-webkit-scrollbar-track:hover {
    background-color: #B8C0C2;
  }
  
  
.spwai-popup-titl-r + div::-webkit-scrollbar-track:active {
    background-color: #B8C0C2;
  }
  
  
.spwai-popup-titl-r + div::-webkit-scrollbar-thumb {
    border-radius: 0px;
    background-color: #B74B3E;
  }
  
  
.spwai-popup-titl-r + div::-webkit-scrollbar-thumb:hover {
    background-color: #B74B3E;
  }
  
  
.spwai-popup-titl-r + div::-webkit-scrollbar-thumb:active {
    background-color: #B74B3E;
  }
  
.spwai-tab-content .disabled-field {
    color: #999;
    cursor: not-allowed;
}
.spwai-tab-content .empty-field-notice {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
    margin-left: 5px;
}
#spwai-meta-prompt{
    margin-bottom: 10px;
}



/* AJAX License Verification Notices */
.spwai-ajax-notice {
    border-left: 4px solid;
    margin: 10px 0;
    padding: 12px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    animation: slideInDown 0.3s ease-out;
}

.spwai-ajax-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745;
    color: #155724;
}

.spwai-ajax-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
    border-left-color: #dc3545;
    color: #721c24;
}

.spwai-ajax-loading {
    background: linear-gradient(135deg, #cce7ff 0%, #b3d9ff 100%);
    border-left-color: #007cba;
    color: #004085;
}

.spwai-ajax-notice strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.spwai-ajax-notice em {
    font-size: 12px;
    opacity: 0.8;
}

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

/* static license status styling */
.spwai-license-notice {
    margin: 10px 0 20px 0;
    padding: 10px 15px;
    border-left: 4px solid;
}

.spwai-license-notice.notice-success {
    border-left-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.spwai-license-notice.notice-warning {
    border-left-color: #ffba00;
    background-color: #fff8e5;
    color: #856404;
}

.spwai-license-notice.notice-error {
    border-left-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.spwai-license-notice p {
    margin: 0.5em 0;
    padding: 2px;
}

/* Credit Overview Cards */
.spwai-credit-overview {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.spwai-credit-overview h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.spwai-credit-overview h3:before {
    content: "💳";
    font-size: 20px;
}

.spwai-credit-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.spwai-credit-card {
    flex: 1;
    min-width: 180px;
    padding: 20px;
    border-radius: 8px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.spwai-credit-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.spwai-credit-card.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.spwai-credit-card.used {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.spwai-credit-card.remaining {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.spwai-credit-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.spwai-credit-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.spwai-credit-progress {
 
    border-radius: 0px;
    
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

/* Duplicate credit progress bar removed - using enhanced version below */

.spwai-credit-progress-text {
 text-align: center;
    font-size: 16px;
    color: #6c757d;
    font-weight: 600;
}

.spwai-credit-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.spwai-credit-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4facfe;
}


.spwai-credit-info-item:last-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left: 3px solid rgba(255,255,255,0.3);
}

.spwai-credit-info-item strong {
    font-weight: 600;
}

.spwai-renewal-notice {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #8b4513;
    text-align: center;
}

/* Enhanced Tab Styling */
.spwai-settings .nav-tab-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

.spwai-settings .nav-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 15px 25px;
    margin: 0;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.spwai-settings .nav-tab:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.spwai-settings .nav-tab-active {
    background: white !important;
    color: #667eea !important;
    font-weight: 600;
}

.spwai-settings .nav-tab-active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.spwai-tab-content {
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Form Styling Enhancements */
.spwai-tab-content .form-table th {
    padding: 15px;
    border-radius: 6px 0 0 6px;
    font-weight: 600;
    color: #495057;
    align-items: center;
    font-size: 18px;
    align-content: center;
}

.spwai-tab-content .form-table td {
    padding: 15px;
    background: white;
    border-radius: 0 6px 6px 0;
}

.spwai-tab-content .form-table tr {
    border-bottom: 10px solid transparent;
}

.spwai-tab-content input[type="text"],
.spwai-tab-content input[type="email"],
.spwai-tab-content select,
.spwai-tab-content textarea {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.spwai-tab-content input[type="text"]:focus,
.spwai-tab-content input[type="email"]:focus,
.spwai-tab-content select:focus,
.spwai-tab-content textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Enhanced button styling for settings tabs */
.spwai-settings .spwai-tab-content .button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    padding: 12px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.spwai-settings .spwai-tab-content .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Contact Button Styling */
.spwai-contact-button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white !important;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.spwai-contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
    color: white !important;
}

/* Toggle Switch Styles */
.spwai-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
    vertical-align: middle;
}

.spwai-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}
.spwai-toggle-switch input[disabled] + .spwai-toggle-slider {
    background-color: #ccc;
    opacity: 0.6;
    cursor: not-allowed;
}

.spwai-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

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

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

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

.spwai-toggle-slider.round {
    border-radius: 24px;
}

.spwai-toggle-slider.round:before {
    border-radius: 50%;
}

/* Enhanced Settings Section Cards */
.spwai-settings-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.spwai-settings-section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.spwai-settings-section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.spwai-settings-section-header .section-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.spwai-settings-section-content {
    padding: 25px 30px;
}

/* Form Row Styling */
.spwai-form-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 0;
    margin-bottom: 5px;
    border-bottom: 1px solid #f1f3f4;
}

.spwai-form-row:last-child {
    padding-top: 25px;
    margin-top: 10px;
    border-bottom: none;
}

.spwai-form-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 35%;
    margin-right: 15px;
    line-height: 1.5;
}

.spwai-form-row-label label {
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.spwai-form-row-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 60%;
}

.spwai-form-row select,
.spwai-form-row input[type="text"],
.spwai-form-row input[type="email"] {
    width: 100%;
    min-width: 300px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Fix for select field widths and alignment */
.spwai-form-row-control select {
    width: 100%;
    max-width: 100%;
    display: block;
    height: 42px;
}

.spwai-form-row-control .spwai-toggle-switch {
    margin-left: auto;
}

/* Make sure form rows properly align on all screen sizes */
@media (min-width: 1200px) {
    .spwai-form-row-label {
        flex: 0 0 25%;
    }
    
    .spwai-form-row-control {
        flex: 0 0 70%;
    }
}

@media (max-width: 768px) {
    .spwai-form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .spwai-form-row-label {
        flex: 1 0 100%;
        margin-bottom: 10px;
        max-width: 100%;
    }
    
    .spwai-form-row-control {
        flex: 1 0 100%;
    }
    
    .spwai-form-row select,
    .spwai-form-row input[type="text"],
    .spwai-form-row input[type="email"] {
        min-width: 100%;
    }
}

/* Fix form submit button alignment */
.spwai-form-row button.button-primary{
    margin-left: auto;
}

/* Enhanced Credit Info Section */
.spwai-credit-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 25px;
}

.spwai-credit-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 25px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    border-left: 4px solid #4facfe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.spwai-credit-info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.02) 0%, rgba(102, 126, 234, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.spwai-credit-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-left-color: #667eea;
}

.spwai-credit-info-item:hover::before {
    opacity: 1;
}

.spwai-credit-info-item .renewal-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #374151;
}

.spwai-credit-info-item .renewal-date {
    color: #667eea;
    font-weight: 700;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(79, 172, 254, 0.1) 100%);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Enhanced Action Card */
.spwai-credit-info-item:last-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.spwai-credit-info-item:last-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 1;
}

.spwai-credit-info-item:last-child::after {
    content: '✨';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    opacity: 0.3;
}

.spwai-renewal-notice {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spwai-renewal-notice::before {
    content: '🔄';
    font-size: 18px;
}

/* Enhanced Contact Button */
.spwai-contact-button {
    background: white !important;
    color: #667eea !important;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    border: 2px solid transparent;
    overflow: hidden;
}

.spwai-contact-button::before {
    content: '🚀';
    font-size: 16px;
    transition: transform 0.3s ease;
}

.spwai-contact-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
    background: #f8f9fa !important;
    color: #5a6fd8 !important;
    border-color: rgba(255, 255, 255, 0.3);
}

.spwai-contact-button:hover::before {
    transform: rotate(15deg) scale(1.1);
}

.spwai-contact-button:active {
    transform: translateY(0) scale(0.98);
}

/* API Settings Disabled State */
.spwai-settings-section.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.spwai-settings-section.disabled .spwai-settings-section-header {
    background: linear-gradient(135deg, #f1f1f1 0%, #e0e0e0 100%);
}

.spwai-disabled-overlay {
    position: relative;
}

.spwai-disabled-overlay::after {
    content: "🔒 Enable 'Use Third Party API' in Settings to configure";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    color: #6b7280;
    border: 2px dashed #d1d5db;
    z-index: 10;
    white-space: nowrap;
}

/* Enhanced License Section */
.spwai-license-verification {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
   
}

.spwai-license-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.spwai-license-input-group input[type="text"] {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.spwai-license-input-group button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.spwai-license-input-group button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Section Icons */
.section-icon.settings::before { content: "⚙️"; }
.section-icon.api::before { content: "🔧"; }
.section-icon.license::before { content: "🔑"; }
.section-icon.credits::before { content: "💳"; }

/* Responsive Design */
@media (max-width: 768px) {
    .spwai-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .spwai-form-row-label {
        max-width: 100%;
    }
    
    .spwai-form-row select,
    .spwai-form-row input[type="text"],
    .spwai-form-row input[type="email"] {
        min-width: 100%;
    }
    
    .spwai-credit-cards {
        flex-direction: column;
    }
    
    .spwai-license-input-group {
        flex-direction: column;
    }
}

/* Enhanced Tooltip Styling for Credit Section */
.spwai-credit-info .tooltip-wrapper {
    position: relative;
    margin-left: auto;
}

.spwai-credit-info .tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.spwai-credit-info .tooltip-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4a94 100%);
}

.spwai-credit-info .tooltip-text {
    position: absolute;
    bottom: 130%;
    right: 0;
    margin-bottom: 5px;
    background: #2c3e50;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    pointer-events: none;
}

.spwai-credit-info .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

.spwai-credit-info .tooltip-wrapper:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .spwai-credit-info-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        text-align: center;
    }
    
    .spwai-credit-info-item .renewal-info {
        justify-content: center;
    }
    
    .spwai-credit-info .tooltip-wrapper {
        margin: 0 auto;
    }
    
    .spwai-credit-info .tooltip-text {
        right: 50%;
        left: auto;
        transform: translateX(50%) translateY(5px);
        white-space: normal;
        max-width: 250px;
    }
    
    .spwai-credit-info .tooltip-text::after {
        right: 50%;
        left: auto;
        margin-right: -6px;
    }
    
    .spwai-credit-info .tooltip-wrapper:hover .tooltip-text {
        transform: translateX(50%) translateY(0);
    }
    
    .spwai-contact-button {
        width: 100%;
        margin-top: 10px;
    }
    
    /* General tooltip adjustments for mobile */
    .tooltip-text {
        max-width: 250px;
        white-space: normal;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .tooltip-wrapper {
        margin-left: 3px;
    }
}

/* Animation for the entire credit info section */
.spwai-credit-info {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Tooltip Container Overflow Prevention */
.spwai-settings,
.spwai-tab-content,
.spwai-credit-info,
.form-table {
    overflow: visible !important;
}

.spwai-settings-section {
    overflow: visible !important;
}

/* Ensure tooltips appear above all other elements */
.tooltip-text {
    z-index: 999999 !important;
}

/* Fix tooltip positioning issues in flex containers */
.spwai-credit-info-item {
    position: relative;
    overflow: visible;
}

/* Prevent tooltip text from wrapping unnecessarily */
.tooltip-text {
    word-wrap: break-word;
    hyphens: auto;
}

/* Enhanced accessibility for screen readers */
.tooltip-wrapper[aria-label] .tooltip-text {
    clip: rect(0 0 0 0);
    clip-path: inset(100%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.tooltip-wrapper[aria-label]:hover .tooltip-text,
.tooltip-wrapper[aria-label]:focus .tooltip-text {
    clip: auto;
    clip-path: none;
    height: auto;
    overflow: visible;
    white-space: normal;
    width: auto;
}

/* Fix for WordPress admin bar z-index conflicts */
#wpadminbar {
    z-index: 99999;
}

.tooltip-text {
    z-index: 100000 !important;
}

.nav-tab-wrapper, .wrap h2.nav-tab-wrapper, h1.nav-tab-wrapper{
    padding-top: 0 !important;
}

/* Spacing improvements for settings form */
.spwai-settings-section-content {
    padding: 25px 30px;
}

.spwai-form-row {
    padding: 18px;
    margin-bottom: 5px;
}

/* Improve form submit buttons */
.spwai-form-row:last-child {
    padding-top: 25px;
    margin-top: 10px;
}

.spwai-tab-content .button-primary {
    min-width: 150px;
}

/* Fix select dropdown width and alignment */
.spwai-form-row-control select {
    height: 50px;
}

/* Fix tooltip alignment in labels */
.spwai-form-row-label {
    line-height: 1.5;
}

/* Fix Advanced Features spacing and alignment */
.spwai-settings-section + .spwai-settings-section {
    margin-top: 30px;
}

/* Fix credit overview spacing */
.spwai-credit-overview {
    margin-bottom: 0;
}

/* Fix for API settings section button alignment */
.spwai-form-row button.button-primary {
    margin-left: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    padding: 12px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: #fff;
    min-width: 150px;
}

.spwai-form-row button.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Fix for disabled API section button */
.spwai-settings-section.disabled .spwai-form-row button.button-primary {
    opacity: 0.7;
    cursor: not-allowed;
}

.spwai-settings-section.disabled .spwai-form-row button.button-primary:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* OpenAI API Configuration Section Enhancements */
#api_settings .spwai-settings-section-header {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    gap: 12px;
}

#api_settings .spwai-settings-section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

#api_settings .spwai-form-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 35%;
    margin-right: 15px;
    line-height: 1.5;
}

#api_settings .spwai-form-row-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 60%;
}

#api_settings .spwai-help-link {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    padding: 5px 10px;
    border: 1px solid #0073aa;
    color: #0073aa;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

#api_settings .spwai-help-link:hover {
    background-color: #0073aa;
    color: #fff;
}

#api_settings p.description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Improved Disabled State for API Settings Section */
#api_settings .spwai-settings-section.disabled {
    position: relative;
    opacity: 0.85;
}

#api_settings .spwai-settings-section.disabled::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 249, 249, 0.5);
    z-index: 2;
    border-radius: 12px;
    pointer-events: none;
}

#api_settings #api-settings-disabled-notice {
    margin: 10px 0 20px 0;
    padding: 12px 15px;
    border-left: 4px solid #ffba00;
    background-color: #fff8e5;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#api_settings #api-settings-disabled-notice p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}
#api_settings .spwai-help-link {
    display: flex;
align-items: center;
}
#api_settings .spwai-form-row-control {
    display: flex;
    align-items: stretch;
}
#api_settings .spwai-form-row-control  input{
    margin-bottom: 0;
}

.spwai-tab-content .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.spwai-tab-content .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
    box-sizing: border-box;
}


#bulk-titles-list .button-link{
    color: #c60e0e;
    text-decoration: none;
    font-weight: 600;
}
.spwai-popup-header h2 {
    color: white;
}

.spwai-credit-progress {
    margin: 20px 0;
    position: relative;
}

.spwai-credit-progress-track {
    position: relative;
    background: linear-gradient(90deg, #f1f3f4 0%, #e8eaed 100%);
    border-radius: 12px;
    height: 24px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dadce0;
}

.spwai-credit-progress-bar {
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, #4285f4 0%, #1a73e8 50%, #1557b0 100%);
    border-radius: 12px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    overflow: hidden;
}

.spwai-credit-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    border-radius: 12px;
}

.spwai-credit-progress-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg, #4285f4, #1a73e8);
    border-radius: 14px;
    filter: blur(4px);
    opacity: 0.3;
    z-index: -1;
}

.spwai-credit-progress-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.spwai-credit-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 2;
    white-space: nowrap;
}

.spwai-credit-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #5f6368;
    font-weight: 500;
}

.progress-label-start,
.progress-label-end {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e8eaed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .spwai-credit-progress-track {
        height: 20px;
    }
    
    .spwai-credit-progress-text {
        font-size: 11px;
    }
}

/* Different color themes based on credit level */
.spwai-credit-progress-bar.low-credits {
    background: linear-gradient(90deg, #ea4335 0%, #d33b2c 50%, #b52d20 100%);
}

.spwai-credit-progress-bar.medium-credits {
    background: linear-gradient(90deg, #fbbc04 0%, #f9ab00 50%, #e37400 100%);
}

.spwai-credit-progress-bar.high-credits {
    background: linear-gradient(90deg, #34a853 0%, #2d9334 50%, #1e8e3e 100%);
}

button#spwai-save-settings {
    height: 45px;
}


/* Popup Styles */
.spwai-popup-overlay-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spwai-fadeIn 0.3s ease-out;
}

.spwai-popup-bulk-modern {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 850px;
    width: 85%;
    max-height: 85vh;
    overflow: hidden;
    animation: spwai-slideUp 0.4s ease-out;
    position: relative;
}

.spwai-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spwai-popup-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spwai-popup-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spwai-popup-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.spwai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spwai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.spwai-popup-content {
    padding: 20px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

.spwai-section {
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.spwai-section:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.spwai-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.spwai-section-header h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.spwai-product-count {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
}

.spwai-products-container {
    max-height: 120px;
    overflow-y: auto;
}

.spwai-product-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.spwai-product-list li {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.spwai-product-list li:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.ntdelbutton {
    background: #ef4444;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ntdelbutton:hover {
    
    transform: scale(1.1);
}

.ntdelbutton::before {
    content: '×';
    font-weight: bold;
}

.ntdeltitle {
    flex: 1;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spwai-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.spwai-config-item {
    background: white;
    border-radius: 6px;
    padding: 14px;
    border: 1px solid #e2e8f0;
}

/* Make specific config items span full width of the two-column grid */
.spwai-config-item-full {
    grid-column: 1 / -1;
}

.spwai-select-modern {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
}

.spwai-select-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.spwai-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spwai-checkbox-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.spwai-checkbox-modern:hover {
    background: #f1f5f9;
}

.spwai-checkbox-modern input[type="checkbox"] {
    display: none;
}

.spwai-checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.spwai-checkbox-modern input:checked + .spwai-checkmark {
    background: #667eea;
    border-color: #667eea;
}

.spwai-checkbox-modern input:checked + .spwai-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.spwai-label-text {
    font-weight: 500;
    color: #334155;
}

.spwai-progress-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.spwai-progress-container {
    position: relative;
}

.spwai-progress-bar-modern {
    background: #e2e8f0;
    border-radius: 20px;
    height: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.spwai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
    width: 0%;
}

.spwai-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: spwai-shimmer 2s infinite;
}

/* Duplicate progress text removed - using consolidated version above */

.spwai-completion-message {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

.spwai-action-section {
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin-bottom: 0;
}

.spwai-start-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.spwai-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.spwai-start-btn:active {
    transform: translateY(0);
}

.spwai-start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.spwai-start-btn:hover::before {
    left: 100%;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS - CONSOLIDATED
   ========================================================================== */

/* Popup Animations */
@keyframes spwai-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spwai-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spwai-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Credit Progress Animations */
@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Form Animations */
@keyframes spwai-togglePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spwai-iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes spwai-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

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

@keyframes spwai-tooltipFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Legacy animations - keeping for compatibility */
@keyframes scale-up-center-normal {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    100% {
        -webkit-transform: scale(1.25);
        transform: scale(1.25);
    }
}

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

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


/* Custom scrollbar for popup content */
.spwai-popup-content::-webkit-scrollbar {
    width: 6px;
}

.spwai-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.spwai-popup-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.spwai-popup-content::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

.spwai-products-container::-webkit-scrollbar {
    width: 4px;
}

.spwai-products-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.spwai-products-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.spwai-completion-message::-webkit-scrollbar {
    width: 4px;
}

.spwai-completion-message::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.spwai-completion-message::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .spwai-popup-bulk-modern {
        width: 95%;
        max-height: 90vh;
    }

    .spwai-popup-content {
        padding: 16px;
        max-height: calc(90vh - 70px);
    }

    .spwai-config-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .spwai-popup-header {
        padding: 16px 20px;
    }

    .spwai-popup_header h2 {
        font-size: 18px;
    }

    .spwai-section {
        padding: 12px;
        margin-bottom: 16px;
    }

    .spwai-products-container {
        max-height: 100px;
    }
}

/* Duplicate animations removed - using spwai-prefixed versions */

/* Duplicate keyframes removed - using consolidated section at bottom */

/* ==========================================================================
   ENHANCED INTERACTIVE STYLES - USING CONSOLIDATED ANIMATIONS
   ========================================================================== */

/* Toggle Animations */
.checked-animation {
    animation: spwai-togglePulse 0.3s ease-out;
}

.tooltip-active {
    animation: spwai-iconBounce 0.3s ease-out;
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4a94 100%) !important;
}

.tooltip-visible {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
}

.spwai-credit-info .tooltip-visible {
    transform: translateY(0) !important;
}

.spwai-tab-content th .tooltip-visible {
    transform: translateX(0) translateY(0) !important;
}

/* Mobile tooltip visibility */
@media (max-width: 768px) {
    .spwai-credit-info .tooltip-visible {
        transform: translateX(50%) translateY(0) !important;
    }
}

.floating {
    animation: spwai-float 4s ease-in-out infinite;
}

.spwai-tab-content .button-primary.loading {
    position: relative;
    color: transparent !important;
}

.spwai-tab-content .button-primary.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-radius: 50%;
    border-top-color: white;
    animation: spwai-spin 1s ease-in-out infinite;
}

/* Enhanced tooltip animations */
.tooltip-text {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.tooltip-icon {
    transition: all 0.3s ease !important;
}

/* Prevent tooltip flicker */
.tooltip-wrapper:hover .tooltip-text {
    animation: spwai-tooltipFadeIn 0.3s ease-out;
}
