/**
 * Mementor Text to Speech - Admin CSS
 * 
 * This file contains styles for the admin interface only.
 * 
 * IMPORTANT: All player styles (preview and live) should be in public/css/mementor-tts-shared.css only.
 * Do not add player-specific styles here to avoid duplication and inconsistencies.
 */
/* ======= Variables ======= */
:root {
    --mementor-tts-admin-bg: #ffffff;
    --mementor-tts-admin-border: #dcdcde;
    --mementor-tts-admin-accent: #2271b1;
    --mementor-tts-admin-text: #50575e;
    --mementor-tts-admin-success: #00a32a;
    --mementor-tts-admin-error: #d63638;
    --mementor-tts-admin-spacing-xs: 4px;
    --mementor-tts-admin-spacing-sm: 8px;
    --mementor-tts-admin-spacing-md: 12px;
    --mementor-tts-admin-spacing-lg: 16px;
    --mementor-tts-admin-spacing-xl: 24px;

    /* Theme Colors */
    --mementor-tts-bg-color: #f6f7fb;
    --mementor-tts-border-color: #dcdcde;
    --mementor-tts-accent-color: #2271b1;
    --mementor-tts-accent-color-hover: #135e96;
    --mementor-tts-text-color: #50575e;
    --mementor-tts-purple: #7854E4;
    --mementor-tts-purple-light: #9378f0;
    --mementor-tts-gold: #ffd700;

    /* Component Colors */
    --mementor-tts-play-button-bg: #ffffff !important;
    --mementor-tts-play-button-bg-hover: #f6f7f7 !important;
    --mementor-tts-progress-default: #e0e0e0 !important;
    --mementor-tts-progress-playing: #2271b1 !important;
    --mementor-tts-timer-color: #50575e !important;

    /* Spacing */
    --mementor-tts-spacing-xs: 4px;
    --mementor-tts-spacing-sm: 8px;
    --mementor-tts-spacing-md: 12px;
    --mementor-tts-spacing-lg: 16px;
    
    /* Sizes */
    --mementor-tts-play-icon-size: 24px;
    --mementor-tts-icon-size: 20px;
    --mementor-tts-font-size: 14px;
    --mementor-tts-player-padding: 15px;

    /* Player Label */
    --mementor-tts-label-margin: 10px;
    --mementor-tts-label-size: 14px;
    --mementor-tts-label-weight: 400;
    --mementor-tts-label-color: #1d2327;
}

/* ======= Global Styles ======= */
.dashicons, .dashicons-before:before {
    display: inline-block !important;
}

/* ======= Layout Structure ======= */
.mementor-tts-wrap {
    display: flex!important;
    gap: 30px;
    margin-top: 10px;
    min-height: 80vh;
    position: relative;
}

.mementor-tts-main {
    flex: 1;
    min-width: 0;
    width: 66%;
    position: relative;
}

.mementor-tts-main.full-width {
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

.mementor-tts-sidebar {
    width: 32%;
    margin-top: 0;
    position: sticky;
    top: 32px; /* WordPress admin bar height */
    align-self: flex-start;
    max-height: calc(100vh - 32px); /* Viewport height minus admin bar */
    overflow-y: auto; /* Allow scrolling if content is too tall */
    z-index: 10; /* Ensure sidebar appears above other content when sticky */
    height: fit-content; /* Ensure the sidebar only takes the height it needs */
}

.mementor-tts-new-feature {
    display: inline-block;
    vertical-align: top;
    box-sizing: border-box;
    margin-left: 8px;
    padding: 0 5px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background-color: #d63638;
    color: #fff;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
    z-index: 26;
}

.mementor-tts-service-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    margin: 3px 0 0 0;
}

body.settings-tab-active .mementor-tts-sidebar {
    display: block !important;
}

/* Adjust for smaller admin bar on mobile */
@media screen and (max-width: 782px) {
    .mementor-tts-sidebar {
        top: 46px; /* WordPress mobile admin bar height */
        max-height: calc(100vh - 46px);
    }
}

/* ======= Settings Page Specific Styles ======= */
/* Only target the settings page to avoid affecting other pages */
body.mementor-tts-settings-page .mementor-tts-main .mementor-tts-section {
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    float: none !important;
    max-width: 100% !important;
}

/* Target the form inside the settings page */
body.mementor-tts-settings-page .mementor-tts-main form {
    width: 100% !important;
    display: block !important;
    max-width: 100% !important;
}

/* Target the sections inside the form on the settings page */
body.mementor-tts-settings-page .mementor-tts-main form .mementor-tts-section {
    width: 100% !important;
    display: block !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

/* Ensure form tables in settings page fill the width */
body.mementor-tts-settings-page .mementor-tts-main .mementor-tts-form-table {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure section content in settings page fills the width */
body.mementor-tts-settings-page .mementor-tts-main .mementor-tts-section-content {
    display: block !important;
    max-width: 100% !important;
}

/* Style the Save Settings button container */
.save-settings-container {
    clear: both;
    display: block;
    width: 100%;
    margin-top: 20px;
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.save-settings-container .button-primary {
    padding: 5px 15px;
    height: auto;
    font-size: 14px;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .mementor-tts-wrap {
        flex-direction: column;
    }
    
    .mementor-tts-main,
    .mementor-tts-sidebar {
        width: 100%;
    }
    
    .save-settings-container {
        text-align: center;
    }
}

/* ======= Header Logo Styling ======= */
.mementor-tts-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--mementor-tts-admin-spacing-lg);
    width: 100%;
}

.mementor-tts-header-layout h1 {
    margin: 0;
    display: flex;
    align-items: center;
}

.mementor-tts-header-logo {
    height: 30px;
    width: auto;
    vertical-align: middle;
    margin-right: 15px;
    display: inline-block;
}

.mementor-tts-upgrade-spacing {
    margin-left: var(--mementor-tts-admin-spacing-lg) !important;
}

/* Removed duplicate upgrade button styles - consolidated at line ~2948 */

/* ======= API Key Setup Styling ======= */
.mementor-tts-get-started {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--mementor-tts-border-color);
    position: relative;
    overflow: hidden;
}

.mementor-tts-get-started h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--mementor-tts-purple);
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f1;
}

.mementor-tts-get-started ol {
    margin-left: 20px;
    padding-left: 0;
    margin-bottom: 20px;
}

.mementor-tts-get-started li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 5px;
    line-height: 1.5;
    font-size:15px
}

.mementor-tts-get-started li a {
    font-weight: 500;
    text-decoration: none;
    color: var(--mementor-tts-accent-color);
    transition: color 0.2s ease;
}

.mementor-tts-get-started li a:hover {
    color: var(--mementor-tts-accent-color-hover);
}

/* External Link Icon */
.mementor-tts-external-link::after {
    content: '\f504';
    font-family: dashicons;
    display: inline-block;
    vertical-align: middle;
    font-size: 16px;
    margin-left: 4px;
    text-decoration: none;
    opacity: 0.7;
    line-height: 1;
}

.mementor-tts-pro-option {
    background-color: #f9f8ff;
    border-radius: 6px;
    padding: 15px;
    margin-top: 5px;
    border-left: 4px solid var(--mementor-tts-purple);
}

.mementor-tts-pro-option strong {
    color: var(--mementor-tts-purple);
}

.mementor-tts-pro-option a {
    font-weight: 500;
    text-decoration: none;
    color: var(--mementor-tts-accent-color);
    transition: color 0.2s ease;
}

.mementor-tts-pro-option a:hover {
    color: var(--mementor-tts-accent-color-hover);
}

/* API Key Button Styling */
#validate-api-key {
    background: var(--mementor-tts-purple) !important;
    border-color: var(--mementor-tts-purple) !important;
    color: white !important;
    padding: 4px 16px !important;
    height: auto !important;
    line-height: 2 !important;
    font-weight: 500 !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-shadow: none;
}

#validate-api-key:hover {
    background: var(--mementor-tts-purple-light) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

#validate-api-key:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#validate-api-key .dashicons {
    margin-top: 5px;
}

/* API Key Input Styling */
#mementor_tts_api_key {
    border: 1px solid #d0d0d0;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
    font-size: 14px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

#mementor_tts_api_key:focus {
    border-color: var(--mementor-tts-purple);
    box-shadow: 0 0 0 1px var(--mementor-tts-purple-light);
    outline: none;
}

/* ======= Section Styling ======= */
.mementor-tts-container {
    padding: 20px;
}

.mementor-tts-section {
    background-color: #fff;
    border-radius: 8px;
    margin-right: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    position: relative;
}

.mementor-tts-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid #c3c4c7;
    line-height: 1.4;
    box-sizing: border-box;
    padding: 8px 20px;
    background-color: #f8f9fa;
}

.mementor-tts-section-header h2 {
    margin: 0;
    padding: 0;
    text-align: left;
    font-size: 1.3em;
    line-height: 1.4;
    font-weight: 600;
    color: #1d2327;
    flex: 1;
}

.mementor-tts-section-header .button,
.mementor-tts-section-header button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    height: 30px;
    line-height: 28px;
    padding: 0 10px;
    background: #f6f7f7;
    border: 1px solid #2271b1;
    border-radius: 3px;
    cursor: pointer;
    color: #2271b1;
    font-size: 13px;
    font-weight: normal;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.mementor-tts-section-header .button:hover,
.mementor-tts-section-header button:hover {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

.mementor-tts-section-header .button .dashicons,
.mementor-tts-section-header button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 15px;
    margin-right: 2px;
}

.mementor-tts-section-header .button .dashicons,
.mementor-tts-section-header button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 15px;
    margin-right: 2px;
}

.mementor-tts-section-content {
    padding: 20px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.mementor-tts-section-content.collapsed {
    display: none;
}

.mementor-tts-section .description {
    padding-top:10px;
    text-align: left;
    color: #4d698f;
    font-size: 14px;
}

.mementor-tts-section .form-table {
    margin-top: 0;
    margin: 0;
    padding: 0 20px 20px;
}

.mementor-tts-section .submit {
    margin-top: 0;
    padding-top: 0;
    padding: 0 !important;
    margin: 0;
}

/* ======= Form Elements ======= */
.mementor-tts-form {
    max-width: 800px;
}

.mementor-tts-form__group {
    margin-bottom: var(--mementor-tts-admin-spacing-lg);
}

.mementor-tts-form__label {
    display: block;
    margin-bottom: var(--mementor-tts-admin-spacing-sm);
    font-weight: 600;
}

.mementor-tts-form__input {
    width: 100%;
    max-width: 25rem;
    padding: var(--mementor-tts-admin-spacing-sm);
    border: 1px solid var(--mementor-tts-admin-border);
    border-radius: 4px;
}

.mementor-tts-form-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5em;
    margin-bottom: 1em;
    position: static;
}

.mementor-tts-form-table th {
    padding: 20px 10px 20px 0;
    width: 200px;
    vertical-align: top;
    font-weight: 600;
}

