/**
 * Mementor Text to Speech - Shared CSS
 * 
 * This file contains ALL styles for the audio player that are shared between
 * the admin preview player and the frontend player.
 * 
 * IMPORTANT: All player styles should be in this file only to ensure consistency
 * between the preview player in the admin area and the live player on the frontend.
 * Do not add player styles to admin/css/mementor-tts-admin.css.
 */

:root {
    /* 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;

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

    /* 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;
}

/* Preview Player Container */
.mementor-tts-preview-player {
    display: block;
    width: 100%;
    max-width: var(--mementor-tts-max-width);
    transition: max-width 0.3s ease;
}

.mementor-tts-preview-player .mementor-tts-player-container {
    display: block;
    width: 100%;
    transition: max-width 0.3s ease;
}

.mementor-tts-preview-player .mementor-tts-player {
    width: 100%;
    transition: max-width 0.3s ease;
}

/* Ensure preview player respects max-width with highest specificity */
html body .mementor-tts-preview-player,
html body .mementor-tts-preview-player .mementor-tts-player-container {
    max-width: var(--mementor-tts-max-width);
    width: 100%;
}

html body .mementor-tts-preview-player .mementor-tts-player {
    width: 100%;
}

/* Base player container with highest specificity */
html body .mementor-tts-player-container {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5em;
    transition: max-width 0.3s ease;
    max-width: var(--mementor-tts-max-width);
}

/* Base player container styles */
html body .mementor-tts-player-container {
    margin: 1.5em 0;
    clear: both;
    display: block;
    position: relative;
    box-sizing: border-box;
}

/* Before Title Position */
html body .mementor-tts-player-container.mementor-tts-before-title,
html body .mementor-tts-player-container.mementor-tts-before-title-js {
    margin: 0 0 1.5em 0;
    clear: both;
    display: block;
}

/* After Title Before Excerpt Position */
html body .mementor-tts-player-container.mementor-tts-after-title-before-excerpt {
    margin: 1.5em 0;
    clear: both;
    display: block;
}

.entry-header + .mementor-tts-player-container.mementor-tts-after-title-before-excerpt {
    margin-top: 1em;
}

.mementor-tts-player-container.mementor-tts-after-title-before-excerpt + .entry-content,
.mementor-tts-player-container.mementor-tts-after-title-before-excerpt + .excerpt {
    margin-top: 1em;
}

/* After Title After Excerpt Position */
html body .mementor-tts-player-container.mementor-tts-after-title-after-excerpt {
    margin: 1.5em 0;
    clear: both;
    display: block;
}

.excerpt + .mementor-tts-player-container.mementor-tts-after-title-after-excerpt {
    margin-top: 1em;
}

.mementor-tts-player-container.mementor-tts-after-title-after-excerpt + .entry-content {
    margin-top: 1em;
}

/* After Title Position */
html body .mementor-tts-player-container.mementor-tts-after-title,
html body .mementor-tts-player-container.mementor-tts-after-title-js {
    margin: 1.5em 0;
    clear: both;
    display: block;
}

/* After Content Position */
html body .mementor-tts-player-container.mementor-tts-after-content {
    margin: 1.5em 0 0 0;
    clear: both;
    display: block;
}

/* Player wrapper */
.mementor-tts-player-wrapper {
    position: relative;
    margin-bottom: 10px;
    width: 100%;
}

/* Base player label styles */
.mementor-tts-player-label {
    display: block;
    margin-bottom: 5px;
    line-height: 1.4;
}

/* Label font size */
.mementor-tts-player-label.label-size-small {
    font-size: 12px;
}

.mementor-tts-player-label.label-size-default {
    font-size: 14px;
}

.mementor-tts-player-label.label-size-large {
    font-size: 16px;
}

/* Label font weight */
.mementor-tts-player-label.label-weight-normal {
    font-weight: 400;
}

.mementor-tts-player-label.label-weight-medium {
    font-weight: 500;
}

.mementor-tts-player-label.label-weight-bold {
    font-weight: 700;
}

/* Label colors */
.mementor-tts-player-label.label-color-dark {
    color: #1d2327;
}

.mementor-tts-player-label.label-color-white {
    color: #ffffff;
}

.mementor-tts-player-label.label-color-custom {
    color: var(--mementor-tts-custom-label-color, #1d2327);
}

/* Label alignment */
.mementor-tts-player-label.text-left {
    text-align: left;
}

.mementor-tts-player-label.text-center {
    text-align: center;
}

.mementor-tts-player-label.text-right {
    text-align: right;
}

/* Label position-specific styles */
.mementor-tts-player-label.mementor-tts-before-title,
.mementor-tts-player-label.mementor-tts-before-title-js {
    margin-bottom: 0.5em;
}

.mementor-tts-player-label.mementor-tts-after-title-before-excerpt {
    margin-bottom: 1em;
}

.mementor-tts-player-label.mementor-tts-after-title-after-excerpt {
    margin-bottom: 1em;
}

.mementor-tts-player-label.mementor-tts-after-content {
    margin-bottom: 1em;
}

/* Custom color support through CSS variables */
.mementor-tts-player-label[class*="label-color-custom-"] {
    color: var(--mementor-tts-custom-label-color);
}

/* Hide label when show_label is false */
.mementor-tts-preview-player[data-show-label="false"] .mementor-tts-player-label,
.mementor-tts-preview-player[data-show-label="0"] .mementor-tts-player-label {
    display: none !important;
}

/* Show label when show_label is true */
.mementor-tts-preview-player[data-show-label="true"] .mementor-tts-player-label,
.mementor-tts-preview-player[data-show-label="1"] .mementor-tts-player-label {
    display: block !important;
}

/* Force text alignment based on data attribute */
.mementor-tts-preview-player[data-label-position="left"] .mementor-tts-player-label {
    text-align: left !important;
}

.mementor-tts-preview-player[data-label-position="center"] .mementor-tts-player-label {
    text-align: center !important;
}

.mementor-tts-preview-player[data-label-position="right"] .mementor-tts-player-label {
    text-align: right !important;
}

/* Main player with proper width inheritance */
.mementor-tts-player {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    max-width: none !important;
}

/* Override general button styles that might affect our player buttons */
/* This CSS loads after theme CSS (priority 999) to ensure overrides work */
/* Using highest specificity selectors to override any theme button styles */
html body .mementor-tts-player button,
html body .mementor-tts-preview-player button,
html body .mementor-tts-custom-controls button,
html body .mementor-tts-player .mementor-tts-play-button,
html body .mementor-tts-player .mementor-tts-download-button,
html body .mementor-tts-player .mementor-tts-speed-button,
html body .mementor-tts-player .mementor-tts-skip-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    font-size: var(--mementor-tts-font-size, 14px) !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    line-height: normal !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-width: auto !important;
    min-height: auto !important;
    font-weight: normal !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    font-family: inherit !important;
    outline: none !important;
    color: inherit !important;
    vertical-align: middle !important;
    text-decoration: none !important;
    width: auto !important;
    height: auto !important;
}

/* Custom controls container */
.mementor-tts-custom-controls {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: center;
    gap: var(--mementor-tts-spacing-sm, 8px);
    padding: var(--mementor-tts-player-padding, 15px) !important;
    background-color: var(--mementor-tts-bg-color, #f6f7fb) !important;
    border: var(--mementor-tts-border, none) !important;
    border-radius: var(--mementor-tts-border-radius, 4px) !important;
    font-size: var(--mementor-tts-font-size, 14px) !important;
    color: var(--mementor-tts-text-color, #0e0e0f) !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
}

/* Play button - Ultra high specificity */
/* Includes Weglot and theme compatibility overrides */
.mementor-tts-play-button,
.mementor-tts-player .mementor-tts-play-button,
html body .mementor-tts-player .mementor-tts-play-button,
html body .mementor-tts-player-container .mementor-tts-play-button,
.entry-content .mementor-tts-player .mementor-tts-play-button,
.post-content .mementor-tts-player .mementor-tts-play-button,
html[lang] body .mementor-tts-player .mementor-tts-play-button,
html[lang="en"] body .mementor-tts-player .mementor-tts-play-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: calc(var(--mementor-tts-play-icon-size, 24px) * 1.5) !important;
    height: calc(var(--mementor-tts-play-icon-size, 24px) * 1.5) !important;
    min-width: calc(var(--mementor-tts-play-icon-size, 24px) * 1.5) !important;
    min-height: calc(var(--mementor-tts-play-icon-size, 24px) * 1.5) !important;
    max-width: calc(var(--mementor-tts-play-icon-size, 24px) * 1.5) !important;
    max-height: calc(var(--mementor-tts-play-icon-size, 24px) * 1.5) !important;
    background-color: var(--mementor-tts-play-button-bg, #ffffff) !important;
    border: 1px solid var(--mementor-tts-border-color, #dcdcde) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 1 !important;
    position: relative !important;
    transition: background-color 0.2s ease !important;
    outline: none !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    font-size: inherit !important;
    flex-shrink: 0 !important;
}

.mementor-tts-play-button:focus {
    outline: none;
    box-shadow: none;
}

.mementor-tts-play-button:hover {
    background-color: var(--mementor-tts-play-button-bg-hover, #f6f7f7);
}

/* Play button without background - when button background is disabled */
.mementor-tts-custom-controls[data-show-play-bg="false"] .mementor-tts-play-button,
.mementor-tts-player .mementor-tts-play-button.no-background,
html body .mementor-tts-player .mementor-tts-play-button.no-background,
html body .mementor-tts-player-container .mementor-tts-play-button.no-background,
.entry-content .mementor-tts-player .mementor-tts-play-button.no-background,
.post-content .mementor-tts-player .mementor-tts-play-button.no-background {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
}

/* Ensure hover state is also transparent when no background */
.mementor-tts-custom-controls[data-show-play-bg="false"] .mementor-tts-play-button:hover,
.mementor-tts-player .mementor-tts-play-button.no-background:hover,
html body .mementor-tts-player .mementor-tts-play-button.no-background:hover {
    background-color: transparent !important;
    background: transparent !important;
}

/* Play button icon - Ultra high specificity */
.mementor-tts-play-button .dashicons,
.mementor-tts-play-button .mementor-dashicons,
html body .mementor-tts-play-button .dashicons,
html body .mementor-tts-play-button .mementor-dashicons,
.mementor-tts-player .mementor-tts-play-button .dashicons,
.mementor-tts-player .mementor-tts-play-button .mementor-dashicons,
html body .mementor-tts-player .mementor-tts-play-button .dashicons,
html body .mementor-tts-player .mementor-tts-play-button .mementor-dashicons {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-45%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: var(--mementor-tts-play-icon-size, 24px) !important;
    width: var(--mementor-tts-play-icon-size, 24px) !important;
    height: var(--mementor-tts-play-icon-size, 24px) !important;
    display: inline-block !important;
    font-family: dashicons !important;
    line-height: 1 !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.dashicons-controls-pause:before,
.mementor-dashicons-controls-pause:before {
    margin-left: -1px;
}

/* Custom mementor dashicons for volume controls */
.mementor-dashicons-controls-volumeon:before {
    content: "\f521";
}

.mementor-dashicons-controls-volumeoff:before {
    content: "\f520";
}

.mementor-dashicons-controls-play:before {
    content: "\f522";
}

.mementor-dashicons-controls-pause:before {
    content: "\f523";
}

.mementor-dashicons-update:before {
    content: "\f463";
}

.mementor-dashicons-download:before {
    content: "\f316";
}

.mementor-dashicons-info:before {
    content: "\f348";
}

/* Time display */
.mementor-tts-time-display,
.mementor-tts-duration-display {
    font-family: monospace;
    font-size: var(--mementor-tts-font-size, 14px);
    color: var(--mementor-tts-timer-color, #50575e);
    min-width: 45px;
    flex-shrink: 0;
    text-align: center;
}

.mementor-tts-time-display {
    order: 2;
}

.mementor-tts-duration-display {
    order: 4;
}

/* Progress container */
.mementor-tts-progress-container {
    flex-grow: 1;
    height: 8px;
    background-color: var(--mementor-tts-progress-default, #e0e0e0) !important;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    order: 3;
    z-index: 10; /* Ensure it's above other elements for clicking */
    transition: background-color 0.2s ease;
}

/* Progress container hover effect */
.mementor-tts-progress-container:hover {
    background-color: #d0d0d0 !important;
}

/* Progress container variants */
.mementor-tts-progress-container.thin {
    height: 4px;
}

.mementor-tts-progress-container.thick {
    height: 8px;
}

/* Progress bar */
.mementor-tts-progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--mementor-tts-progress-playing, #2271b1) !important;
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Allow clicks to pass through to the container */
    transition: width 0.1s linear; /* Smooth progress updates */
}

/* Volume button - with theme override protection */
.mementor-tts-volume-button,
html body .mementor-tts-player .mementor-tts-volume-button,
html[lang] body .mementor-tts-player .mementor-tts-volume-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 5 !important;
    line-height: inherit !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
}

.mementor-tts-volume-button:hover {
    opacity: 0.8;
}

/* Volume button icon */
.mementor-tts-volume-button .dashicons,
.mementor-tts-volume-button .mementor-dashicons {
    width: var(--mementor-tts-icon-size, 20px) !important;
    height: var(--mementor-tts-icon-size, 20px) !important;
    color: var(--mementor-tts-accent-color, #2271b1);
    display: inline-block !important;
    font-family: dashicons !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Speed button - with theme override protection */
.mementor-tts-speed-button,
html body .mementor-tts-player .mementor-tts-speed-button,
html[lang] body .mementor-tts-player .mementor-tts-speed-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 40px !important;
    font-size: var(--mementor-tts-font-size, 14px) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-weight: 600 !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    order: 6;
    line-height: inherit !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    height: auto !important;
    min-height: auto !important;
}

.mementor-tts-speed-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Download button - with theme override protection */
.mementor-tts-download-button,
html body .mementor-tts-player .mementor-tts-download-button,
html[lang] body .mementor-tts-player .mementor-tts-download-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 7 !important;
    line-height: inherit !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
}

.mementor-tts-download-button:hover {
    opacity: 0.8;
}

/* Download button icon */
.mementor-tts-download-button .dashicons,
.mementor-tts-download-button .mementor-dashicons {
    width: var(--mementor-tts-icon-size, 20px) !important;
    height: var(--mementor-tts-icon-size, 20px) !important;
    color: var(--mementor-tts-accent-color, #2271b1);
    display: inline-block !important;
    font-family: dashicons !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Info button - with theme override protection */
.mementor-tts-info-button,
html body .mementor-tts-player .mementor-tts-info-button,
html[lang] body .mementor-tts-player .mementor-tts-info-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 8 !important;
    position: relative !important;
    line-height: inherit !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
}

.mementor-tts-info-button:hover {
    opacity: 0.8;
}

/* Info button icon */
.mementor-tts-info-button .dashicons,
.mementor-tts-info-button .mementor-dashicons {
    width: var(--mementor-tts-icon-size, 20px) !important;
    height: var(--mementor-tts-icon-size, 20px) !important;
    color: var(--mementor-tts-accent-color, #2271b1);
    display: inline-block !important;
    font-family: dashicons !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Info popup styles */
.mementor-tts-info-popup {
    display: none;
    position: fixed;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px 15px;
    width: 308px;
    max-width: 90vw;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    z-index: 9999; /* Reduced from 999999 to prevent conflicts with other plugins */
    font-size: 13px;
    line-height: 1.5;
    color: #444;
    text-align: left;
    /* Use CSS variables for positioning precision */
    --button-x: 0px;
    --button-y: 0px;
    --button-width: 0px;
    --button-right: 0px;
}

.mementor-tts-info-popup p {
    margin: 0;
    padding: 0;
}

.mementor-tts-info-popup a {
    text-decoration: none;
}

/* Close button for info popup */
.mementor-tts-info-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    width: 20px;
    height: 20px;
    padding: 0;
    color: #666;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mementor-tts-info-close:hover {
    opacity: 1;
    color: #333;
}

.mementor-tts-info-close:focus {
    outline: 2px solid var(--mementor-tts-accent-color, #2271b1);
    outline-offset: 2px;
}

/* Arrow pointing down from the popup */
.mementor-tts-info-popup:after {
    content: '';
    position: absolute;
    top: 100%;
    border-width: 8px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

/* Position top-left */
.mementor-tts-info-popup.position-top-left {
    left: var(--button-x);
    top: var(--button-y);
    transform: translate(0, -100%);
    margin-top: -8px;
}

.mementor-tts-info-popup.position-top-left:after {
    left: 15px;
}

/* Position top-center */
.mementor-tts-info-popup.position-top-center {
    left: calc(var(--button-x) + var(--button-width) / 2);
    top: var(--button-y);
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.mementor-tts-info-popup.position-top-center:after {
    left: 50%;
    transform: translateX(-50%);
}

/* Position top-right */
.mementor-tts-info-popup.position-top-right {
    left: var(--button-right);
    top: var(--button-y);
    transform: translate(-100%, -100%);
    margin-top: -27px;
}

.mementor-tts-info-popup.position-top-right:after {
    right: 15px;
}

/* Visible state */
.mementor-tts-info-popup.tooltip-visible {
    display: block;
}

/* Make sure all parent elements allow the popup to be visible */
.mementor-tts-player,
.mementor-tts-player-container,
.mementor-tts-custom-controls,
.mementor-tts-info-button {
    overflow: visible !important;
    position: relative !important;
}

body .mementor-tts-player,
body .mementor-tts-player-container,
body .mementor-tts-custom-controls {
    overflow: visible !important;
}

/* Force parent divs up the DOM tree to show overflow */
.mementor-tts-player-container *,
.mementor-tts-player * {
    pointer-events: auto !important;
}

/* Add a special global container for the popup that can't be affected by overflow */
.mementor-tts-info-popup-container {
    position: relative !important;
    overflow: visible !important;
}

/* Player width options */
.mementor-tts-player.content-width,
.mementor-tts-player.full-width {
    width: 100%;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .mementor-tts-custom-controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    
    .mementor-tts-play-button {
        width: 32px;
        height: 32px;
    }
    
    .mementor-tts-time-display,
    .mementor-tts-duration-display {
        font-size: 12px;
        min-width: 40px;
    }
    
    .mementor-tts-progress-container {
        order: 1;
        width: 100%;
        flex-basis: 100%;
    }
    
    .mementor-tts-time-display {
        order: 2;
    }
    
    .mementor-tts-duration-display {
        order: 3;
    }
}

/* Ensure the player is visible in Elementor templates without changing the original layout */
.elementor-widget-container .mementor-tts-player-container {
    display: block;
    width: 100%;
    max-width: var(--mementor-tts-max-width);
}

/* Adjust player for Elementor page builder */
.elementor-section .mementor-tts-player {
    width: 100%;
    margin: 0 auto;
}

/* Disabled controls */
.mementor-tts-control-disabled,
button.mementor-tts-control-disabled,
.mementor-tts-custom-controls button.mementor-tts-control-disabled,
.mementor-tts-player button[style*="display: none"],
.mementor-tts-player button[style*="display:none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Remove ALL conflicting width classes and consolidate */
/* Width classes with highest specificity */
html body .mementor-tts-player-container {
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* Full width variant */
html body .mementor-tts-player-container.mementor-tts-width-full {
    max-width: 100%;
}

/* Custom/Content width variant */
html body .mementor-tts-player-container.mementor-tts-width-custom,
html body .mementor-tts-player-container.mementor-tts-width-500,
html body .mementor-tts-player-container.mementor-tts-width-content_width {
    max-width: var(--mementor-tts-max-width);
}

/* Alignment with highest specificity */
html body .mementor-tts-player-container[data-alignment="left"] {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html body .mementor-tts-player-container[data-alignment="center"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

html body .mementor-tts-player-container[data-alignment="right"] {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Remove any !important from max-width on these classes */
.mementor-tts-width-full,
.mementor-tts-preview-player .mementor-tts-width-full,
.mementor-tts-player.mementor-tts-width-full {
    width: 100%;
}

/* Loading animation for play button */
.mementor-tts-loading {
    opacity: 0.7;
    pointer-events: none;
}

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

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

/* Generating state styles */
.mementor-tts-generating {
    position: relative;
}

.mementor-tts-generating .dashicons {
    animation: mementor-tts-spin 2s linear infinite;
    color: var(--mementor-tts-accent-color-hover, #135e96) !important;
}

.mementor-tts-generate-button.mementor-tts-generating {
    background-color: rgba(34, 113, 177, 0.1) !important;
    cursor: not-allowed !important;
}

.mementor-tts-generate-button.mementor-tts-generating .dashicons {
    color: var(--mementor-tts-accent-color-hover, #135e96) !important;
}

/* Pulse animation for generating state */
@keyframes mementor-tts-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 113, 177, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 113, 177, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 113, 177, 0); }
}

.mementor-tts-player-container.is-generating .mementor-tts-play-button {
    animation: mementor-tts-pulse 1.5s infinite;
}

/* Fix for player layout issues */
.mementor-tts-player {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    max-width: none !important;
}

.mementor-tts-custom-controls {
    flex-wrap: wrap !important; /* Allow controls to wrap on narrow screens */
    justify-content: space-between !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    background-color: var(--mementor-tts-bg-color, #f6f7fb) !important;
    border: var(--mementor-tts-border, none) !important;
}

/* Make sure the progress container is full width on mobile */
@media (max-width: 480px) {
    .mementor-tts-progress-container {
        width: 100% !important;
        flex-basis: 100% !important;
        order: 5 !important; /* Move below other controls on mobile */
        margin-top: 8px !important;
    }
    
    .mementor-tts-custom-controls {
        padding: 10px !important; /* Reduce padding on mobile */
    }
    
    /* Fix for play button alignment */
    .mementor-tts-play-button {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Smaller font size for time display */
    .mementor-tts-time-display,
    .mementor-tts-duration-display {
        font-size: 12px !important;
        min-width: auto !important;
    }
}

/* Fix for specific WordPress theme conflicts */
.entry-content .mementor-tts-player,
.post-content .mementor-tts-player,
.content .mementor-tts-player,
.wp-block .mementor-tts-player,
.elementor-widget-container .mementor-tts-player {
    width: 100%;
}

/* Ensure audio element is properly sized */
.mementor-tts-player audio {
    width: 1px !important;
    height: 1px !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide player on non-singular pages as a fallback */
.home .mementor-tts-player-container,
.archive .mementor-tts-player-container,
.search .mementor-tts-player-container,
.blog .mementor-tts-player-container,
body:not(.single):not(.page):not(.singular) .mementor-tts-player-container {
    display: none !important;
}

/* Ensure width classes work in Elementor */
.elementor-widget-container .mementor-tts-player-container.mementor-tts-width-500,
.elementor-widget-container .mementor-tts-player-container.mementor-tts-width-custom,
.elementor-widget-container .mementor-tts-player-container.mementor-tts-width-full {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.elementor-widget-container .mementor-tts-player {
    width: 100%;
}

/* Ensure width classes have high specificity */
body .mementor-tts-player-container.mementor-tts-width-500,
body .mementor-tts-preview-player .mementor-tts-width-500 {
    max-width: var(--mementor-tts-max-width) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body .mementor-tts-player-container.mementor-tts-width-custom,
body .mementor-tts-preview-player .mementor-tts-width-custom {
    max-width: var(--mementor-tts-max-width) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body .mementor-tts-player-container.mementor-tts-width-full,
body .mementor-tts-preview-player .mementor-tts-width-full {
    width: 100% !important;
}

/* Ensure proper width inheritance */
.mementor-tts-player-container {
    max-width: var(--mementor-tts-max-width) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

.mementor-tts-player {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Hide empty paragraph tags ONLY within player structure, not Elementor content */
.mementor-tts-player-container > p:empty,
.mementor-tts-player > p:empty,
.mementor-tts-custom-controls > p:empty {
    display: none !important;
}

.mementor-tts-player-container > p:empty + p:empty {
    display: none !important;
}

/* Reset margins only for direct children paragraphs within player controls, not all descendant paragraphs */
.mementor-tts-custom-controls > p,
.mementor-tts-player > p:not(.e-n-accordion-item-title-text) {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure Elementor and other page builder content is never affected */
.mementor-tts-player-container .elementor-widget-container p,
.mementor-tts-player-container [class*="elementor"] p,
.mementor-tts-player-container [class*="e-n-accordion"] p {
    margin: revert !important;
    padding: revert !important;
}

/* Player alignment styles - high specificity */
body .mementor-tts-player-container[data-alignment="left"],
.mementor-tts-player-container[data-alignment="left"] {
    margin-left: 0 !important;
    margin-right: auto !important;
}

body .mementor-tts-player-container[data-alignment="center"],
.mementor-tts-player-container[data-alignment="center"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

body .mementor-tts-player-container[data-alignment="right"],
.mementor-tts-player-container[data-alignment="right"] {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Player width styles */
.mementor-tts-player-container.mementor-tts-width-content_width {
    max-width: var(--mementor-tts-max-width) !important;
}

.mementor-tts-player-container.mementor-tts-width-full_width {
    max-width: 100%;
}

/* Ensure proper width inheritance with high specificity */
html body .mementor-tts-player-container {
    max-width: var(--mementor-tts-max-width);
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* Player alignment styles with highest specificity */
html body .mementor-tts-player-container[data-alignment="left"] {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html body .mementor-tts-player-container[data-alignment="center"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

html body .mementor-tts-player-container[data-alignment="right"] {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Player width styles */
.mementor-tts-player-container.mementor-tts-width-content_width {
    max-width: var(--mementor-tts-max-width) !important;
}

.mementor-tts-player-container.mementor-tts-width-full_width {
    max-width: 100%;
}

/* Ensure preview player respects max-width */
html body .mementor-tts-preview-player .mementor-tts-player-container {
    max-width: var(--mementor-tts-max-width);
    width: 100%;
}

/* Remove any conflicting max-width rules */
.mementor-tts-preview-player .mementor-tts-player,
.mementor-tts-preview-player .mementor-tts-player * {
    max-width: none !important;
}

/* Preview player container base styles */
.mementor-tts-preview-player .mementor-tts-player-container {
    display: block;
    width: 100%;
    max-width: var(--mementor-tts-max-width);
}

/* Preview player alignment styles - highest specificity */
html body .mementor-tts-preview-player .mementor-tts-player-container[data-alignment="left"] {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html body .mementor-tts-preview-player .mementor-tts-player-container[data-alignment="center"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

html body .mementor-tts-preview-player .mementor-tts-player-container[data-alignment="right"] {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Preview player alignment styles */
.mementor-tts-preview-player[data-alignment="left"] {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.mementor-tts-preview-player[data-alignment="center"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

.mementor-tts-preview-player[data-alignment="right"] {
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* Ensure parent containers don't clip the popup */
.mementor-tts-custom-controls,
.mementor-tts-player,
.mementor-tts-player-container {
    overflow: visible !important;
    position: relative !important;
}

/* Player alignment classes */
html body .mementor-tts-player-container.mementor-tts-align-left {
    margin-right: auto;
    margin-left: 0;
}

html body .mementor-tts-player-container.mementor-tts-align-center {
    margin-left: auto;
    margin-right: auto;
}

html body .mementor-tts-player-container.mementor-tts-align-right {
    margin-left: auto;
    margin-right: 0;
}

/* Alignment Classes */
html body .mementor-tts-player-container.mementor-tts-align-left {
    margin-right: auto;
    text-align: left;
}

html body .mementor-tts-player-container.mementor-tts-align-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

html body .mementor-tts-player-container.mementor-tts-align-right {
    margin-left: auto;
    text-align: right;
}

/* Width Classes */
html body .mementor-tts-player-container.mementor-tts-width-content_width {
    max-width: 500px;
}

html body .mementor-tts-player-container.mementor-tts-width-full_width {
    width: 100%;
}

/* Ensure proper spacing with theme elements */
.entry-header + .mementor-tts-player-container,
.entry-content + .mementor-tts-player-container,
.excerpt + .mementor-tts-player-container {
    margin-top: 1em;
}

.mementor-tts-player-container + .entry-content,
.mementor-tts-player-container + .excerpt {
    margin-top: 1em;
}

/* Dynamic Placement Context Classes */

/* Adjacent to specific elements */
.mementor-tts-adjacent-to-entry-title {
    margin: 1.5em 0;
}

.mementor-tts-adjacent-to-entry-header {
    margin: 1.5em 0;
}

.mementor-tts-adjacent-to-post-title {
    margin: 1.5em 0;
}

/* Before/After Excerpt Context */
.mementor-tts-before-entry-content,
.mementor-tts-before-post-content,
.mementor-tts-before-excerpt {
    margin: 1.5em 0 1em;
}

.mementor-tts-after-entry-excerpt,
.mementor-tts-after-excerpt,
.mementor-tts-after-post-excerpt {
    margin: 1em 0 1.5em;
}

/* Fallback Cases */
.mementor-tts-no-excerpt {
    margin: 1em 0 1.5em;
}

.mementor-tts-no-excerpt-no-content {
    margin: 1em 0 1.5em;
}

/* Theme-specific adjustments */
.elementor-widget-container .mementor-tts-player-container {
    margin: 1em 0;
}

.elementor-widget-theme-post-content .mementor-tts-player-container {
    margin: 1.5em 0;
}

/* Ensure proper spacing with various theme elements */
.entry-header + .mementor-tts-player-container {
    margin-top: 1em;
}

.mementor-tts-player-container + .entry-content {
    margin-top: 1.5em;
}

.excerpt + .mementor-tts-player-container {
    margin-top: 1em;
}

.mementor-tts-player-container + .excerpt {
    margin-top: 1em;
}

/* Position-specific margins */
.mementor-tts-before-title-js {
    margin-bottom: 1.5em;
}

.mementor-tts-after-title-js {
    margin-top: 1em;
    margin-bottom: 1.5em;
}

.mementor-tts-after-title-before-excerpt {
    margin: 1em 0 1.5em;
}

.mementor-tts-after-title-after-excerpt {
    margin: 1.5em 0 1em;
}

.mementor-tts-after-content {
    margin-top: 1.5em;
    margin-bottom: 0;
}

/* Base player container styles */
.mementor-tts-player-container {
    clear: both;
    display: block;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

/* Max width custom class with fallback support */
html body .mementor-tts-player-container.mementor-tts-max-width-custom {
    max-width: var(--mementor-tts-max-width, 100%) !important;
    width: 100% !important;
}

/* Max width based on data attributes - modern browsers */
@supports (max-width: attr(data-max-width px)) {
    html body .mementor-tts-max-width-custom {
        max-width: attr(data-max-width length, 100%) !important;
    }
}

html body .mementor-tts-player-container.mementor-tts-width-content_width {
    width: 100% !important;
    max-width: var(--mementor-tts-max-width, 100%) !important;
}

/* Ensure the player element also respects the max-width */
html body .mementor-tts-player-container.mementor-tts-max-width-custom .mementor-tts-player {
    width: 100% !important;
}

/* Responsive Breakpoints */
@media screen and (max-width: 1024px) {
    html body .mementor-tts-player-container {
        padding: var(--mementor-tts-spacing-md);
    }

    .mementor-tts-custom-controls {
        gap: var(--mementor-tts-spacing-sm);
    }
}

@media screen and (max-width: 768px) {
    html body .mementor-tts-player-container {
        padding: var(--mementor-tts-spacing-sm);
    }

    .mementor-tts-custom-controls {
        flex-wrap: wrap;
        gap: var(--mementor-tts-spacing-xs);
    }

    .mementor-tts-progress-container {
        order: 2;
        max-width: 30%;
        margin: var(--mementor-tts-spacing-xs) 0;
    }

    .mementor-tts-time-display {
        order: 3;
    }

    .mementor-tts-volume-button,
    .mementor-tts-speed-button,
    .mementor-tts-download-button,
    .mementor-tts-info-button {
        order: 4;
    }

    .mementor-tts-player-label {
        font-size: calc(var(--mementor-tts-label-size) * 0.9);
        margin-bottom: var(--mementor-tts-spacing-sm);
    }
}

@media screen and (max-width: 480px) {
    html body .mementor-tts-player-container {
        padding: var(--mementor-tts-spacing-xs);
    }

    .mementor-tts-custom-controls {
        justify-content: center;
    }

    .mementor-tts-play-button {
        order: 1;
        margin-right: var(--mementor-tts-spacing-xs);
    }

    .mementor-tts-progress-container {
        order: 2;
        width: 100%;
        margin: var(--mementor-tts-spacing-xs) 0;
    }

    .mementor-tts-time-display {
        order: 3;
        font-size: calc(var(--mementor-tts-font-size) * 0.9);
    }

    .mementor-tts-volume-button,
    .mementor-tts-speed-button,
    .mementor-tts-download-button,
    .mementor-tts-info-button {
        order: 4;
        padding: calc(var(--mementor-tts-spacing-xs) * 1.5);
    }

    .mementor-tts-player-label {
        font-size: calc(var(--mementor-tts-label-size) * 0.85);
        margin-bottom: var(--mementor-tts-spacing-xs);
    }

    /* Adjust icon sizes for better touch targets */
    .mementor-tts-play-button .dashicons {
        font-size: calc(var(--mementor-tts-play-icon-size) * 1.1);
        width: calc(var(--mementor-tts-play-icon-size) * 1.1);
        height: calc(var(--mementor-tts-play-icon-size) * 1.1);
    }

    .mementor-tts-volume-button .dashicons,
    .mementor-tts-speed-button .dashicons,
    .mementor-tts-download-button .dashicons,
    .mementor-tts-info-button .dashicons {
        font-size: calc(var(--mementor-tts-icon-size) * 1.1);
        width: calc(var(--mementor-tts-icon-size) * 1.1);
        height: calc(var(--mementor-tts-icon-size) * 1.1);
    }
}

@media screen and (max-width: 360px) {
    .mementor-tts-custom-controls {
        gap: calc(var(--mementor-tts-spacing-xs) / 2);
    }

    .mementor-tts-volume-button,
    .mementor-tts-speed-button,
    .mementor-tts-download-button,
    .mementor-tts-info-button {
        padding: var(--mementor-tts-spacing-xs);
    }

    .mementor-tts-time-display {
        font-size: calc(var(--mementor-tts-font-size) * 0.85);
    }
}

/* Remove borders from icon buttons except play button and speed control */
.mementor-tts-volume-button,
.mementor-tts-info-button,
.mementor-tts-download-button,
html body .mementor-tts-volume-button,
html body .mementor-tts-info-button,
html body .mementor-tts-download-button,
.mementor-tts-preview-player .mementor-tts-volume-button,
.mementor-tts-preview-player .mementor-tts-info-button,
.mementor-tts-preview-player .mementor-tts-download-button {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Override display for hidden controls - highest specificity to beat !important rules */
html body .mementor-tts-player .mementor-tts-download-button[style*="display: none"],
html body .mementor-tts-player .mementor-tts-download-button[style*="display:none"],
html body .mementor-tts-preview-player .mementor-tts-download-button[style*="display: none"],
html body .mementor-tts-preview-player .mementor-tts-download-button[style*="display:none"] {
    display: none !important;
}

html body .mementor-tts-player .mementor-tts-info-button[style*="display: none"],
html body .mementor-tts-player .mementor-tts-info-button[style*="display:none"],
html body .mementor-tts-preview-player .mementor-tts-info-button[style*="display: none"],
html body .mementor-tts-preview-player .mementor-tts-info-button[style*="display:none"] {
    display: none !important;
}

html body .mementor-tts-player .mementor-tts-volume-button[style*="display: none"],
html body .mementor-tts-player .mementor-tts-volume-button[style*="display:none"],
html body .mementor-tts-preview-player .mementor-tts-volume-button[style*="display: none"],
html body .mementor-tts-preview-player .mementor-tts-volume-button[style*="display:none"] {
    display: none !important;
}

html body .mementor-tts-player .mementor-tts-speed-button[style*="display: none"],
html body .mementor-tts-player .mementor-tts-speed-button[style*="display:none"],
html body .mementor-tts-preview-player .mementor-tts-speed-button[style*="display: none"],
html body .mementor-tts-preview-player .mementor-tts-speed-button[style*="display:none"] {
    display: none !important;
}

html body .mementor-tts-player .mementor-tts-time-display[style*="display: none"],
html body .mementor-tts-player .mementor-tts-time-display[style*="display:none"],
html body .mementor-tts-player .mementor-tts-duration-display[style*="display: none"],
html body .mementor-tts-player .mementor-tts-duration-display[style*="display:none"],
html body .mementor-tts-preview-player .mementor-tts-time-display[style*="display: none"],
html body .mementor-tts-preview-player .mementor-tts-time-display[style*="display:none"],
html body .mementor-tts-preview-player .mementor-tts-duration-display[style*="display: none"],
html body .mementor-tts-preview-player .mementor-tts-duration-display[style*="display:none"] {
    display: none !important;
}

/* ==========================================================================
   Sticky Footer Player
   ========================================================================== */

html body .mementor-tts-sticky-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    background-color: var(--mementor-tts-sticky-bg, var(--mementor-tts-bg-color, #f6f7fb)) !important;
    border-top: 1px solid var(--mementor-tts-border-color, #dcdcde) !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08) !important;
    padding: var(--mementor-tts-player-padding, 12px) 16px !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    transition: background-color 0.2s ease !important;
}

html body .mementor-tts-sticky-footer:hover {
    background-color: var(--mementor-tts-bg-color, #f6f7fb) !important;
}

html body .mementor-tts-sticky-inner {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    height: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Play/Pause button */
html body .mementor-tts-sticky-play {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: none !important;
    background-color: var(--mementor-tts-play-button-bg, #ffffff) !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: background-color 0.15s ease !important;
}

html body .mementor-tts-sticky-play:hover {
    background-color: var(--mementor-tts-play-button-bg-hover, #f6f7f7) !important;
}

/* Title */
html body .mementor-tts-sticky-info {
    flex-shrink: 1 !important;
    min-width: 0 !important;
    max-width: 240px !important;
}

html body .mementor-tts-sticky-title {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--mementor-tts-timer-color, #1d2327) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
}

/* Progress section */
html body .mementor-tts-sticky-progress-wrap {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
}

html body .mementor-tts-sticky-time,
html body .mementor-tts-sticky-duration {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    color: var(--mementor-tts-timer-color, #1d2327) !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 32px !important;
    text-align: center !important;
}

html body .mementor-tts-sticky-progress-container {
    flex: 1 !important;
    height: 4px !important;
    background-color: var(--mementor-tts-progress-default, #e0e0e0) !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    position: relative !important;
    min-width: 60px !important;
}

html body .mementor-tts-sticky-progress-bar {
    height: 100% !important;
    width: 0%;
    background-color: var(--mementor-tts-progress-playing, #2271b1) !important;
    border-radius: 2px !important;
    transition: width 0.1s linear !important;
    pointer-events: none !important;
}

/* Close button */
html body .mementor-tts-sticky-close {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    opacity: 0.6 !important;
    transition: opacity 0.15s ease !important;
}

html body .mementor-tts-sticky-close:hover {
    opacity: 1 !important;
}

/* Volume button */
html body .mementor-tts-sticky-volume {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border: none !important;
    background: transparent !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    opacity: 0.7 !important;
    transition: opacity 0.15s ease !important;
}

html body .mementor-tts-sticky-volume:hover {
    opacity: 1 !important;
}

/* Speed button */
html body .mementor-tts-sticky-speed {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 24px !important;
    border: 1px solid var(--mementor-tts-border-color, #dcdcde) !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 0 4px !important;
    transition: border-color 0.15s ease !important;
}

html body .mementor-tts-sticky-speed:hover {
    border-color: var(--mementor-tts-accent-color, #2271b1) !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
}

/* Download link */
html body .mementor-tts-sticky-download {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    color: var(--mementor-tts-accent-color, #2271b1) !important;
    text-decoration: none !important;
    opacity: 0.7 !important;
    transition: opacity 0.15s ease !important;
}

html body .mementor-tts-sticky-download:hover {
    opacity: 1 !important;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    html body .mementor-tts-sticky-footer {
        padding: var(--mementor-tts-player-padding, 12px) 10px !important;
    }

    html body .mementor-tts-sticky-inner {
        gap: 8px !important;
    }

    html body .mementor-tts-sticky-info {
        max-width: 120px !important;
    }

    html body .mementor-tts-sticky-title {
        font-size: 12px !important;
    }

    html body .mementor-tts-sticky-play {
        width: 32px !important;
        height: 32px !important;
    }

    html body .mementor-tts-sticky-play svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* ==========================================================================
   Waveform Progress Bar
   ========================================================================== */

html body .mementor-tts-progress-container.mementor-tts-waveform {
    height: 32px !important;
    background: transparent !important;
}

html body .mementor-tts-progress-container.mementor-tts-waveform:hover {
    background: transparent !important;
}

html body .mementor-tts-waveform-svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

html body .mementor-tts-waveform-bg rect {
    fill: var(--mementor-tts-progress-default, #e0e0e0);
}

html body .mementor-tts-waveform-fg rect {
    fill: var(--mementor-tts-progress-playing, #2271b1);
}

/* Sticky footer waveform */
html body .mementor-tts-sticky-progress-container.mementor-tts-waveform {
    height: 28px !important;
    background: transparent !important;
}
