.ws-alt-text-container {
    position: relative;
}

/* Down-arrow icon for the static button state */
.ws-generate-alt-text::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-bottom: 2px solid #FFF;
    border-right: 2px solid #FFF;
    transform: rotate(45deg);
    margin-left: -12px;
    transition: opacity 0.2s;
    opacity: 1;
}

/* Hide the down-arrow when loading */
.ws-generate-alt-text.loading::after {
    opacity: 0;
}

/* Modern button style */
.ws-generate-alt-text {
    background-color: #58C791 !important;
    color: #FFFFFF !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    padding: 8px 16px !important;
    height: auto !important;
	min-width: 175px !important;
    line-height: 1.4 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-radius: 4px !important;
	display: inline-flex !important;
	justify-content: center !important;
    align-items: center !important;
}

.ws-generate-alt-text:hover {
    background-color: #49B583 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.ws-generate-alt-text:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ws-generate-alt-text .spinner {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;

    /* Reset default spinner styles */
    background: none !important;
    margin: 0 0 0 8px !important;
    width: 18px; /* Adjusted size for the button */
    height: 18px; /* Adjusted size for the button */

    /* Apply new spinner styles */
    border: 2px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
}

.ws-generate-alt-text .spinner::after {
  content: '';  
  position: absolute;
  box-sizing: border-box;

  /* Adjusted positioning and size for the new spinner dimensions */
  left: 6px;
  top: 9px;
  border: 4px solid transparent;
  border-right-color: #FFF;
  transform: rotate(-40deg);
}

.ws-generate-alt-text.loading .spinner {
    visibility: visible;
    opacity: 1;
    animation: rotation 1s linear infinite;
}

.ws-status-message {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    background: #fff;
}

.ws-status-message.error {
    color: #dc3232;
    background: #fcf0f1;
}

.ws-status-message.success {
    color: #00a32a;
    background: #f0f6f0;
}

.ws-status-message.loading {
    color: #2271b1;
    background: #f0f6fc;
}

/* Modern Bulk Processing Styles */
.ws-bulk-progress-container {
    position: fixed;
    top: 32px;
    left: 160px;
    right: 0;
    background: #fff;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 999;
    display: none;
    border-bottom: 1px solid #f0f0f1;
}

.ws-bulk-progress-bar {
    height: 6px;
    background-color: #f0f0f1;
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0;
}

.ws-bulk-progress-bar .progress {
    height: 100%;
    background-color: #58C791;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.ws-bulk-progress-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ws-bulk-progress-text {
    font-size: 13px;
    color: #1d2327;
    font-weight: 500;
}

.ws-bulk-stop-button {
    background: #fff !important;
    color: #dc3232 !important;
    border: 1px solid #dc3232 !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    height: auto !important;
}

.ws-bulk-stop-button:hover {
    background: #fcf0f1 !important;
    color: #dc3232 !important;
}

.ws-bulk-stop-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Settings Page Styles */
.ws-settings-page {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    padding: 20px;
    border-radius: 8px;
}

.ws-settings-page h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 9px 0 4px 0;
    color: rgb(35, 40, 45);
}

.ws-settings-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ws-settings-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgb(226, 232, 240);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ws-settings-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgb(226, 232, 240);
}

.ws-settings-card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: rgb(30, 41, 59);
    line-height: 1.4;
}

.ws-settings-description {
    margin: 4px 0 0;
    color: rgb(71, 85, 105);
    font-size: 13px;
    line-height: 1.5;
}

.ws-settings-card-content {
    padding: 16px 24px;
}

.ws-settings-field {
    margin-bottom: 16px;
}

.ws-settings-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgb(30, 41, 59);
    font-size: 13px;
}

.ws-settings-select {
    width: 100%;
    max-width: 250px;
    padding: 4px 8px;
    border: 1px solid rgb(203, 213, 225);
    border-radius: 4px;
    font-size: 13px;
    color: rgb(30, 41, 59);
    background-color: #fff;
    line-height: 1.5;
    height: 28px;
}

.ws-settings-select:focus {
    border-color: rgb(148, 163, 184);
    outline: none;
    box-shadow: 0 0 0 1px rgb(148, 163, 184);
}

.ws-settings-field-group {
    margin-bottom: 0;
}

.ws-setting-help {
    color: #666;
    font-size: 12px;
    margin: 4px 0 12px 46px;
    line-height: 1.5;
    padding: 0;
}

