/**
 * WP Podcast TTS - Premium Glassmorphism Player CSS
 * Siêu nhẹ, không phụ thuộc thư viện ngoài
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* =============================================
   CONTAINER & CARD
   ============================================= */

.wp-podcast-tts-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0 0 28px 0;
    position: relative;
    border-radius: 18px;
}

span.wp-podcast-play-icon {
    display: flex;
}

.wp-podcast-player-card {
    position: relative;
    border-radius: 18px;
    padding: 20px 22px;
    /* Dark gradient nền chính */
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2d45 50%, #0f2238 100%);
    border: 1px solid rgba(99, 202, 255, 0.18);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(99, 202, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Hiệu ứng ánh sáng phản chiếu Glassmorphism */
.wp-podcast-blur-bg {
    position: absolute;
    top: -40%;
    left: -20%;
    width: 60%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
    animation: wp-podcast-glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes wp-podcast-glow-pulse {
    from { opacity: 0.6; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.08); }
}

/* =============================================
   LAYOUT
   ============================================= */

.wp-podcast-player-layout {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* =============================================
   NÚT PLAY / PAUSE CHÍNH
   ============================================= */

.wp-podcast-control-left {
    flex-shrink: 0;
}

.wp-podcast-btn-play {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
	margin: 0;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Gradient nút Play neon cyan */
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 60%, #0284c7 100%);
    box-shadow:
        0 4px 20px rgba(56, 189, 248, 0.45),
        0 0 0 0 rgba(56, 189, 248, 0.4);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    color: #fff;
}

.wp-podcast-btn-play:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 28px rgba(56, 189, 248, 0.6),
        0 0 0 6px rgba(56, 189, 248, 0.12);
}

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

/* Trạng thái đang phát: nút nhấp nháy nhẹ */
.wp-podcast-btn-play.is-playing {
    animation: wp-podcast-playing-pulse 2s ease-in-out infinite;
}

@keyframes wp-podcast-playing-pulse {
    0%   { box-shadow: 0 4px 20px rgba(56,189,248,0.45), 0 0 0 0 rgba(56,189,248,0.4); }
    50%  { box-shadow: 0 4px 20px rgba(56,189,248,0.6), 0 0 0 10px rgba(56,189,248,0); }
    100% { box-shadow: 0 4px 20px rgba(56,189,248,0.45), 0 0 0 0 rgba(56,189,248,0.4); }
}

/* Vòng xoay Loading Spinner */
.wp-podcast-loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wp-podcast-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes wp-podcast-spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   KHU VỰC TRUNG TÂM: Thông tin + Thanh tiến trình
   ============================================= */

.wp-podcast-info-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wp-podcast-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.wp-podcast-status-text {
    font-size: 13px;
    font-weight: 600;
    color: rgba(186, 230, 253, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.wp-podcast-time-display {
    font-size: 11px;
    font-weight: 500;
    color: rgba(99, 179, 237, 0.7);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

/* =============================================
   THANH TIẾN TRÌNH
   ============================================= */

.wp-podcast-progress-bar-container {
    cursor: pointer;
    padding: 6px 0;
}

.wp-podcast-progress-bar {
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    transition: height 0.15s ease;
}

.wp-podcast-progress-bar-container:hover .wp-podcast-progress-bar {
    height: 6px;
}

.wp-podcast-progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transition: width 0.15s linear;
    pointer-events: none;
}

.wp-podcast-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
    transition: transform 0.15s ease, left 0.15s linear;
    pointer-events: none;
}

.wp-podcast-progress-bar-container:hover .wp-podcast-progress-handle {
    transform: translate(-50%, -50%) scale(1);
}

/* =============================================
   ĐIỀU KHIỂN PHẢI: Tua nhanh + Tốc độ
   ============================================= */

.wp-podcast-control-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wp-podcast-btn-skip {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(186, 230, 253, 0.8);
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.wp-podcast-btn-skip:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

/* Chọn tốc độ phát */
.wp-podcast-speed-control {
    position: relative;
}

.wp-podcast-btn-speed {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(186, 230, 253, 0.8);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0 10px;
	margin: 0;
    height: 34px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.wp-podcast-btn-speed:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

/* Dropdown chọn tốc độ */
.wp-podcast-speed-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #1a2d45;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    overflow: hidden;
    min-width: 80px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 4px;
}

.wp-podcast-speed-control.is-open .wp-podcast-speed-dropdown {
    display: block;
    animation: wp-podcast-dropdown-in 0.15s ease;
}

@keyframes wp-podcast-dropdown-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wp-podcast-speed-option {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(186, 230, 253, 0.75);
    cursor: pointer;
    border-radius: 7px;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.wp-podcast-speed-option:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.wp-podcast-speed-option.active {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    font-weight: 700;
}

/* =============================================
   RESPONSIVE (Mobile)
   ============================================= */

@media screen and (max-width: 480px) {
    .wp-podcast-player-card {
        padding: 16px 14px;
    }

    .wp-podcast-player-layout {
        gap: 12px;
    }

    .wp-podcast-btn-play {
        width: 44px;
		
        height: 44px;
    }

    .wp-podcast-control-right {
        flex-direction: column;
        gap: 4px;
    }

    .wp-podcast-status-text {
        font-size: 12px;
    }
}

/* =============================================
   BROWSER TTS - SÓNG ÂM ANIMATED
   ============================================= */

.wp-podcast-browser-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    margin-top: 6px;
}

.wp-podcast-browser-wave span {
    display: inline-block;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #818cf8);
    animation: wp-podcast-wave 1.2s ease-in-out infinite;
    opacity: 0.85;
}

.wp-podcast-browser-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.wp-podcast-browser-wave span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.wp-podcast-browser-wave span:nth-child(3) { height: 18px; animation-delay: 0.3s; }
.wp-podcast-browser-wave span:nth-child(4) { height: 14px; animation-delay: 0.45s; }
.wp-podcast-browser-wave span:nth-child(5) { height: 8px;  animation-delay: 0.6s; }

@keyframes wp-podcast-wave {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50%       { transform: scaleY(1);   opacity: 1; }
}