.mementor-tts-form-table td {
    padding: 15px 10px;
    vertical-align: top;
    position: relative;
    overflow: visible;
}

.mementor-tts-form-table fieldset {
    margin: 0;
    padding: 0;
}

.mementor-tts-form-table .description {
    margin-top: 8px;
    color: #646970;
}

/* Select inputs */
.mementor-tts-select {
    max-width: 400px;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mementor-tts-select optgroup {
    font-weight: 600;
    color: #1d2327;
}

.mementor-tts-select optgroup[disabled] {
    color: #757575;
    font-style: italic;
}

.mementor-tts-select option {
    padding: 8px;
    font-weight: 400;
}

.mementor-tts-select option .mementor-tts-pro-label {
    background: #2271b1;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Field styling */
.mementor-tts-field {
    margin-bottom: 15px;
}

.mementor-tts-field label,
.mementor-tts-form-table fieldset label {
    margin-bottom: 8px;
    display: block;
    color: #1d2327;
    font-weight: 500;
}

.mementor-tts-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background-color: #fff;
    color: #1d2327;
    font-size: 14px;
    line-height: 1;
    min-height: 36px;
}

.mementor-tts-field select:focus,
.mementor-tts-selector-field input[type="text"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 0;
}

.mementor-tts-field:last-child,
.mementor-tts-form-table fieldset label:last-child {
    margin-bottom: 0;
}

/* Settings fields */
.mementor-tts-settings-field {
    margin-bottom: 20px;
}

.mementor-tts-settings-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.mementor-tts-settings-field input[type="text"],
.mementor-tts-settings-field input[type="number"],
.mementor-tts-settings-field select,
.mementor-tts-settings-field textarea {
    width: 100%;
    max-width: 400px;
}

.mementor-tts-settings-field .description {
    margin-top: 5px;
    color: #666;
    font-style: italic;
}

/* Color inputs */
.mementor-tts-wrap input[type="color"],
.tts-admin-wrap input[type="color"] {
    width: 60px;
    height: 30px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mementor-tts-color-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mementor-tts-color-input input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
}

.mementor-tts-color-input input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.mementor-tts-color-input input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.mementor-tts-color-text {
    font-size: 14px;
    flex: 1;
    padding: 8px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    width: 80px;
    text-align: center;
    font-family: monospace;
}

.mementor-tts-color-field {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.mementor-tts-color-option {
    flex: 1;
    min-width: 150px;
}

/* Range inputs */
.mementor-tts-wrap input[type="range"],
.tts-admin-wrap input[type="range"] {
    max-width: 400px;
    width: 100%;
}

.mementor-tts-range {
    flex: 1;
    width: 200px;
    -webkit-appearance: none;
    outline: 0;
    margin: 0 10px 0 0;
    vertical-align: middle;
    height: 4px;
    background: #dcdcde;
    border-radius: 2px;
    appearance: none;
}

.mementor-tts-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #2271b1;
    border-radius: 50%;
    cursor: pointer;
}

.mementor-tts-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #2271b1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.mementor-tts-range-field {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mementor-tts-range-value,
.range-value {
    display: inline-block;
    color: #50575e;
    min-width: 45px;
    text-align: right;
    font-weight: 500;
    margin-left: 10px;
}

/* Checkbox groups */
.mementor-tts-checkbox-group {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mementor-tts-checkbox-label {
    display: block;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.mementor-tts-checkbox-label input {
    margin-right: 5px;
}

/* ======= Toggle Switch ======= */
.mementor-tts-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: center;
}

.mementor-tts-toggle label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.mementor-tts-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mementor-tts-toggle input[type="checkbox"]::before,
.mementor-tts-toggle input[type="checkbox"]:checked::before {
    content: none !important;
}

.mementor-tts-toggle .slider {
    position: relative;
    display: block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.2s;
    margin: 0 auto;
}

.mementor-tts-toggle .slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.mementor-tts-toggle input:checked + label .slider {
    background-color: #2271b1;
}

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

.mementor-tts-toggle input:focus + label .slider {
    box-shadow: 0 0 1px #2271b1;
}

.mementor-tts-toggle .label-text {
    font-size: 14px;
    color: #23282d;
    margin-bottom: 4px;
    order: -1;
    font-weight: 500;
    text-align: center;
}

/* ======= Tabs Navigation ======= */
.mementor-tts-tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-wrap: wrap;
}

.mementor-tts-tabs__nav {
    display: flex;
    gap: var(--mementor-tts-admin-spacing-sm);
}

.mementor-tts-tabs__item {
    padding: var(--mementor-tts-admin-spacing-sm) var(--mementor-tts-admin-spacing-md);
    border: 1px solid var(--mementor-tts-admin-border);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    color: var(--mementor-tts-admin-text);
    text-decoration: none;
    background: #f0f0f1;
}

.mementor-tts-tabs__item--active {
    background: var(--mementor-tts-admin-bg);
    border-bottom-color: var(--mementor-tts-admin-bg);
    color: var(--mementor-tts-admin-accent);
}

.mementor-tts-tabs .nav-tab {
    padding: 5px;
    margin: 0 5px 0 0;
    flex: 1 1 auto;
    text-align: center;
    min-width: 100px;
    cursor: pointer;
}

.mementor-tts-tabs .nav-tab:last-child {
    margin-right: 0;
}

.mementor-tts-tabs .nav-tab-active {
    border-bottom: 1px solid #f1f1f1;
    background: #f1f1f1;
}

.mementor-tts-tabs .nav-tab.limited {
    position: relative;
}

.mementor-tts-tabs .nav-tab.limited::after {
    content: "🔒";
    font-size: 12px;
    margin-left: 5px;
    opacity: 0.7;
}

.mementor-tts-tabs .nav-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f1f1;
    color: #666;
}

.mementor-tts-tabs .nav-tab.locked {
    position: relative;
    opacity: 0.8;
}

.mementor-tts-tabs .nav-tab.locked .dashicons-lock {
    margin-left: 5px;
    font-size: 14px;
    line-height: 1.5;
}

/* Subtabs */
.mementor-tts-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0;
}

.mementor-tts-subtab {
    padding: 8px 16px;
    text-decoration: none;
    color: #646970;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: #f0f0f1;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: -1px;
}

.mementor-tts-subtab:hover {
    background: #fff;
    color: #2271b1;
}

.mementor-tts-subtab.active {
    background: #fff;
    color: #1d2327;
    border-bottom: 1px solid #fff;
}

.mementor-tts-subtab-content {
    display: none;
}

.mementor-tts-subtab-content.active {
    display: block;
}

/* Tab content */
.mementor-tts-tab-content button:disabled,
.mementor-tts-tab-content input:disabled,
.mementor-tts-tab-content select:disabled,
.mementor-tts-tab-content textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.mementor-tts-tab-content.locked {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.mementor-tts-tab-content.locked .mementor-tts-lock-overlay {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 9999;
    pointer-events: all;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 20px;
}

/* ======= Block Styling ======= */
.mementor-tts-blocks-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 20px;
    margin-bottom: 15px;
    padding: 0;
    background-color: #fff;
    border-radius: 4px;
}

.mementor-tts-blocks-container.mnopadding {
    padding: 0;
}

.mementor-tts-block {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid #efefef;
    transition: 0.2s;
}

.mementor-tts-block:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.mementor-tts-block h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dcdcde;
    color: #1d2327;
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}

.mementor-tts-block label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d2327;
    line-height: 1.2;
}

.mementor-tts-block-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.mementor-tts-block.full-width {
    grid-column: 1/-1;
    width: 100%;
    padding: 24px;
}

.mementor-tts-section .mementor-tts-blocks-container .mementor-tts-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
}

/* ======= Width Utilities ======= */
.width-10,
.width-15,
.label-settings .width-10,
.label-settings .width-15 {
    grid-column: span 1;
}

.width-20,
.label-settings .width-20 {
    grid-column: span 2;
}

.width-25 {
    grid-column: span 3;
}

.width-30,
.width-33,
.label-settings .width-30,
.label-settings .width-33,
.mementor-tts-block.width-30 {
    grid-column: span 4;
}

.width-50,
.mementor-tts-block.width-50 {
    grid-column: span 6;
}

.width-66,
.label-settings .width-80 {
    grid-column: span 8;
}

.width-70,
.mementor-tts-block.width-70 {
    grid-column: span 9;
}

.width-75 {
    grid-column: span 9;
}

.width-80 {
    grid-column: span 10;
}

.width-100,
.mementor-tts-block.width-100 {
    grid-column: span 12;
}

.fullwidth {
    width: 100%;
    max-width: 100% !important;
}

/* ======= Utility Classes ======= */
.msmall {
    font-size: 12px !important;
    color: #646970;
}

.mwelcome {
    margin-top: -5px;
}


.mmt-15 {
    margin-top: 15px !important;
}

.mmb-10 {
    margin-bottom: 10px !important;
}

.mfs15 {
    font-size: 15px !important;
}

.mmr-50 {
    margin-right: 50px !important;
}

.mpb-0 {
    padding-bottom: 0 !important;
}

.mpb-10 {
    padding-bottom: 10px !important;
}

.mnopadding-bottom {
    padding-bottom: 0 !important;
}

.mementor-tts-license-cta.mmb-0 {
    margin-bottom: 0px !important;
}

