/**
 * Mementor TTS Player Base Styles
 * These styles provide the core player functionality and appearance
 */

/* Player Container */
.mementor-tts-player-container {
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Main Player */
.mementor-tts-player {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: var(--player-bg-color, #f6f7fb);
    border: 1px solid var(--player-border-color, #dcdcde);
    border-radius: 4px;
    padding: var(--player-padding, 12px);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: var(--player-font-size, 14px);
    color: var(--player-text-color, #1d2327);
    margin-top: 10px;
    margin-bottom: 10px;
    position: relative;
}

/* Play Button */
.mementor-tts-play-button {
    background-color: var(--player-play-button-bg, #ffffff);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: var(--player-accent-color, #2271b1);
}

.mementor-tts-play-button.no-background {
    background-color: transparent !important;
    box-shadow: none;
}

/* Progress Container */
.mementor-tts-progress-container {
    flex: 1;
    background-color: var(--player-progress-default, #e0e0e0);
    height: 4px;
    border-radius: 2px;
    margin: 0 10px;
    cursor: pointer;
    position: relative;
}

/* Progress Bar */
.mementor-tts-progress-bar {
    background-color: var(--player-progress-playing, #2271b1);
    height: 100%;
    border-radius: 2px;
    width: 0%;
}

/* Time Display */
.mementor-tts-time-display,
.mementor-tts-duration-display {
    font-size: var(--player-font-size, 14px);
    color: var(--player-timer-color, #50575e);
    min-width: 36px;
    text-align: center;
}

/* Control Buttons */
.mementor-tts-volume-button,
.mementor-tts-speed-button,
.mementor-tts-download-button,
.mementor-tts-info-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 0 2px;
    color: var(--player-accent-color, #2271b1);
}

/* Admin Info Popup */
.mementor-tts-info-popup {
    display: none;
    position: fixed;
    z-index: 999999;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px 15px;
    width: 300px;
    max-width: 90vw;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    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: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: -8px;
}

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

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

/* Player Label */
.mementor-tts-player-label {
    margin-bottom: 10px;
    font-size: var(--player-label-size, 14px);
    font-weight: var(--player-label-weight, 400);
    color: var(--player-label-color, #1d2327);
}

/* Dashicons */
.mementor-tts-player .dashicons {
    font-size: var(--player-icon-size, 20px);
    width: var(--player-icon-size, 20px);
    height: var(--player-icon-size, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alignment Styles */
.mementor-tts-player-container[data-alignment="left"] {
    margin-left: 0;
    margin-right: auto;
}

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

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

/* Width Styles */
.mementor-tts-player-container.mementor-tts-width-content_width {
    max-width: var(--mementor-tts-max-width, 100%);
}

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

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

/* Remove empty paragraphs ONLY within player structure */
.mementor-tts-player-container > p:empty,
.mementor-tts-player > p:empty,
.mementor-tts-custom-controls > p:empty {
    display: none !important;
}

/* Reset margins only for direct children paragraphs within player controls */
.mementor-tts-custom-controls > p,
.mementor-tts-player > p {
    margin: 0 !important;
    padding: 0 !important;
} 