/* TappLaza Multilingual — ElevenLabs TTS Player */

.tmlg-tts-wrap {
    margin: 0 0 24px 0;
    font-family: inherit;
}

/* ── Generate button ── */
.tmlg-tts-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(15, 52, 96, 0.35);
    letter-spacing: 0.3px;
}

.tmlg-tts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 52, 96, 0.5);
    background: linear-gradient(135deg, #16213e 0%, #0f3460 50%, #533483 100%);
}

.tmlg-tts-btn:active {
    transform: translateY(0);
}

.tmlg-tts-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.tmlg-tts-icon {
    font-size: 20px;
    line-height: 1;
    animation: none;
}

.tmlg-tts-btn.loading .tmlg-tts-icon {
    animation: tmlg-pulse 1s infinite;
}

@keyframes tmlg-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* ── Audio player ── */
.tmlg-tts-player {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-radius: 16px;
    padding: 18px 22px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(15, 52, 96, 0.4);
    position: relative;
    overflow: hidden;
}

.tmlg-tts-player::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(83,52,131,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.tmlg-tts-player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tmlg-tts-title {
    font-weight: 700;
    font-size: 15px;
    flex: 1;
}

.tmlg-tts-lang {
    font-weight: 400;
    opacity: 0.75;
    font-size: 13px;
}

.tmlg-tts-powered {
    font-size: 11px;
    opacity: 0.5;
    margin-left: auto;
    letter-spacing: 0.5px;
}

/* ── Hide default audio element, use custom controls ── */
.tmlg-tts-audio {
    width: 100%;
    display: none;
}

/* ── Custom controls ── */
.tmlg-tts-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tmlg-tts-play-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 50px;
    padding: 8px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 80px;
}

.tmlg-tts-play-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
}

.tmlg-tts-progress-wrap {
    flex: 1;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    height: 6px;
    cursor: pointer;
    position: relative;
}

.tmlg-tts-progress-bar {
    background: linear-gradient(90deg, #a78bfa, #60a5fa);
    height: 100%;
    border-radius: 20px;
    width: 0%;
    transition: width 0.1s;
    position: relative;
}

.tmlg-tts-progress-bar::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.tmlg-tts-progress-wrap:hover .tmlg-tts-progress-bar::after {
    opacity: 1;
}

.tmlg-tts-time {
    font-size: 12px;
    opacity: 0.7;
    min-width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Sound wave animation ── */
.tmlg-tts-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.tmlg-tts-wave span {
    display: block;
    width: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.6);
    animation: tmlg-wave 1.2s ease-in-out infinite;
}

.tmlg-tts-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.tmlg-tts-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.tmlg-tts-wave span:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.tmlg-tts-wave span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.tmlg-tts-wave span:nth-child(5) { height: 14px; animation-delay: 0.4s; }
.tmlg-tts-wave span:nth-child(6) { height: 8px;  animation-delay: 0.5s; }

.tmlg-tts-wave.paused span {
    animation-play-state: paused;
}

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

/* ── Responsive ── */
@media (max-width: 480px) {
    .tmlg-tts-player { padding: 14px 16px; }
    .tmlg-tts-powered { display: none; }
    .tmlg-tts-btn { font-size: 14px; padding: 10px 16px; }
}

/* ── Browser TTS player variant ── */
.tmlg-tts-browser {
    background: linear-gradient(135deg, #1a3a1a 0%, #1e4d1e 60%, #145214 100%);
}

.tmlg-tts-browser::before {
    background: radial-gradient(circle, rgba(34,139,34,0.2) 0%, transparent 70%);
}

.tmlg-tts-badge {
    font-size: 11px;
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    margin-left: auto;
    white-space: nowrap;
}

.tmlg-tts-browser .tmlg-tts-play-btn {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

.tmlg-tts-browser .tmlg-tts-play-btn:hover {
    background: rgba(255,255,255,0.22);
}

/* ── Both engine notice on settings ── */
.tmlg-tts-engines {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tmlg-tts-engine-card {
    flex: 1;
    min-width: 200px;
    padding: 14px;
    border-radius: 8px;
    border: 2px solid #dcdcde;
    background: #f9f9f9;
}

.tmlg-tts-engine-card.active {
    border-color: #2271b1;
    background: #f0f6fc;
}

.tmlg-tts-engine-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
}

.tmlg-tts-engine-card p {
    margin: 0;
    font-size: 12px;
    color: #666;
}