/* ======= Player Preview Styles ======= */
.mementor-tts-sticky-preview {
    position: sticky;
    z-index: 100;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Override button margins in admin player preview */
.mementor-tts-preview-player button,
.mementor-tts-preview-player .mementor-tts-play-button,
.mementor-tts-preview-player .mementor-tts-volume-button,
.mementor-tts-preview-player .mementor-tts-speed-button,
.mementor-tts-preview-player .mementor-tts-info-button,
.mementor-tts-preview-player .mementor-tts-download-button {
    margin: 0 !important;
}

/* ======= Notification System ======= */
.mementor-tts-notification {
    position: fixed;
    top: 40px;
    left: 50%;
    right: auto;
    background: #1a1a1a;
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    padding: 0;
    margin: 0;
    z-index: 100000;
    max-width: 360px;
    min-width: 240px;
    transform: translate(-50%, -80px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    border-radius: 8px;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.mementor-tts-notification.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.mementor-tts-notification.success {
    border: none;
}

.mementor-tts-notification.error {
    border: none;
}

.mementor-tts-notification-content {
    flex: 1;
    padding: 14px 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff !important;
}

.mementor-tts-notification-content strong {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    color: #fff;
}

.mementor-tts-notification-close {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
    width: 36px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.mementor-tts-notification-close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.mementor-tts-notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-left: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.mementor-tts-notification.success .mementor-tts-notification-icon {
    color: #1D9E75;
    background: #E1F5EE;
}

.mementor-tts-notification.error .mementor-tts-notification-icon {
    color: #f87171;
    font-size: 14px;
    background: rgba(248,113,113,0.15);
}

.mementor-tts-notification.warning .mementor-tts-notification-icon {
    color: #fbbf24;
    background: rgba(251,191,36,0.15);
}

.mementor-tts-notification.info .mementor-tts-notification-icon {
    color: #60a5fa;
    font-style: italic;
    font-size: 15px;
    background: rgba(96,165,250,0.15);
}

/* ======= Disabled Notice ======= */
.mementor-tts-disabled-notice {
    background: #f8d7da;
    border-left: 4px solid #dc3232;
    color: #1d2327;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mementor-tts-disabled-notice .dashicons {
    color: #dc3232;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.mementor-tts-disabled-notice p {
    margin: 0;
    flex: 1;
}

/* ======= API Status ======= */
.mementor-tts-api-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
    margin-left: 10px;
    font-weight: 500;
}

.mementor-tts-api-status.connected {
    background-color: #46b450;
    color: #fff;
    font-size: 15px;
    margin-left: 10px;
    padding: 12px 16px;
    margin-top: -1px;
}

.mementor-tts-api-status.not-connected {
    background-color: #dc3232;
    color: #fff;
    font-size: 15px;
    margin-left: 5px;
    padding: 7px 10px;
    margin-top: -3px;
}

.mementor-tts-api-status.validating {
    background-color: #f0b849;
    color: #fff;
}

#mementor-tts-api-key-status {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    background-color: #f0f0f1;
    color: #50575e;
    font-size: 13px;
}

#mementor-tts-api-key-status.connected {
    background-color: #edfaef;
    color: #00a32a;
}

.mementor-tts-api-key-input {
    display: flex;
    align-items: center;
}

.mementor-tts-api-key-input input {
    flex: 1;
    margin-right: 5px;
}

.mementor-tts-api-key-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.mementor-tts-api-key-container input {
    flex: 1;
}

/* ======= Post Type Selection ======= */
.mementor-tts-post-types {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mementor-tts-selection-box {
    position: relative;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    z-index: 100;
}

.mementor-tts-selected-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.mementor-tts-selected-type {
    display: inline-flex;
    align-items: center;
    background: #f0f0f1;
    padding: 5px 10px;
    border-radius: 3px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.mementor-tts-selected-type .remove-type {
    margin-left: 8px !important;
    cursor: pointer !important;
    color: #fff !important;
    display: inline-block !important;
    font-family: dashicons !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

.mementor-tts-selected-type .remove-type:hover {
    color: #d63638 !important;
}

.mementor-tts-available-types {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 999999;
    margin-top: 1px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    padding: 5px 0;
    width: 100%;
    box-sizing: border-box;
    transform: translateZ(0);
    will-change: transform;
}

.mementor-tts-type-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    clear: both;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: relative;
    z-index: 10000;
}

.mementor-tts-type-item:hover {
    background-color: #f0f0f1;
}

.mementor-tts-type-item.mementor-tts-pro-feature {
    opacity: 0.7;
    cursor: not-allowed;
}

.mementor-tts-type-item.pro-feature::after {
    content: "PRO";
    margin-left: 8px;
    padding: 2px 6px;
    background: #2271b1;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.mementor-tts-helper-text {
    margin: 8px 0 0;
    max-width: 506px;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

/* ======= PRO Features Styling ======= */
.mementor-tts-pro-feature {
    opacity: 0.7;
    pointer-events: none;
}

.mementor-tts-pro-label {
    background: #ff2e57;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

.mementor-tts-pro-feature input[type="color"],
.mementor-tts-pro-feature input[type="number"],
.mementor-tts-pro-feature input[type="range"],
.mementor-tts-pro-feature input[type="text"],
.mementor-tts-pro-feature textarea {
    opacity: 0.5;
    cursor: not-allowed;
}

.mementor-tts-pro-cta {
    background: #2271b1;
    color: #fff;
    padding: 20px;
    border-radius: 3px;
    text-align: center;
}

.mementor-tts-pro-cta h3 {
    color: #fff;
    margin-top: 0;
}

.mementor-tts-pro-cta-text {
    font-size: 14px;
}

.mementor-tts-pro-button {
    display: inline-block;
    background: #fff;
    color: #2271b1;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 600;
    margin-top: 10px;
}

.mementor-tts-pro-button:hover {
    background: #f1f1f1;
    color: #2271b1;
}

/* PRO Promotion */
.mementor-tts-pro-promo {
    background-color: #f8f9fa;
    border-left: 4px solid #2271b1;
    padding: 20px;
    margin-bottom: 15px;
    margin-left: 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.mementor-tts-pro-promo h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #1d2327;
}

.mementor-tts-pro-promo p {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.mementor-tts-pro-promo .button-primary {
    background-color: #2271b1;
    color: #fff;
}

.mementor-tts-form-table td .mementor-tts-pro-promo {
    margin-top: 30px;
    margin-left: 0;
    padding-left: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mementor-tts-button-container {
    margin-bottom: 25px;
    margin-top: 15px;
}

/* PRO Features Grid */
.mementor-tts-pro-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
    margin: 20px;
}

.mementor-tts-pro-feature-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e5e5;
}

.mementor-tts-pro-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.mementor-tts-pro-feature-icon {
    margin-bottom: 15px;
}

.mementor-tts-pro-feature-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #2271b1;
}

.mementor-tts-pro-feature-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #1d2327;
}

.mementor-tts-pro-feature-content p {
    margin: 0;
    color: #50575e;
    line-height: 1.5;
}

/* PRO Feature Notice */
.mementor-tts-pro-feature-notice {
    display: flex;
    background-color: #f8f9fa;
    border-left: 4px solid #2271b1;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 3px;
    background: #f0f6fc;
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
    border: 1px solid #c5d9ed;
}

.mementor-tts-pro-feature-notice p {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 18px;
    color: #1d2327;
}

.mementor-tts-pro-feature-notice .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.mementor-tts-pro-feature-notice .button {
    margin-left: auto;
}

/* ======= Sidebar Styling ======= */
.mementor-tts-sidebar-box {
    background-color: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mementor-tts-sidebar-box h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* ======= Tooltip Styling ======= */
.tooltip-icon {
    cursor: help;
    color: #2271b1;
    margin-left: 5px;
    vertical-align: middle;
    display: inline-block;
    position: relative;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 999999;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.4;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    /* Prevent overflow on smaller screens */
    max-width: calc(100vw - 40px);
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    /* Ensure tooltip doesn't get cut off */
    white-space: normal;
    word-wrap: break-word;
}

/* Alternative positioning for tooltips near edges */
.tooltip-text.tooltip-left {
    left: 0;
    transform: none;
}

.tooltip-text.tooltip-right {
    right: 0;
    left: auto;
    transform: none;
}

.mementor-tts-block .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-icon:hover + .tooltip-text,
.tooltip-text:hover {
    visibility: visible;
    opacity: 1;
}

/* Status colors */
.mementor-tts-stat-box .status-active {
    color: #46b450;
}

.mementor-tts-stat-box .status-inactive {
    color: #dc3232;
}

.mementor-tts-stat-box .tier {
    color: var(--mementor-tts-admin-accent);
    text-transform: capitalize;
}

/* Progress bar */
.mementor-tts-progress-wrapper {
    margin: 10px 0;
}

.mementor-tts-progress {
    height: 10px;
    background-color: #e9e9e9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.mementor-tts-progress-bar {
    height: 100%;
    background-color: var(--mementor-tts-admin-accent);
    border-radius: 3px;
}

.mementor-tts-progress-wrapper span {
    display: block;
    text-align: right;
}

/* API not connected message */
.mementor-tts-api-not-connected {
    background-color: #f8f8f8;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.mementor-tts-api-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mementor-tts-api-message .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d63638;
    margin-bottom: 15px;
}

.mementor-tts-api-message p {
    margin: 5px 0 15px;
    font-size: 14px;
    line-height: 1.5;
}

.mementor-tts-api-message p strong {
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

.mementor-tts-api-message .button {
    margin-top: 10px;
    min-width: 150px;
}

/* Additional information table */
.mementor-tts-additional-info {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mementor-tts-additional-info h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.mementor-tts-info-table {
    width: 100%;
    border-collapse: collapse;
}

.mementor-tts-info-table th,
.mementor-tts-info-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mementor-tts-info-table th {
    font-weight: 500;
    color: #555;
    width: 40%;
}

.mementor-tts-info-table td {
    color: #333;
}

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

/* ======= Voice Selection Styles ======= */
.mementor-tts-voice-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px 20px 10px 20px;
    border-radius: 4px;
}

.mementor-tts-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.mementor-tts-filter-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

.mementor-tts-filter {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.mementor-tts-voice-search {
    flex: 1 1 100%;
}

.mementor-tts-voice-search input {
    width: 100%;
    padding: 8px 12px;
}

.mementor-tts-voice-filter-group {
    flex: 1 1 auto;
    min-width: 150px;
}

.mementor-tts-voice-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.mementor-tts-voice-table-container {
    overflow-x: auto;
    position: relative;
    min-height: 300px;
    padding: 0 20px;
}

.mementor-tts-voice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--mementor-tts-border-color);
}

/* Modern table header styles */
.mementor-tts-voice-table thead {
    background: linear-gradient(to bottom, #f8f9fa, #f1f3f5);
    border-bottom: 2px solid var(--mementor-tts-accent-color);
}

.mementor-tts-table-header th {
    padding: 15px 10px;
    font-weight: 600;
    color: #333;
    position: relative;
    transition: background-color 0.2s ease;
}

.mementor-tts-table-header th:hover {
    background-color: rgba(34, 113, 177, 0.05);
}

.mementor-tts-table-header th .dashicons {
    margin-right: 5px;
    color: var(--mementor-tts-accent-color);
    vertical-align: middle;
    font-size: 16px;
}

.mementor-tts-voice-table tr {
    border-bottom: 1px solid var(--mementor-tts-border-color);
}

.mementor-tts-voice-table td {
    padding: 16px;
    vertical-align: middle;
    border: none;
}

td.mementor-tts-voice-age {
    text-align: center !important;
}

.mementor-tts-voice-image {
    width: 48px;
    text-align: center;
    padding-left: 20px !important;
    display: table-cell;
}

.mementor-tts-voice-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Center the avatar horizontally */
}

.mementor-tts-voice-avatar img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.mementor-tts-voice-avatar .dashicons {
    font-size: 24px;
    color: #646970;
}

.mementor-tts-voice-name h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}

.mementor-tts-voice-details {
    margin-top: 10px;
    color: #646970;
    font-size: 13px;
}

.mementor-tts-voice-details span {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f6f7fb;
}

.mementor-tts-gender-badge,
.mementor-tts-age-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.mementor-tts-gender-badge.female {
    background: #FFE0F0;
    color: #9C4D6F;
}

.mementor-tts-gender-badge.male {
    background: #E0F0FF;
    color: #4D6F9C;
}

.mementor-tts-age-badge.young {
    background: #E0FFE0;
    color: #4D9C4D;
}

.mementor-tts-age-badge.middle-aged,.mementor-tts-age-badge.middle_aged {
    background: #FFE0B2;
    color: #996B33;
}

.mementor-tts-voice-preview {
    text-align: center;
    white-space: nowrap;
}

.mementor-tts-voice-preview-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.mementor-tts-voice-play-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mementor-tts-voice-play-button:hover {
    background: #f6f7f7;
}

.mementor-tts-voice-play-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.mementor-tts-voice-selected {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #389E38;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.mementor-tts-voice-use-button {
    min-width: 100px;
}

.mementor-tts-voice-use-button.selected {
    background-color: #00a32a !important;
    border-color: #00a32a !important;
    color: #fff !important;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.mementor-tts-voice-use-button.selected:hover {
    background-color: #008a20 !important;
    border-color: #008a20 !important;
}

/* Loading and Error States */
.mementor-tts-loading,
.mementor-tts-error {
    text-align: center;
    padding: 40px !important;
    color: #646970;
}

.mementor-tts-loading .spinning {
    animation: spin 2s linear infinite;
}

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

.mementor-tts-voice-audio {
    display: none;
}

/* Gender badge styling */
.mementor-tts-gender-badge {
    display: inline-flex;
    text-transform: capitalize;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.mementor-tts-gender-badge .gender-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

.mementor-tts-gender-badge .gender-text {
    font-size: 14px;
}

.mementor-tts-gender-badge.female {
    background-color: #FFE0F0;
    color: #D81B60;
}

.mementor-tts-gender-badge.male {
    background-color: #E3F2FD;
    color: #1976D2;
}

.mementor-tts-gender-badge.non-binary {
    background-color: #F3E5F5;
    color: #7B1FA2;
}

.mementor-tts-age-badge {
    display: inline-block;
    text-transform: capitalize;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.mementor-tts-age-badge.young {
    background-color: #e6ffed;
    color: #28a745;
    border: 1px solid #b3e6c9;
}

.mementor-tts-age-badge.midlife {
    background-color: #fff8e6;
    color: #f0ad4e;
    border: 1px solid #ffe0b3;
}

.mementor-tts-age-badge.old {
    background-color: #f0f0f0;
    color: #6c757d;
    border: 1px solid #dddddd;
}

.mementor-tts-age-badge .age-icon {
    margin-right: 4px;
}

/* Voice badge styling */
.mementor-tts-voice-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* ======= License Styling ======= */
.mementor-tts-license-cta {
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin-top: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    background: #f0f6fc;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin: 30px 20px 20px 20px;
    border: 1px solid #c5d9ed;
}

.mementor-tts-license-cta.pro-cta {
    padding: 30px 30px 10px 30px;
}

.mementor-tts-license-cta p {
    margin: 0;
    font-weight: 600;
    color: #28a745;
    flex: 1;
    font-size: 24px;
    color: #1d2327;
}

.mementor-tts-license-cta .button-primary {
    padding: 8px 20px;
    height: auto;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mementor-tts-license-cta .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mementor-tts-license-form {
    display: flex;
    align-items: center;
    margin: 0 20px 20px 20px;
    gap: 10px;
}

.mementor-tts-license-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mementor-tts-license-status {
    margin: 0 20px 20px 20px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
}

.mementor-tts-license-active {
    display: flex;
    align-items: center;
    color: #46b450;
    font-weight: 500;
}

.mementor-tts-license-active .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.mementor-tts-license-inactive {
    display: flex;
    align-items: center;
    color: #dc3232;
    font-weight: 500;
}

.mementor-tts-license-inactive .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.mementor-tts-license-expires {
    margin: 5px 0 0 34px;
    font-size: 13px;
    color: #666;
}

.mementor-tts-license-notice {
    margin: 5px 0 0 34px;
    font-size: 13px;
    color: #666;
}

.mementor-tts-license-info {
    margin: 0 20px 20px 20px;
    font-size: 14px;
    color: #666;
}

/* ======= Lock Overlay ======= */
.mementor-tts-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.mementor-tts-lock-content {
    text-align: center;
    max-width: 400px;
    padding: 30px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mementor-tts-lock-content .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d63638;
    margin-bottom: 15px;
}

.mementor-tts-lock-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

.mementor-tts-lock-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.mementor-tts-lock-message {
    background-color: white;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mementor-tts-lock-message h3 {
    margin-top: 0;
    color: #1d2327;
    font-size: 20px;
}

.mementor-tts-lock-message p {
    margin-bottom: 15px;
    font-size: 15px;
}

.mementor-tts-lock-message .button {
    margin: 5px;
    padding: 8px 16px;
}

.mementor-tts-lock-icon {
    font-size: 21px;
    color: #2271b1;
    margin-bottom: 15px;
}

/* ======= Admin Navigation Styles */
.mementor-tts-admin-nav {
    display: flex;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 4px;
    margin-right: 3px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.mementor-tts-nav-left {
    display: flex;
    flex-wrap: wrap;
}

.mementor-tts-nav-right {
    display: flex;
    align-items: center;
}

.mementor-tts-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #2c3338;
    text-decoration: none;
    border-right: 1px solid #c3c4c7;
    transition: all 0.2s ease;
}

.mementor-tts-nav-item:hover {
    background-color: #f0f0f1;
    color: #2271b1;
}

/* Upgrade button in navigation */
.mementor-tts-upgrade-nav-button {
    text-transform: uppercase;
    font-size: 0.95rem;
    line-height: 16px;
    background-color: #2271b1;
    color: #fff;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mementor-tts-upgrade-nav-button:hover {
    background-color: #00a90e;
    color: #fff;
}

.mementor-tts-upgrade-nav-button .dashicons {
    color: #f0b849;
}

.mementor-tts-nav-item.active {
    background-color: #2271b1;
    color: #fff;
    font-weight: 500;
}

.mementor-tts-nav-item .dashicons {
    margin-right: 8px;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.mementor-tts-nav-item.active.locked {
    position: relative;
    color: #e7e7e7;
}

.mementor-tts-nav-item.locked {
    position: relative;
    color: #525252;
}

.mementor-tts-nav-item.locked .dashicons-lock {
    margin-left: 5px;
    margin-right: 0;
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.mementor-tts-content-area {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    position: relative;
}

/* ======= Direct Page Loading Styles ======= */
.mementor-tts-admin-wrap {
    margin: 20px 0;
}

.mementor-tts-admin-content {
    background-color: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.mementor-tts-settings-section {
    margin-bottom: 30px;
}

.mementor-tts-settings-section h2 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
    line-height: 1.3;
}

/* Layout section styling */
.mementor-tts-section:first-of-type h2 {
    margin-top: 0;
}

/* ======= Selector Field Styling ======= */
.mementor-tts-selectors-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.mementor-tts-selector-field {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.mementor-tts-selector-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d2327;
}

.mementor-tts-selector-input-wrapper {
    margin-bottom: 15px;
}

.mementor-tts-selector-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.mementor-tts-selector-presets {
    margin-top: 15px;
}

.mementor-tts-selector-presets strong {
    display: block;
    margin-bottom: 10px;
    color: #1d2327;
}

.mementor-tts-selector-presets .button {
    margin: 0 8px 8px 0;
    color: #2271b1;
    border-color: #2271b1;
    background: #f6f7f7;
}

.mementor-tts-selector-presets .button:hover {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

.mementor-tts-selector-field .description {
    margin-top: 12px;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

/* ======= Player Styling ======= */
.mementor-tts-preview-player-padding {
    padding: 15px 20px 10px 20px;
}

.mementor-tts-player-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.mementor-tts-player-column {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mementor-tts-player-column h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mementor-tts-test-player {
    border-radius: 4px;
}

.mementor-tts-test-player audio {
    display: block;
    margin-top: 15px;
}

.mementor-tts-preview-header {
    background-color: #f6f7fb;
    border-bottom: 2px solid #2271b1;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
}

.mementor-tts-live-preview {
    padding: 20px;
    background-color: #fff;
    border-top: none;
}

/* Sticky Preview Styles */
.mementor-tts-sticky-preview {
    position: relative;
    width: 99.88%;
    border-radius: 12px 12px 8px 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    transition: transform 0.3s ease;
}

.mementor-tts-sticky-preview.is-sticky {
    position: fixed;
    top: 32px; /* WordPress admin bar height */
    left: 160px; /* WordPress admin menu width */
    right: 20px;
    z-index: 99999;
    background: #fff;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.4);
    margin: 0;
    width: auto;
}

/* Responsive styles for sticky preview */
@media screen and (max-width: 960px) {
    .mementor-tts-sticky-preview.is-sticky {
        left: 36px; /* Collapsed admin menu */
    }
}

@media screen and (max-width: 782px) {
    .mementor-tts-sticky-preview.is-sticky {
        top: 46px; /* Mobile admin bar height */
        left: 0;
    }
}

@media screen and (max-width: 600px) {
    .mementor-tts-sticky-preview.is-sticky {
        top: 0;
    }
}

.mementor-tts-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mementor-tts-preview-actions h2 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    border: none !important;
}

.mementor-tts-preview-actions h2::after {
    display: none;
}

.mementor-tts-preview-buttons {
    display: flex;
    gap: 10px;
}

.mementor-tts-preview-player-padding {
    padding: 20px;
}

/* Player preview styling */

.mementor-tts-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mementor-tts-preview-actions h2 {
    font-size: 1.3em;
    padding: 10px 0 10px 20px;
    margin: 0;
    color: #1d2327;
    font-weight: 600;
    flex: 1;
}

.mementor-tts-preview-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-label-settings {
    display: none;
}

.player-label-settings.visible {
    display: flex;
    gap: 20px;
}

.player-label-settings > div {
    flex: 1;
    width: 50%;
}

.player-controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: center;
    justify-content: center;
}

.player-control-item {
    grid-column: span 3;
    text-align: center;
}

.mementor-tts-duration-display,
.mementor-tts-time-display {
    display: var(--show-time, inline-block);
}

/* ======= Layout Grids ======= */
.mementor-tts-layout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.mementor-tts-playback-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.mementor-tts-theme-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mementor-tts-controls-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
}

.mementor-tts-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 20px 20px;
    background: #fff;
    border-radius: 4px;
}

.mementor-tts-theme-block {
    grid-column: 1/-1;
}

.mementor-tts-section-header.api-missing-notice {
    background-color: #f3d9d9;
    border-bottom: 1px solid #dc3232!important;
    margin-bottom: 0px!important;
}

/* ======= Generate Link Styling ======= */
.mementor-tts-download-link,
.mementor-tts-generate-link,
.mementor-tts-delete-link {
    display: inline-block;
    margin-right: 5px;
    text-decoration: none;
    color: #2271b1;
    position: relative; /* Added for tooltip positioning */
}

.mementor-tts-generate-link {
    cursor: pointer;
    color: #2271b1;
    text-decoration: none;
}

.mementor-tts-generate-link:hover {
    color: #135e96;
    text-decoration: none;
}

.mementor-tts-delete-link {
    cursor: pointer;
    color: #2271b1;
    text-decoration: none;
}

.mementor-tts-delete-link:hover {
    color: #d63638; /* Red color on hover */
    text-decoration: none;
}

.mementor-tts-generate-link .dashicons {
    vertical-align: middle;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: -2px;
}

/* Post list tooltips */
.mementor-tts-download-link .tooltip-text,
.mementor-tts-generate-link .tooltip-text,
.mementor-tts-delete-link .tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 999999;
    width: 150px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Prevents tooltip from interfering with hover */
}

/* Add arrow to tooltips */
.mementor-tts-download-link .tooltip-text::after,
.mementor-tts-generate-link .tooltip-text::after,
.mementor-tts-delete-link .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Show tooltips on hover */
.mementor-tts-download-link:hover .tooltip-text,
.mementor-tts-generate-link:hover .tooltip-text,
.mementor-tts-delete-link:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.mementor-tts-done {
    color: #00a32a !important;
}

.mementor-tts-error {
    color: #d63638 !important;
}

.mementor-tts-spinning {
    animation: mementor-tts-spin 2s linear infinite;
}

@keyframes mementor-tts-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mementor-tts-not-published,
.mementor-tts-processing {
    color: #8c8f94;
    font-style: italic;
}

/* ======= Voice Card Styling ======= */
.mementor-tts-voice-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

.mementor-tts-voice-card-inner {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mementor-tts-voice-info {
    flex-grow: 1;
    margin-bottom: 15px;
}

.mementor-tts-voice-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.mementor-tts-voice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.mementor-tts-voice-gender,
.mementor-tts-voice-accent {
    background-color: #fbfbfb;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
}

.mementor-tts-voice-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mementor-tts-voice-preview-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #2271b1;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mementor-tts-voice-preview-btn:hover {
    background-color: #f0f0f1;
}

.mementor-tts-voice-select-btn {
    min-width: 80px;
}

.mementor-tts-voice-preview {
    margin-top: 30px;
}

.mementor-tts-voice-preview textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 15px;
}

/* ======= Upgrade Button Styling ======= */
.mementor-tts-upgrade-button {
    margin-bottom: -5px;
    left: 8px;
    padding: 12px !important;
    background-color: #dc3232 !important;
    border-color: #ff5252 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    text-transform: uppercase;
    box-shadow: none !important;
}

.mementor-tts-upgrade-button .dashicons {
    margin-right: 8px;
    margin-left: 8px;
    font-size: 18px;
    height: 18px;
    width: 18px;
    line-height: 1;
    color: #fff;
}

.mementor-tts-upgrade-button:hover,
.mementor-tts-upgrade-button:focus {
    background-color: #00a90e !important;
    border-color: #3882be !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.mementor-tts-upgrade-button:active {
    background-color: #ff3d3d !important;
    border-color: #ff2828 !important;
    transform: translateY(1px);
}

/* ======= Responsive Styles ======= */
@media screen and (min-width: 783px) {
    .mementor-tts-wrap {
        flex-direction: row;
    }
    
    .mementor-tts-main {
        flex: 2;
        max-width: 66%;
    }
    
    .mementor-tts-sidebar {
        flex: 1;
        max-width: 33%;
        /* Keep the same top value as the main rule */
        top: 32px;
    }
    
    .mementor-tts-features {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mementor-tts-pricing,
    .mementor-tts-testimonials {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mementor-tts-selectors-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media screen and (max-width: 1200px) {
    .mementor-tts-pro-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 782px) {
    #settings {
        display: block;
    }
    
    #settings > form {
        width: 100%;
        padding-right: 0;
    }
    
    #settings .mementor-tts-sidebar {
        width: 100%;
        /* Keep sticky positioning */
        position: sticky;
        margin-top: 30px;
        float: none;
    }
    
    .mementor-tts-toggle .slider {
        width: 36px;
        height: 18px;
    }
    
    .mementor-tts-toggle .slider:before {
        width: 14px;
        height: 14px;
    }
    
    .mementor-tts-toggle input:checked + label .slider:before {
        transform: translateX(18px);
    }
    
    .mementor-tts-toggle .label-text {
        font-size: 13px;
    }
    
    .button,
    .button-primary,
    .button-secondary {
        min-height: 40px;
        line-height: 2.5;
        padding: 0 14px;
    }
    
    .mementor-tts-pro-button {
        padding: 12px 24px;
        display: block;
        text-align: center;
    }
    
    .mementor-tts-player-grid {
        grid-template-columns: 1fr;
    }
    
    .mementor-tts-blocks-container,
    .mementor-tts-controls-grid,
    .mementor-tts-layout-grid,
    .mementor-tts-playback-grid,
    .mementor-tts-theme-colors {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mementor-tts-block.full-width,
    .mementor-tts-blocks-container {
        padding: 15px 10px;
    }
    
    .mementor-tts-blocks-container.mnopadding {
        padding: 0;
    }
    
    .mementor-tts-toggle {
        padding: 12px;
    }
    
    .mementor-tts-preview-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mementor-tts-preview-actions h2 {
        margin-bottom: 10px !important;
        font-size: 16px;
    }
    
    .mementor-tts-preview-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .mementor-tts-sticky-preview {
        margin-bottom: 60px;
    }
    
    .mementor-tts-preview-header {
        padding: 12px 15px;
    }
    
    .mementor-tts-preview-player-padding {
        padding: 15px;
    }
    
    .mementor-tts-subtabs {
        flex-direction: column;
        gap: 5px;
        border-bottom: none;
    }
    
    .mementor-tts-subtab {
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 0;
        text-align: center;
    }
    
    .mementor-tts-subtab.active {
        border-bottom: 1px solid #ddd;
        background: #2271b1;
        color: #fff;
    }
    
    .mementor-tts-block .tooltip-text {
        width: 200px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .label-settings .width-10,
    .label-settings .width-100,
    .label-settings .width-15,
    .label-settings .width-20,
    .label-settings .width-25,
    .label-settings .width-30,
    .label-settings .width-33,
    .label-settings .width-50,
    .label-settings .width-66,
    .label-settings .width-75,
    .label-settings .width-80,
    .width-100,
    .width-15,
    .width-20,
    .width-25,
    .width-30,
    .width-33,
    .width-50,
    .width-66,
    .width-75,
    .width-80 {
        grid-column: span 1;
    }
    
    .mementor-tts-controls {
        flex-direction: column;
    }
    
    .mementor-tts-toggle {
        flex: none;
        width: 100%;
    }
    
    .label-settings .mementor-tts-blocks-container,
    .mementor-tts-blocks-container {
        grid-template-columns: 1fr;
    }
    
    .label-settings {
        padding: 15px;
    }
    
    .mementor-tts-license-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mementor-tts-license-form button {
        margin-top: 10px;
    }
    
    .mementor-tts-pro-features-grid {
        grid-template-columns: 1fr;
    }
    
    .mementor-tts-pro-feature-notice p {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mementor-tts-pro-feature-notice .button {
        margin-left: 0;
        margin-top: 10px;
    }
        
    .mementor-tts-nav-item {
        border-right: none;
        border-bottom: 1px solid #c3c4c7;
    }
    
    .mementor-tts-nav-item:last-child {
        border-bottom: none;
    }
    
    .mementor-tts-notification {
        top: 46px;
        max-width: 300px;
    }
      
    .mementor-tts-section-content {
        padding: 16px;
    }
    
    .mementor-tts-blocks-container {
        flex-direction: column;
    }
    
    .mementor-tts-block,
    .mementor-tts-block.width-30,
    .mementor-tts-block.width-33,
    .mementor-tts-block.width-50,
    .mementor-tts-block.width-70 {
        flex: 0 0 100%;
    }
    
    .mementor-tts-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .mementor-tts-stat-box {
        padding: 15px;
    }
    
    .mementor-tts-stat-box .stat-value {
        font-size: 20px;
    }
    
    .mementor-tts-additional-info {
        padding: 15px;
    }
    
    .mementor-tts-license-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Label Settings Styling */
.label-settings {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.label-settings .mementor-tts-blocks-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

/* First row */
.label-settings .mementor-tts-block.show-label {
    grid-column: span 4;
}

.label-settings .mementor-tts-block.label-text {
    grid-column: span 8;
}

/* Second row */
.label-settings .mementor-tts-block.position {
    grid-column: span 2;
}

.label-settings .mementor-tts-block.spacing {
    grid-column: span 2;
}

.label-settings .mementor-tts-block.size {
    grid-column: span 2;
}

.label-settings .mementor-tts-block.weight {
    grid-column: span 2;
}

.label-settings .mementor-tts-block.text-color {
    grid-column: span 4;
}

.label-settings .mementor-tts-block {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e4e7;
    transition: all 0.2s ease;
    margin: 0;
    box-shadow: none;
}

.label-settings .mementor-tts-block:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .label-settings .mementor-tts-blocks-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .label-settings .mementor-tts-block,
    .label-settings .mementor-tts-block.show-label,
    .label-settings .mementor-tts-block.label-text,
    .label-settings .mementor-tts-block.position,
    .label-settings .mementor-tts-block.spacing,
    .label-settings .mementor-tts-block.size,
    .label-settings .mementor-tts-block.weight,
    .label-settings .mementor-tts-block.text-color {
        grid-column: span 1;
    }
}

.mementor-tts-voice-name {
    text-align: left;
    padding-left: 15px;
}

.mementor-tts-voice-name-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.mementor-tts-voice-name-header .dashicons-info-outline {
    cursor: pointer;
    color: #2271b1;
    font-size: 16px;
    margin-left: 6px;
    position: relative;
    transition: opacity 0.2s ease;
}

.mementor-tts-voice-name-header .dashicons-info-outline:hover {
    opacity: 0.8;
}

.mementor-tts-voice-name-header .dashicons-info-outline:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: normal;
    white-space: normal;
    width: max-content;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: tooltipFadeIn 0.2s ease-out;
    pointer-events: none;
}

.mementor-tts-voice-name-header .dashicons-info-outline:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #2271b1 transparent transparent transparent;
    z-index: 1000;
    animation: tooltipFadeIn 0.2s ease-out;
    pointer-events: none;
}

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

/* ======= Settings Page Grid Layout ======= */
/* Clear all previous styles */
.wrap > .mementor-tts-section.width-65,
.wrap > .mementor-tts-section.width-35,
.wrap form,
.wrap form .mementor-tts-section {
    margin: 0 0 20px 0;
    padding: 0;
    box-sizing: border-box;
}

/* Left column */
.wrap > .mementor-tts-section.width-65,
body.mementor-tts-settings-page .wrap form {
    width: 65%;
    float: left;
    clear: left;
}

/* Right column */
.wrap > .mementor-tts-section.width-35 {
    width: 33%;
    float: right;
}

/* Make form sections take full width of their container */
body.mementor-tts-settings-page .wrap form .mementor-tts-section {
    width: 100%;
}

/* Make Storage section and other non-API sections take full width */
body.mementor-tts-settings-page .wrap form .mementor-tts-section:not(.width-65) {
    width: 100%;
    clear: both;
}

/* Fix for the Save Settings button */
body.mementor-tts-settings-page .wrap form > p > input#submit-settings,
body.mementor-tts-settings-page .wrap form > input#submit-settings,
body.mementor-tts-settings-page .wrap form > p:last-child > input.button-primary {
    display: block;
    margin-top: 20px;
    float: right;
    clear: both;
}

/* Hide the button from its current position */
body.mementor-tts-settings-page .wrap form > p.submit {
    display: none;
}

/* Create a new button at the bottom */
body.mementor-tts-settings-page .wrap form::after {
    content: "";
    display: block;
    clear: both;
}

/* Add a custom Save Settings button at the bottom */
body.mementor-tts-settings-page .wrap form + .save-settings-container {
    clear: both;
    display: block;
    margin-top: 20px;
    text-align: right;
}

body.mementor-tts-settings-page input[type=text] {
    width: 90%;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .wrap > .mementor-tts-section.width-65,
    .wrap > .mementor-tts-section.width-35,
    body.mementor-tts-settings-page .wrap form,
    body.mementor-tts-settings-page .wrap form .mementor-tts-section {
        width: 100%;
        float: none;
    }
}

/* ======= Sidebar Upgrade Section Styling ======= */
.mementor-tts-sidebar .mementor-tts-license-cta {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 25px 20px;
    margin: 0 0 20px;
    text-align: center;
    color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mementor-tts-sidebar .mementor-tts-license-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,0 L100,100 M20,0 L100,80 M40,0 L100,60 M60,0 L100,40 M80,0 L100,20 M0,20 L80,100 M0,40 L60,100 M0,60 L40,100 M0,80 L20,100" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></svg>');
    background-size: 30px 30px;
    opacity: 0.3;
    z-index: 0;
}

.mementor-tts-sidebar .mementor-tts-license-cta h2 {
    color: #ffffff;
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    width: 100%;
}

.mementor-tts-sidebar .mementor-tts-license-cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 15px;
    font-weight: 400;
    position: relative;
    z-index: 1;
    width: 100%;
}

.mementor-tts-sidebar .mementor-tts-license-cta strong {
    color: #ffffff;
    font-weight: 700;
}

.mementor-tts-sidebar .mementor-tts-license-cta .button-primary,
.mementor-tts-sidebar .mementor-tts-upgrade-button,
.mementor-tts-sidebar .mementor-tts-pro-button {
    background: linear-gradient(to right, #ffffff, #f0f0f0) !important;
    color: #2271b1 !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    width: 100% !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    text-align: center !important;
    cursor: pointer !important;
    transform: translateY(0) !important;
}

.mementor-tts-sidebar .mementor-tts-license-cta .button-primary:hover,
.mementor-tts-sidebar .mementor-tts-upgrade-button:hover,
.mementor-tts-sidebar .mementor-tts-pro-button:hover {
    background: linear-gradient(to right, #f0f0f0, #ffffff) !important;
    color: #135e96 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2) !important;
}

.mementor-tts-sidebar .mementor-tts-license-cta .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Highlight badge */
.mementor-tts-sidebar .mementor-tts-license-cta .highlight-badge {
    position: absolute;
    top: 6px;
    right: 0px;
    background-color: #dc3232;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 30px;
    transform: rotate(12deg);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid white;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% {
        transform: rotate(12deg) scale(1);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: rotate(12deg) scale(1.1);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: rotate(12deg) scale(1);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    }
}

/* Feature list styling */
.mementor-tts-sidebar .mementor-tts-license-cta .feature-list {
    text-align: center;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    width: 300px;
    position: relative;
    z-index: 1;
    display: inline-block;
}

.mementor-tts-sidebar .mementor-tts-license-cta .feature-list li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    text-align: left;
    line-height: 1.4;
}

.mementor-tts-sidebar .mementor-tts-license-cta .feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
}

.mementor-tts-sidebar .mementor-tts-license-cta .button-primary,
.mementor-tts-sidebar .mementor-tts-upgrade-button,
.mementor-tts-sidebar .mementor-tts-pro-button {
    background: linear-gradient(to right, #ffffff, #f0f0f0) !important;
    color: #2271b1 !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    width: 100% !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    text-align: center !important;
    cursor: pointer !important;
    transform: translateY(0) !important;
}

.mementor-tts-sidebar .mementor-tts-upgrade-button {
    left: 0px !important;
}

.mementor-tts-sidebar .mementor-tts-license-cta .button-primary:hover,
.mementor-tts-sidebar .mementor-tts-upgrade-button:hover,
.mementor-tts-sidebar .mementor-tts-pro-button:hover {
    background: linear-gradient(to right, #f0f0f0, #ffffff) !important;
    color: #135e96 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2) !important;
}

.mementor-tts-sidebar .mementor-tts-license-cta .button-primary:active,
.mementor-tts-sidebar .mementor-tts-upgrade-button:active,
.mementor-tts-sidebar .mementor-tts-pro-button:active {
    transform: translateY(1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.mementor-tts-sidebar .mementor-tts-license-cta .button-wrapper {
    position: relative;
    width: 85%;
    max-width: 300px;
    margin: 15px auto 0 auto;
    text-align: center;
}

.mementor-tts-sidebar .mementor-tts-license-cta .expiration-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    display: block;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
    position: relative;
    z-index: 1;
}

/* PRO Sidebar Styles */
.mementor-tts-sidebar .mementor-tts-sidebar-box {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    padding: 20px;
    position: relative;
}

.mementor-tts-sidebar .mementor-tts-sidebar-box h2 {
    color: #1d2327;
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f1;
}

.mementor-tts-resources-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.mementor-tts-resources-list li {
    margin-bottom: 12px;
    padding-left: 5px;
}

.mementor-tts-resources-list li:last-child {
    margin-bottom: 0;
}

.mementor-tts-resources-list .dashicons {
    margin-right: 8px;
    color: #2271b1;
    vertical-align: middle;
}

.mementor-tts-resources-list a {
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
    transition: color 0.2s ease;
}

.mementor-tts-resources-list a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Usage Statistics Styles */
.mementor-tts-progress-wrapper {
    margin: 15px 0;
}

.mementor-tts-progress {
    background-color: #f0f0f1;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.mementor-tts-progress-bar {
    height: 100%;
    background-color: #2271b1;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.mementor-tts-progress-wrapper span {
    display: block;
    font-size: 13px;
    color: #50575e;
    text-align: right;
}

.mementor-tts-sidebar-box .button {
    display: inline-block;
    margin-top: 10px;
    text-align: center;
}

/* Statistics Page Header */
.statistics-page-active .mementor-tts-section-header {
    flex-direction: row;
    align-items: center;
}

.statistics-page-active .mementor-tts-section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0 !important;
}

/* Removed duplicate upgrade button styles - consolidated at line ~2948 */

.mementor-tts-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mementor-tts-header-flex h2 {
    margin: 0;
}

.mementor-tts-header-flex .button-primary {
    margin-left: 15px;
}

/* Save Button Container */
.mementor-tts-save-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: right;
    border-top: 1px solid #e5e5e5;
}

.mementor-tts-save-container .button-primary {
    padding: 5px 20px;
    font-size: 14px;
    height: auto;
    line-height: 30px;
}

.mementor-tts-save-container .dashicons {
    margin-right: 5px;
    font-size: 18px;
    line-height: 30px;
}

/* Style for disabled content when API key is missing */
.mementor-tts-settings-content {
    /* Completely removing these styles to unlock all sections */
}

.mementor-tts-pro-notice {
    background-color: rgb(243, 217, 217);
    border-left: 5px solid #dc3232;
    border-right: 1px solid #dc3232;
    border-bottom: 1px solid #dc3232;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    margin: 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.dashicons-flag:before {
    color: #dc3232;
}

.mementor-tts-pro-notice p {
    text-align: center;
    margin: 0;
    padding: 0;
    color: #1d2327;
    font-size: 16px;
}

/* Ensure blocks container is also disabled when API key is missing */
.mementor-tts-blocks-container.mementor-tts-settings-content {
    /* Completely removing these styles to unlock all sections */
}

.mementor-tts-dropdown-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #757575;
    font-size: 20px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.mementor-tts-selection-box:focus .mementor-tts-dropdown-indicator,
.mementor-tts-selection-box:active .mementor-tts-dropdown-indicator {
    transform: translateY(-50%) rotate(180deg);
}

/* Modern Custom Notifications */
.mementor-tts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mementor-tts-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mementor-tts-modal {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    padding: 0;
    position: relative;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.mementor-tts-modal-overlay.active .mementor-tts-modal {
    transform: translateY(0) scale(1);
}

.mementor-tts-modal-header {
    background-color: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e4e7;
    display: flex;
    align-items: center;
}

.mementor-tts-modal-header .dashicons {
    margin-right: 15px;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.mementor-tts-modal-header.warning .dashicons {
    color: #f0b849;
}

.mementor-tts-modal-header.error .dashicons {
    color: #cc1818;
}

.mementor-tts-modal-header.success .dashicons {
    color: #46b450;
}

.mementor-tts-modal-header.info .dashicons {
    color: #2271b1;
}

.mementor-tts-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.mementor-tts-modal-content {
    padding: 25px;
    font-size: 16px;
    line-height: 1.6;
}

.mementor-tts-modal-actions {
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #e2e4e7;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.mementor-tts-modal-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mementor-tts-modal-btn-primary {
    background-color: #2271b1;
    color: #fff;
    border: none;
}

.mementor-tts-modal-btn-primary:hover {
    background-color: #135e96;
    color: #fff;
}

.mementor-tts-modal-btn-secondary {
    background-color: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.mementor-tts-modal-btn-secondary:hover {
    background-color: #e0e0e0;
    color: #2c3338;
}

.mementor-tts-modal-btn-danger {
    background-color: #cc1818;
    color: #fff;
    border: none;
}

.mementor-tts-modal-btn-danger:hover {
    background-color: #b32d2e;
    color: #fff;
}

/* ======= Modal Dialog System ======= */
.mementor-tts-confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mementor-tts-confirm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mementor-tts-confirm-modal {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.mementor-tts-confirm-modal-overlay.active .mementor-tts-confirm-modal {
    transform: scale(1);
}

.mementor-tts-confirm-modal-header {
    display: flex;
    align-items: center;
    padding: 5px 25px 0px 25px;
    border-bottom: 1px solid #f0f0f1;
}

.button .dashicons {
    margin: 4px 5px 0 0;
}

.mementor-tts-confirm-modal-header .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    margin-right: 15px;
    color: #3c434a;
}

.mementor-tts-confirm-modal-header.warning .dashicons {
    color: #f0b849;
}

.mementor-tts-confirm-modal-header.error .dashicons {
    color: #d63638;
}

.mementor-tts-confirm-modal-header.success .dashicons {
    color: #00a32a;
}

.mementor-tts-confirm-modal-header.info .dashicons {
    color: #72aee6;
}

.button.mementor-tts-reset-api-key {
    background-color: #f0f0f1;
    color: #cc1818;
    border-color: #cc1818;
    padding: 5px 15px;
    font-weight: 500;
    width: 178px;
    border-radius: 4px;
}

.button.mementor-tts-reset-api-key:hover {
    background-color: #fafafa;
    color: #2271b1;
    border-color: #2271b1;
}

.button.mementor-tts-reset-api-key .dashicons-trash {
    margin: 4px 5px 0 0;
}

.mementor-tts-confirm-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.mementor-tts-confirm-modal-content {
    padding: 10px 25px 5px 25px;
}
.mementor-tts-confirm-modal-content p {
    font-size: 17px;
    line-height: 1.4;
}

.mementor-tts-confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding: 15px 25px 25px;
    gap: 10px;
}

.mementor-tts-confirm-modal-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.mementor-tts-confirm-modal-btn-primary {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.mementor-tts-confirm-modal-btn-primary:hover {
    background-color: #135e96;
    border-color: #135e96;
}

.mementor-tts-confirm-modal-btn-secondary {
    background-color: #f6f7f7;
    color: #2c3338;
    border-color: #c3c4c7;
}

.mementor-tts-confirm-modal-btn-secondary:hover {
    background-color: #f0f0f1;
    border-color: #8c8f94;
}

.mementor-tts-confirm-modal-btn-danger {
    background-color: #d63638;
    color: #fff;
    border-color: #d63638;
}

.mementor-tts-confirm-modal-btn-danger:hover {
    background-color: #b32d2e;
    border-color: #b32d2e;
}

/* Responsive styles for modal */
@media screen and (max-width: 782px) {
    .mementor-tts-confirm-modal {
        width: 95%;
        max-width: none;
    }
    
    .mementor-tts-confirm-modal-header {
        padding: 15px 20px 10px;
    }
    
    .mementor-tts-confirm-modal-content {
        padding: 15px 20px;
    }
    
    .mementor-tts-confirm-modal-actions {
        padding: 10px 20px 20px;
        flex-direction: column;
    }
    
    .mementor-tts-confirm-modal-btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* ======= Demo Modal Enhanced Styling ======= */
.mementor-tts-demo-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    max-width: 520px;
    animation: modalSlideIn 0.4s ease-out;
}

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

.mementor-tts-demo-modal .mementor-tts-confirm-modal-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 30px 15px;
    backdrop-filter: blur(10px);
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-header .dashicons {
    color: #ffd700;
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-right: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #ffe42c;
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-content {
    padding: 25px 30px 20px;
    background: rgba(255, 255, 255, 0.05);
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-content p {
    font-size: 16px !important;
    line-height: 1.6;
    margin: 0 0 15px 0;
    padding: 10px 30px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-content p:last-child {
    margin-bottom: 0;
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-content p strong {
    color: #ffd700;
    font-weight: 600;
}

.mementor-tts-demo-modal .mementor-tts-confirm-modal-actions {
    padding: 20px 30px 30px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.mementor-tts-demo-modal .button {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    width: 100%;
}

.mementor-tts-demo-modal .button:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    color: #222;
}

.mementor-tts-demo-modal .button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* Responsive adjustments for demo modal */
@media (max-width: 768px) {
    .mementor-tts-demo-modal {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .mementor-tts-demo-modal .mementor-tts-confirm-modal-header,
    .mementor-tts-demo-modal .mementor-tts-confirm-modal-content,
    .mementor-tts-demo-modal .mementor-tts-confirm-modal-actions {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .mementor-tts-demo-modal .mementor-tts-confirm-modal-title {
        font-size: 20px;
    }
    
    .mementor-tts-demo-modal .mementor-tts-confirm-modal-content p {
        font-size: 16px !important;
        padding: 10px 20px;
    }
}

/* Reset API button styles */
.button.mementor-tts-reset-api-key {
    background-color: #f0f0f1;
    color: #cc1818;
    border-color: #cc1818;
    padding: 5px 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.button.mementor-tts-reset-api-key:hover {
    background-color: #f6f7f7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.button.mementor-tts-reset-api-key.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f6f7f7;
}

.button.mementor-tts-reset-api-key .dashicons-update-alt {
    animation: reset-spin 1.5s linear infinite;
    display: inline-block;
    margin-right: 5px;
}

@keyframes reset-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success animation for reset */
.mementor-tts-reset-success {
    animation: reset-success-pulse 1.5s ease-in-out;
}

@keyframes reset-success-pulse {
    0% { background-color: rgba(0, 163, 42, 0.1); }
    50% { background-color: rgba(0, 163, 42, 0.2); }
    100% { background-color: transparent; }
}

/* API Key Section Styles */
.mementor-tts-api-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mementor-tts-api-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 10px;
    vertical-align: middle;
}

.mementor-tts-api-status.connected {
    background-color: rgba(0, 163, 42, 0.1);
    color: #00a32a;
}

.mementor-tts-api-status.not-connected {
    background-color: rgba(214, 54, 56, 0.1);
    color: #d63638;
}

#toggle-api-key {
    background-color: #f0f0f1;
    border-color: #8c8f94;
    color: #3c434a;
    transition: all 0.2s ease;
}

#toggle-api-key:hover {
    background-color: #f6f7f7;
    border-color: #50575e;
}

.mementor-tts-voice-table td:first-child {
    text-align: center;
    padding-left: 20px;
    padding-right: 10px;
}

/* Submit button wrapper */
.mementor-tts-submit-wrapper {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border: 1px solid var(--mementor-tts-admin-border);
    border-radius: 4px;
    text-align: center;
}

.mementor-tts-submit-wrapper .button-primary {
    min-width: 200px;
    padding: 8px 20px;
    font-size: 15px;
    height: auto;
}

.mementor-tts-submit-wrapper .description {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* Uninstall Options */
.mementor-tts-uninstall-options {
    margin-bottom: 20px;
}

.mementor-tts-setting-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.mementor-tts-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.mementor-tts-radio-option {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.mementor-tts-radio-option:hover {
    background-color: #f9f9f9;
}

.mementor-tts-radio-option input[type="radio"] {
    margin-top: 3px;
    margin-right: 10px;
}

.mementor-tts-radio-option label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 100%;
}

.mementor-tts-radio-option strong {
    margin-bottom: 5px;
}

.mementor-tts-radio-option .description {
    font-weight: normal;
    color: #666;
}

.mementor-tts-radio-option input[type="radio"]:checked + label {
    color: #2271b1;
}

.mementor-tts-radio-option input[type="radio"]:checked + label strong {
    color: #2271b1;
}

.mementor-tts-warning {
    color: #d63638;
    font-style: italic;
}

/* Upgrade link in API notice */
.mementor-tts-upgrade-link {
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    padding: 2px 5px;
    border-radius: 3px;
    background-color: rgba(34, 113, 177, 0.1);
    transition: all 0.2s ease;
}

.mementor-tts-upgrade-link:hover {
    color: #135e96;
    background-color: rgba(34, 113, 177, 0.2);
    text-decoration: none;
}

/* Upgrade button in API notice */
.mementor-tts-pro-notice .mementor-tts-upgrade-button {
    display: inline;
    font-weight: normal;
    color: #2271b1;
    text-decoration: underline;
    padding: 0;
    border-radius: 0;
    background-color: transparent;
    transition: all 0.2s ease;
    border: none;
    box-shadow: none;
    height: auto;
    line-height: inherit;
}

.mementor-tts-pro-notice .mementor-tts-upgrade-button:hover {
    color: #135e96;
    background-color: transparent;
    text-decoration: underline;
}

/* Normal link style - removes all button styling */
.normal-link {
    display: inline !important;
    font-weight: normal !important;
    color: #2271b1 !important;
    text-decoration: underline !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: inherit !important;
    min-width: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: inherit !important;
}

.normal-link:hover, 
.normal-link:focus, 
.normal-link:active {
    color: #135e96 !important;
    background: transparent !important;
    text-decoration: underline !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Logo icon in post list */
.mementor-tts-logo-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

/* Animated Notifications */
.mementor-tts-notification {
    position: fixed;
    top: 32px; /* Account for WP admin bar */
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s ease-in-out;
    max-width: 90%;
    width: auto;
    display: inline-block;
    text-align: center;
    font-weight: 500;
}

.mementor-tts-notification.success {
    background-color: #46b450;
    color: white;
}

.mementor-tts-notification.error {
    background-color: #dc3232;
    color: white;
}

.mementor-tts-notification.warning {
    background-color: #fff;
    color: #32373c;
    border-left: 4px solid #dba617;
}

.mementor-tts-notification.info {
    background-color: #00a0d2;
    color: white;
}

.mementor-tts-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* Adjust for smaller screens */
@media screen and (max-width: 782px) {
    .mementor-tts-notification {
        top: 46px; /* WP admin bar is taller on mobile */
    }
}

/* Adjust for when admin bar is not present */
body:not(.admin-bar) .mementor-tts-notification {
    top: 0;
}

/* TTS Column Styles moved to admin/css/mementor-tts-admin-columns.css (single source of truth) */

/* Spinner animation for AJAX operations */
.mementor-tts-spin {
    animation: mementor-tts-spin 2s linear infinite;
}

@keyframes mementor-tts-spin {
    100% { 
        transform: rotate(360deg);
    }
}

.mementor-tts-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.mementor-tts-input-group input[type="number"] {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 30px;
    padding: 4px 8px;
}

.mementor-tts-input-group select {
    width: auto;
    min-width: 60px;
    height: 30px;
}

/* Ensure consistent height for all form controls */
.mementor-tts-select,
.mementor-tts-input,
input[type="number"].small-text {
    height: 30px;
    padding: 4px 8px;
    line-height: 1.4;
}

/* Block styles for width settings */
.mementor-tts-blocks-container .mementor-tts-block {
    padding: 15px;
    margin: 0;
}

.mementor-tts-blocks-container .mementor-tts-block label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Remove extra padding for nested containers */
.mementor-tts-blocks-container.mnopadding {
    padding: 0;
    gap: 10px;
}

/* Ensure proper spacing between blocks */
.mementor-tts-block.width-33 {
    margin: 0;
    padding: 10px;
}

/* Responsive styles */
@media screen and (max-width: 782px) {
    .mementor-tts-input-group {
        flex-wrap: nowrap;
    }
    
    .mementor-tts-input-group input[type="number"],
    .mementor-tts-input-group select {
        height: 40px;
    }
}

/* Ensure consistent width for API key input */
#mementor_tts_api_key {
    width: 100%;
    max-width: 370px;
    box-sizing: border-box;
}

/* Modal fadeOut animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ======= Modern Card Layout System ======= */
/* Reusable card layout based on mementor-tts-api-settings-card */
.mementor-tts-default-card-layout,
.mementor-tts-settings-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Prevent cards from overflowing their container */
    min-width: 0;
}

.mementor-tts-default-card-layout:hover,
.mementor-tts-settings-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ======= Modern Settings Grid ======= */
.mementor-tts-modern-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Ensure it fits within WordPress admin container */
    container-type: inline-size;
}

/* Explicit 3-column grid */
.mementor-tts-modern-settings-grid.mementor-tts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Explicit 2-column grid */
.mementor-tts-modern-settings-grid.mementor-tts-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Responsive: 3-column becomes 2-column, then 1-column */
@media (max-width: 1400px) {
    .mementor-tts-modern-settings-grid.mementor-tts-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1000px) {
    .mementor-tts-modern-settings-grid.mementor-tts-grid-3,
    .mementor-tts-modern-settings-grid.mementor-tts-grid-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Ensure default grid doesn't overflow WordPress admin container */
@media (max-width: 1200px) {
    .mementor-tts-modern-settings-grid:not(.mementor-tts-grid-2):not(.mementor-tts-grid-3) {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .mementor-tts-modern-settings-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

/* ======= Card Header ======= */
.mementor-tts-card-header {
    background: linear-gradient(135deg, #f6f7f7 0%, #f0f0f1 100%);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.mementor-tts-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mementor-tts-card-icon .dashicons {
    font-size: 20px;
    color: #2271b1;
}

.mementor-tts-card-title {
    flex: 1;
}

.mementor-tts-card-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #1d2327;
    font-weight: 600;
    line-height: 1.2;
}

.mementor-tts-card-title p {
    margin: 0;
    font-size: 13px;
    color: #646970;
    line-height: 1.3;
}

/* ======= Card Content ======= */
.mementor-tts-card-content {
    padding: 25px;
}

/* ======= Toggle Settings ======= */
.mementor-tts-toggle-setting {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.mementor-tts-toggle-info {
    flex: 1;
}

.mementor-tts-toggle-label {
    display: block;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.mementor-tts-toggle-description {
    font-size: 13px;
    color: #646970;
    line-height: 1.4;
    display: block;
}

.mementor-tts-toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ======= Toggle Switch Styling ======= */
.mementor-tts-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mementor-tts-toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: #ccd0d4;
    border-radius: 26px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mementor-tts-toggle-slider:hover {
    background-color: #a7aaad;
}

.mementor-tts-toggle-button {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mementor-tts-toggle-input:checked + .mementor-tts-toggle-slider {
    background-color: #2271b1;
}

.mementor-tts-toggle-input:checked + .mementor-tts-toggle-slider:hover {
    background-color: #135e96;
}

.mementor-tts-toggle-input:checked + .mementor-tts-toggle-slider .mementor-tts-toggle-button {
    transform: translateX(24px);
}

.mementor-tts-toggle-input:disabled + .mementor-tts-toggle-slider {
    background-color: #f0f0f1;
    cursor: not-allowed;
    opacity: 0.6;
}

.mementor-tts-toggle-input:disabled + .mementor-tts-toggle-slider:hover {
    background-color: #f0f0f1;
}

/* ======= Toggle Container ======= */
.mementor-tts-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.mementor-tts-toggle-switch {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mementor-tts-toggle-label {
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.mementor-tts-toggle-container .mementor-tts-toggle-label {
    margin-top: -15px;
}

/* ======= Post Types Form Buttons ======= */
.mementor-tts-section .post-types-form .submit,
.mementor-tts-section .mementor-tts-selector-field .submit {
    margin-top: 20px !important;
}

/* ======= PRO Badge ======= */
.mementor-tts-pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: linear-gradient(135deg, #7854E4 0%, #9378f0 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(120, 84, 228, 0.3);
}

/* ======= Info Box ======= */
.mementor-tts-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-top: 15px;
}

.mementor-tts-info-box .dashicons {
    color: #2271b1;
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.mementor-tts-info-box div {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.mementor-tts-info-box strong {
    color: #1d2327;
    font-weight: 600;
}

.mementor-tts-info-box code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #d63638;
    border: 1px solid #e9ecef;
}

/* ======= Card Footer ======= */
.mementor-tts-card-footer {
    padding: 20px 25px;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.mementor-tts-compact-button {
    padding: 8px 16px !important;
    font-size: 13px !important;
    height: auto !important;
    line-height: 1.4 !important;
    border-radius: 6px !important;
}

/* ======= Responsive Design ======= */
@media (max-width: 1024px) {
    .mementor-tts-toggle-setting {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .mementor-tts-toggle-switch {
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .mementor-tts-card-header {
        padding: 15px 20px;
        gap: 12px;
    }
    
    .mementor-tts-card-content {
        padding: 20px;
    }
    
    .mementor-tts-card-footer {
        padding: 15px 20px;
    }
    
    .mementor-tts-card-icon {
        width: 36px;
        height: 36px;
    }
    
    .mementor-tts-card-icon .dashicons {
        font-size: 18px;
    }
    
    .mementor-tts-card-title h3 {
        font-size: 16px;
    }
}

/* PRO License Notice Styling - Improve appearance */
body[class*="text-to-speech-tts"] .notice {
    margin: 15px 20px 15px 2px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    clear: both;
}

/* Prevent duplicate identical notices */
body[class*="text-to-speech-tts"] .notice + .notice[class="notice notice-warning is-dismissible"] {
    display: none; /* Hide duplicate license notices */
}

/* Style license-related notices */
body[class*="text-to-speech-tts"] .notice-warning {
    background-color: #fcf9e8;
    border-left-color: #f0b849;
    padding: 12px;
}

/* Make license notice more prominent but cleaner */
body[class*="text-to-speech-tts"] .notice-warning a {
    font-weight: 600;
    text-decoration: none;
}

/* Ensure proper spacing after navigation */
.mementor-tts-admin-nav + .notice,
.mementor-tts-admin-nav ~ .notice {
    margin-top: 20px !important;
}

/* Style the license notification better */
.mementor-tts-notification.warning .mementor-tts-notification-content {
    padding: 15px;
    line-height: 1.8;
    text-align: left !important;
}

/* Prevent duplicate notifications */
.mementor-tts-notification.warning + .mementor-tts-notification.warning {
    display: none;
}

/* Format license notification content properly */
body[class*="text-to-speech-tts"] .mementor-tts-notification.warning {
    margin: 20px 0;
    clear: both;
}

/* Style the activate button */
.mementor-tts-notification.warning a {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    text-decoration: none;
    background: #2271b1;
    color: #fff !important;
    padding: 6px 12px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.mementor-tts-notification.warning a:hover {
    background: #135e96;
    transform: translateY(-1px);
}

/* Fix notice positioning on TTS pages */
.toplevel_page_text-to-speech-tts .notice,
.text-to-speech-tts_page_text-to-speech-tts-settings .notice {
    position: relative;
    top: auto;
    margin-left: 2px;
    margin-right: 20px;
}

/* ──────────────────────────────────────────────
   BYOK (ElevenLabs) status + hint components
   Used on Overview (Quick Stats) and Account pages.
   Renders 3 states: no key (Hint!), key invalid (error), key valid (connected + credits).
   ────────────────────────────────────────────── */

/* Shared row layout for the connected/invalid status line */
.tts-byok-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tts-border-color);
}
.tts-byok-row-group  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tts-byok-row > .tts-byok-credits,
.tts-byok-row > .tts-byok-link { margin-left: auto; }
.tts-byok-tier     { font-size: 12px; color: var(--tts-text-secondary); }
.tts-byok-note     { font-size: 12px; color: var(--tts-text-secondary); white-space: nowrap; }
.tts-byok-note a   { color: var(--tts-purple); text-decoration: none; font-weight: 500; }
.tts-byok-note a:hover { text-decoration: underline; }

/* "Update key →" action link */
.tts-byok-link {
    font-size: 13px;
    color: var(--tts-purple);
    text-decoration: none;
    font-weight: 500;
}
.tts-byok-link:hover { text-decoration: underline; }

/* Monthly credits figure */
.tts-byok-credits       { font-size: 13px; color: var(--tts-text-primary); }
.tts-byok-credits-label { color: var(--tts-text-secondary); }
.tts-byok-credits-reset { color: var(--tts-text-secondary); }

/* Hint! callout — shown when no BYOK key is stored */
.tts-byok-hint {
    margin-top: 12px;
    padding: 14px 16px;
    background: #f3f0ff;
    border: 1px solid #e0d9ff;
    border-radius: 8px;
}
.tts-byok-hint--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.tts-byok-hint-lead {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 240px;
    margin-bottom: 0;
}
.tts-byok-hint--stack .tts-byok-hint-lead { margin-bottom: 6px; }

/* Stack variant: two-column grid. The CTA sits on the RIGHT of the lead
   (Hint badge + headline), on the same row. The description spans the full
   width beneath both columns. */
.tts-byok-hint--stack {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        'lead  btn'
        'desc  desc';
    column-gap: 16px;
    row-gap: 6px;
    align-items: center;
}
.tts-byok-hint--stack .tts-byok-hint-lead { grid-area: lead; margin-bottom: 0; }
.tts-byok-hint--stack .tts-byok-hint-desc { grid-area: desc; margin-bottom: 0; }
.tts-byok-hint--stack .tts-btn-primary    { grid-area: btn;  align-self: center; margin-top: 0; }

/* Narrow screens: fall back to stacked layout with the button below. */
@media (max-width: 640px) {
    .tts-byok-hint--stack {
        grid-template-columns: 1fr;
        grid-template-areas:
            'lead'
            'desc'
            'btn';
    }
    .tts-byok-hint--stack .tts-btn-primary { justify-self: start; margin-top: 4px; }
}
.tts-byok-hint-badge {
    background: var(--tts-purple);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 10px;
    flex-shrink: 0;
}
.tts-byok-hint-text {
    font-size: 13px;
    color: var(--tts-text-primary);
    line-height: 1.4;
}
.tts-byok-hint-desc {
    line-height: 1.5;
    margin: 0 0 8px;
}

/* CTA button inside the Hint card — normalize line-height and padding so it
   matches the "Manage plan & credits" button in the card header. Without these
   overrides the button renders visibly smaller than other `.tts-btn-primary`
   instances because anchors inherit WP admin's tighter line-height. */
.tts-byok-hint .tts-btn-primary {
    padding: 7px 16px;
    line-height: 1.4;
    margin-top: 4px;
}

/* Account page variant — green confirmation block around the status row */
.tts-byok-account {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--tts-radius-md, 8px);
    margin-bottom: 16px;
}
.tts-byok-account > .tts-byok-row-group { flex-shrink: 0; }
.tts-byok-account > .tts-byok-credits,
.tts-byok-account > .tts-byok-link { margin-left: auto; }
.tts-byok-account--error {
    background: #fef2f2;
    border-color: #fecaca;
}
