/* Premium Styles for Dojo Meditation Player */

.dojo-meditation-player-container {
    background: rgba(18, 20, 29, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 24px;
    margin: 20px 0;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-family: var(--kd-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    position: relative;
    overflow: hidden;
}

/* Light theme overrides if container is inside light parent */
.dojo-meditation-player-container.dojo-light-theme {
    background: rgba(18, 20, 29, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.dojo-meditation-badge-test {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 9999px;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.dojo-meditation-player-body {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

@media (max-width: 480px) {
    .dojo-meditation-player-body {
        flex-direction: column;
        text-align: center;
    }
}

.dojo-meditation-cover {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: #0d0d18;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dojo-meditation-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dojo-meditation-cover-placeholder {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dojo-meditation-placeholder-icon {
    font-size: 36px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.dojo-meditation-info {
    flex-grow: 1;
}

.dojo-meditation-title {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: inherit;
}

.dojo-meditation-date {
    font-size: 12px;
    opacity: 0.6;
    margin-bottom: 10px;
    font-weight: 500;
}

.dojo-meditation-desc {
    font-size: 13.5px;
    line-height: 1.5;
    opacity: 0.85;
    margin: 0;
}
.dojo-meditation-desc p {
    margin: 0 0 8px 0;
}
.dojo-meditation-desc p:last-child {
    margin-bottom: 0;
}

/* Timeline/Seekbar styling */
.dojo-meditation-timeline-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dojo-meditation-time-current {
    opacity: 0.7;
    width: 32px;
    text-align: right;
}

.dojo-meditation-time-duration {
    opacity: 0.7;
    width: 32px;
    text-align: left;
}

.dojo-meditation-progress-wrapper {
    flex-grow: 1;
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    cursor: pointer;
}

.dojo-meditation-player-container.dojo-light-theme .dojo-meditation-progress-wrapper {
    background: rgba(0, 0, 0, 0.08);
}

.dojo-meditation-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #881337 0%, #b91c1c 45%, #ef4444 100%);
    border-radius: 9999px;
    pointer-events: none;
    transition: width 0.1s linear;
}

/* Range input overlay for custom seek styling */
.dojo-meditation-seekbar {
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 16px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    z-index: 2;
}

/* Show slider knob on hover */
.dojo-meditation-progress-wrapper:hover {
    height: 8px;
}
.dojo-meditation-progress-wrapper:hover .dojo-meditation-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.95), 0 2px 5px rgba(0,0,0,0.5);
}

/* Controls row */
.dojo-meditation-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.dojo-meditation-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.dojo-meditation-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.dojo-meditation-player-container.dojo-light-theme .dojo-meditation-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dojo-meditation-btn:active {
    transform: scale(0.95);
}

/* Play/Pause toggle specific */
.dojo-meditation-btn-toggle {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    width: 48px;
    height: 48px;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.dojo-meditation-btn-toggle:hover {
    filter: brightness(1.15);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

/* Speed controller button styling */
.dojo-meditation-btn-speed {
    font-size: 11px;
    font-weight: 700;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    width: auto;
    height: auto;
}

.dojo-meditation-player-container.dojo-light-theme .dojo-meditation-btn-speed {
    border-color: rgba(0, 0, 0, 0.15);
}

/* Rewind / Fast Forward label styling */
.dojo-meditation-btn-rewind,
.dojo-meditation-btn-forward {
    position: relative;
}

.btn-sec-label {
    position: absolute;
    font-size: 7px;
    font-weight: 800;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Header menu player */
.dojo-meditation-header-player[hidden] {
    display: none !important;
}

.dojo-meditation-header-player {
    display: block;
    list-style: none;
    flex: 0 1 440px;
    max-width: min(440px, 42vw);
    min-width: 0;
    margin: 0 8px 0 0;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.dojo-meditation-header-player.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.kd-header__inner > .dojo-meditation-header-player.is-open {
    margin-left: auto;
}

.kd-header__inner > .dojo-meditation-header-player.is-open + .kd-nav {
    margin-left: 0;
}

.dojo-meditation-player-container--header {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 44px;
    margin: 0;
    padding: 5px 34px 5px 7px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dojo-meditation-player-container.dojo-light-theme.dojo-meditation-player-container--header {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.dojo-meditation-header-player-close {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    transform: translateY(-50%);
    transition: background 0.16s ease;
}

.dojo-meditation-header-player-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dojo-meditation-player-container--header .dojo-meditation-player-body {
    min-width: 0;
    flex: 1 1 150px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.dojo-meditation-player-container--header .dojo-meditation-cover {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    box-shadow: none;
}

.dojo-meditation-player-container--header .dojo-meditation-header-player-placeholder {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.75);
}

.dojo-meditation-player-container--header .dojo-meditation-info {
    min-width: 0;
}

.dojo-meditation-player-container--header .dojo-meditation-title {
    margin: 0;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 700;
}

.dojo-meditation-player-container--header .dojo-meditation-controls-wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dojo-meditation-player-container--header .dojo-meditation-timeline-container {
    width: 94px;
    margin: 0;
    gap: 0;
}

.dojo-meditation-player-container--header .dojo-meditation-time-current,
.dojo-meditation-player-container--header .dojo-meditation-time-duration {
    display: none;
}

.dojo-meditation-player-container--header .dojo-meditation-controls-row {
    gap: 4px;
}

.dojo-meditation-player-container--header .dojo-meditation-btn {
    width: 28px;
    height: 28px;
    padding: 5px;
}

.dojo-meditation-player-container--header .dojo-meditation-btn-toggle {
    width: 32px;
    height: 32px;
    box-shadow: none;
}

.dojo-meditation-player-container--header .dojo-meditation-btn-speed,
.dojo-meditation-player-container--header .dojo-meditation-btn-volume {
    display: none;
}

@media (max-width: 1120px) {
    .dojo-meditation-header-player {
        max-width: min(340px, 36vw);
    }

    .dojo-meditation-player-container--header .dojo-meditation-title {
        max-width: 110px;
    }

    .dojo-meditation-player-container--header .dojo-meditation-timeline-container {
        width: 72px;
    }
}

@media (max-width: 900px) {
    .dojo-meditation-player-container--header .dojo-meditation-btn-rewind,
    .dojo-meditation-player-container--header .dojo-meditation-btn-forward {
        display: none;
    }
}

@media (max-width: 768px) {
    .dojo-meditation-header-player {
        order: 2;
        flex: 1 1 auto;
        max-width: min(320px, 54vw);
        margin-left: auto;
        margin-right: 6px;
    }

    .kd-header__inner > .dojo-meditation-header-player.is-open + .kd-nav {
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    .dojo-meditation-header-player {
        max-width: min(230px, 48vw);
    }

    .dojo-meditation-player-container--header {
        padding-right: 30px;
    }

    .dojo-meditation-player-container--header .dojo-meditation-cover,
    .dojo-meditation-player-container--header .dojo-meditation-timeline-container {
        display: none;
    }

    .dojo-meditation-player-container--header .dojo-meditation-title {
        max-width: 88px;
    }
}
