/**
 * WaveShow Player — Stylesheet (v1.0.0)
 *
 * @package WaveShow_Player
 * @since   1.0.0
 */

/* ==================================================================
 * WRAPPER
 * ================================================================== */

 .wsh-wrapper {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding: 16px 0;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
        box-sizing: border-box;
}

/* The button keeps its fixed size. */
.wsh-wrapper .wsh-play-btn {
        flex-shrink: 0;
}

/* The file name spans the full width below the waveform row.
   These are fallback defaults — Bricks' typography control
   (fileNameTypography) generates more specific CSS on top. */
.wsh-wrapper .wsh-file-name {
        flex: 0 0 100%;
        display: block;
        margin-top: 4px;
        padding: 0 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        user-select: text;
        font-size: 13px;
        color: #666666;
        font-weight: 400;
        font-style: normal;
        text-align: center;
        line-height: 1.5;
        letter-spacing: normal;
}

/* ==================================================================
 * WAVEFORM CONTAINER
 * ================================================================== */

.wsh-waveform {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        cursor: pointer;
        background: transparent;
        transition: opacity 0.2s ease;
}

.wsh-waveform:empty {
        opacity: 0.4;
}

.wsh-waveform canvas {
        display: block;
        width: 100%;
        height: 100%;
}

/* ==================================================================
 * BUILT-IN PLAY / PAUSE BUTTON
 * ================================================================== */

.wsh-play-btn {
        flex: 0 0 auto;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: var( --wsh-btn-size, 44px );
        height: var( --wsh-btn-size, 44px );
        border: none;
        border-radius: 50%;
        background-color: #222222;
        color: #ffffff;
        cursor: pointer;
        outline: none;
        padding: 0;
        transition: transform 0.15s ease, box-shadow 0.15s ease,
                background-color 0.15s ease;
        box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.18 );
        -webkit-tap-highlight-color: transparent;
}

.wsh-play-btn:hover {
        transform: scale( 1.08 );
        box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.25 );
}

.wsh-play-btn:focus-visible {
        box-shadow: 0 0 0 3px rgba( 0, 0, 0, 0.15 ),
                0 0 0 5px rgba( 255, 255, 255, 0.8 );
}

.wsh-play-btn:active {
        transform: scale( 0.96 );
}

/* ==================================================================
 * ICON WRAPPER
 * ================================================================== */

.wsh-icon-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width:  var( --wsh-icon-size, calc( var( --wsh-btn-size, 44px ) * 0.48 ) );
        height: var( --wsh-icon-size, calc( var( --wsh-btn-size, 44px ) * 0.48 ) );
        pointer-events: none;
}

/* Default SVG icons (shipped with the plugin). */
.wsh-icon-wrapper .wsh-default-icon {
        width: 100%;
        height: 100%;
        display: block;
}

/* Bricks icon picker SVGs — make them fill the wrapper. */
.wsh-icon-wrapper svg {
        width: 100%;
        height: 100%;
        display: block;
        fill: currentColor;
}

/* Bricks may wrap SVGs in a span — handle that too. */
.wsh-icon-wrapper > span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
}

.wsh-icon-wrapper > span svg {
        width: 100%;
        height: 100%;
        fill: currentColor;
}

/* Bricks icon picker: icon fonts (<i>, <span class="bricks-icon-*">).
   These are sized by font-size, not width/height. */
.wsh-icon-wrapper i,
.wsh-icon-wrapper [class*="bricks-icon"] {
        font-size: inherit;
        line-height: 1;
}

/* ==================================================================
 * EMPTY STATE NOTICE
 * ================================================================== */

.wsh-empty-notice {
        color: #888888;
        font-size: 14px;
        font-style: italic;
        text-align: center;
        padding: 12px 0;
        margin: 0;
}

/* ==================================================================
 * HIDDEN CONFIG CARRIER
 *
 * Bricks writes real CSS properties here via the 'css' control
 * property (color, background-color, border-top-color, etc.).
 * JS reads them via getComputedStyle() to get element-level or
 * class-level values.  The span is invisible and zero-sized so
 * it never affects the layout.
 *
 * NOTE: No overflow property is set here.  Setting overflow would
 * conflict with CSS specificity when Bricks tries to set it via
 * a class-level rule (which targets just .wsh-cfg, while the
 * stylesheet targets .wsh-wrapper .wsh-cfg).
 * ================================================================== */

.wsh-wrapper .wsh-cfg {
        display: block;
        position: absolute;
        width: 0;
        height: 0;
        pointer-events: none;

        /* Default values — Bricks overrides these when the user
           picks a colour at element or class level. */
        color: #999999;             /* → waveColor default */
        background-color: #333333;  /* → progressColor default */

        /* Border colour carriers — border is NONE so nothing renders
           visually, but the individual colour properties are still
           readable via getComputedStyle() for JS.  Previously this
           used "border: 1px solid #111111" which caused a tiny
           coloured square to bleed through at the element's position. */
        border: none;
        border-top-color: #111111;     /* → cursorColor default */
        border-left-color: #4f46e5;    /* → gradientStart default */
        border-right-color: #06b6d4;   /* → gradientEnd default */
        border-bottom-color: #111111;  /* → btnGradStart default */

        white-space: normal;             /* → gradientDirection default (left-to-right) */

        /* Number defaults — Bricks overrides these when the user
           sets a value at element or class level. */
        font-size: 1px;            /* → cursorWidth default */
        font-style: normal;        /* → normalize default (Off) */
        text-align: left;          /* → buttonPosition default (Left) */
        line-height: 2px;          /* → barWidth default */
        letter-spacing: 1px;       /* → barHeight default */
        word-spacing: 2px;         /* → barRadius default */

        /* Outline carrier — style is NONE so nothing renders
           visually, but the colour remains readable via
           getComputedStyle() for JS. */
        outline-style: none;
        outline-color: transparent; /* → btnGradEnd default (outline-color) */

        /* Progress gradient CSS carrier defaults.
           accent-color → #ec4899, caret-color → #f97316 */
        accent-color: #ec4899;    /* → progressGradStart default */
        caret-color: #f97316;     /* → progressGradEnd default */
}

/* ==================================================================
 * PROGRESS GRADIENT CONFIG CARRIER
 *
 * Separate carrier element for progress gradient Angle/Type CSS
 * carriers.  Keeps these independent of the waveform's tab-size
 * and text-transform carriers on .wsh-cfg, so both gradient
 * systems can inherit from Bricks classes (blue dot) without
 * conflicting with each other.
 *
 * No explicit tab-size or text-transform defaults are set here.
 * The browser defaults (tab-size: 8, text-transform: none) act
 * as sentinel values in JS to detect "no class override" and
 * fall back to the data attribute.
 * ================================================================== */

.wsh-wrapper .wsh-prog-cfg {
        display: block;
        position: absolute;
        width: 0;
        height: 0;
        pointer-events: none;
}

/* ==================================================================
 * RESPONSIVE
 * ================================================================== */

@media ( max-width: 600px ) {
        .wsh-wrapper {
                gap: 10px;
                padding: 12px 0;
        }
}