/* Submit button styling */
.ws-primary {
    background: #58C791 !important;
    border: none !important;
    color: #FFFFFF !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    height: 28px !important;
    line-height: 1.4 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    margin-top: 16px !important;
}

.ws-primary:hover {
    background: #49B583 !important;
    transform: none !important;
    box-shadow: none !important;
}

.ws-primary:active {
    transform: none !important;
    box-shadow: none !important;
    background: #49B583 !important;
}

/* Remove existing container styles and replace with new ones */
.ws-image-alt-text-generator-container {
    padding: 2rem;
    min-height: 100vh;
}

/* Style for each section box */
.ws-settings-section {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Update form elements to match new design */
.ws-settings-section form {
    max-width: 800px;
    margin: 0 auto;
}

.ws-settings-section h2 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Update input and button styles */
.ws-settings-section input[type="text"],
.ws-settings-section input[type="password"],
.ws-settings-section select {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;

    width: 100%;
    max-width: 400px;
}

.ws-settings-section button {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ws-settings-section button:hover {
    background-color: #2563eb;
}

/* Add some spacing between form elements */
.ws-form-group {
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ws-image-alt-text-generator-container {
        padding: 1rem;
    }
    
    .ws-settings-section {
        padding: 1rem;
    }
}

/* API Key input styling */
.ws-settings-field input[type="password"] {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    max-width: 400px;
    font-family: monospace;
}

.ws-settings-field input[type="password"]:focus {
    border-color: #94a3b8;
    outline: none;
    box-shadow: 0 0 0 1px #94a3b8;
}

.ws-credits-info {
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #4CAF50;
    border-radius: 3px;
}

.ws-credits-info p {
    margin: 0;
    color: #333;
    font-size: 14px;
}

.ws-credits-info strong {
    font-weight: 600;
}

/* Toggle Switch - More specific and isolated styling */
.ws-alt-toggle-container {
    position: relative;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.ws-alt-toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 19px;
    margin: 0;
}

.ws-alt-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

.ws-alt-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 19px;
}

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

.ws-alt-toggle-switch input:checked + .ws-alt-toggle-slider {
    background-color: #58C791;
}

.ws-alt-toggle-switch input:focus + .ws-alt-toggle-slider {
    box-shadow: 0 0 1px #58C791;
}

.ws-alt-toggle-switch input:checked + .ws-alt-toggle-slider:before {
    transform: translateX(19px);
}

.ws-alt-toggle-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.ws-alt-toggle-text {
    margin-left: 0;
    font-size: 14px;
    color: #333;
}

/* Toggle wrapper for better alignment */
.ws-toggle-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

/* Adjust help text alignment */
.ws-toggle-wrapper .ws-setting-help {
    color: #666;
    font-size: 12px;
    margin: 4px 0 0 46px; /* Align with the toggle text */
    line-height: 1.5;
    padding: 0;
}

.ws-keywords-info {
    background-color: #f8f8f8;
    padding: 10px 12px;
    border-left: 4px solid #ccc;
    margin-top: 10px !important;
    line-height: 1.4;
    border-radius: 0 4px 4px 0;
}

.ws-keywords-info.has-keywords {
    border-left-color: #4CAF50;
    background-color: #f1f8e9;
}

.ws-keywords-info.no-keywords {
    border-left-color: #FFC107;
    background-color: #fff8e1;
}

.ws-keywords-info .parent-info {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #666;
}

.ws-keywords-info .parent-info a {
    color: #0073aa;
    text-decoration: none;
}

.ws-keywords-info .parent-info a:hover {
    text-decoration: underline;
}

/* API Key Save Button Styles */
.ws-api-key-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
}

.ws-api-key-input-wrapper input[type="password"] {
    flex: 1;
    margin: 0;
}

.ws-save-api-key-button {
    background: #58C791 !important;
    border: none !important;
    color: #FFFFFF !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    height: 28px !important;
    line-height: 1.4 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-width: 100px;
}

.ws-save-api-key-button:hover {
    background: #49B583 !important;
    transform: none !important;
    box-shadow: none !important;
}

.ws-save-api-key-button:active {
    transform: none !important;
    box-shadow: none !important;
    background: #49B583 !important;
}

.ws-save-api-key-button:disabled {
    background: #cccccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}
