/**
 * BCM Post Speech Text - Frontend Styles
 */

/* Modern Button Style */
.bcm-speech-btn-modern {
    background: linear-gradient(135deg, var(--bcm-btn-color, #667eea) 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin: 10px 0;
}

/* Button Size Variations - Apply to all button styles */
.bcm-speech-btn.size-small {
    padding: 8px 16px !important;
    font-size: 12px !important;
    gap: 6px !important;
}

.bcm-speech-btn.size-medium {
    padding: 12px 20px !important;
    font-size: 14px !important;
    gap: 8px !important;
}

.bcm-speech-btn.size-large {
    padding: 16px 28px !important;
    font-size: 16px !important;
    gap: 10px !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 15px auto !important;
}

.bcm-speech-btn.size-xlarge {
    padding: 20px 36px !important;
    font-size: 18px !important;
    gap: 12px !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 400px !important;
    margin: 20px auto !important;
}

.bcm-speech-btn-modern:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.bcm-speech-btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Classic Button Style */
.bcm-speech-btn-classic {
    background: #0073aa;
    border: 1px solid #005177;
    border-radius: 4px;
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bcm-speech-btn-classic:hover {
    background: #005177;
}

.bcm-speech-btn-classic:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Minimal Button Style */
.bcm-speech-btn-minimal {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bcm-speech-btn-minimal:hover {
    background: #f5f5f5;
    border-color: #999;
}

.bcm-speech-btn-minimal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Shortcode Button Style */
.bcm-speech-btn-shortcode {
    background: var(--bcm-btn-color, #28a745);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bcm-speech-btn-shortcode:hover {
    background: #218838;
    transform: translateY(-1px);
}

.bcm-speech-btn-shortcode:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Container */
.bcm-speech-container {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.bcm-speech-shortcode {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

/* Controls */
.bcm-speech-controls {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.bcm-speech-info {
    margin-bottom: 10px;
}

.bcm-speech-status {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.bcm-speech-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

.bcm-speech-status.success {
    background: #d4edda;
    color: #155724;
}

.bcm-speech-status.warning {
    background: #fff3cd;
    color: #856404;
}

.bcm-speech-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Player */
.bcm-speech-player {
    margin: 10px 0;
}

.bcm-speech-player audio {
    width: 100%;
    height: 40px;
    border-radius: 4px;
}

/* Sound Wave Visualization */
.bcm-sound-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    width: 100%;
}

.bcm-wave-bars {
    display: flex;
    align-items: end;
    gap: 3px;
    height: 60px;
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

.bcm-wave-bar {
    width: 8px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 4px;
    height: 8px;
    transition: height 0.1s ease;
    flex-shrink: 0;
}

/* Wave Style Variations */
.wave-style-gradient .bcm-wave-bar {
    background: linear-gradient(to top, #667eea, #764ba2);
}

.wave-style-solid .bcm-wave-bar {
    background: #4285f4;
}

.wave-style-green .bcm-wave-bar {
    background: linear-gradient(to top, #34a853, #0f9d58);
}

.wave-style-red .bcm-wave-bar {
    background: linear-gradient(to top, #ea4335, #c5221f);
}

.wave-style-rainbow .bcm-wave-bar:nth-child(1) { background: linear-gradient(to top, #ff0000, #ff7f00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(2) { background: linear-gradient(to top, #ff7f00, #ffff00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(3) { background: linear-gradient(to top, #ffff00, #00ff00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(4) { background: linear-gradient(to top, #00ff00, #0000ff); }
.wave-style-rainbow .bcm-wave-bar:nth-child(5) { background: linear-gradient(to top, #0000ff, #4b0082); }
.wave-style-rainbow .bcm-wave-bar:nth-child(6) { background: linear-gradient(to top, #4b0082, #9400d3); }
.wave-style-rainbow .bcm-wave-bar:nth-child(7) { background: linear-gradient(to top, #9400d3, #ff0000); }
.wave-style-rainbow .bcm-wave-bar:nth-child(8) { background: linear-gradient(to top, #ff0000, #ff7f00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(9) { background: linear-gradient(to top, #ff7f00, #ffff00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(10) { background: linear-gradient(to top, #ffff00, #00ff00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(11) { background: linear-gradient(to top, #00ff00, #0000ff); }
.wave-style-rainbow .bcm-wave-bar:nth-child(12) { background: linear-gradient(to top, #0000ff, #4b0082); }
.wave-style-rainbow .bcm-wave-bar:nth-child(13) { background: linear-gradient(to top, #4b0082, #9400d3); }
.wave-style-rainbow .bcm-wave-bar:nth-child(14) { background: linear-gradient(to top, #9400d3, #ff0000); }
.wave-style-rainbow .bcm-wave-bar:nth-child(15) { background: linear-gradient(to top, #ff0000, #ff7f00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(16) { background: linear-gradient(to top, #ff7f00, #ffff00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(17) { background: linear-gradient(to top, #ffff00, #00ff00); }
.wave-style-rainbow .bcm-wave-bar:nth-child(18) { background: linear-gradient(to top, #00ff00, #0000ff); }
.wave-style-rainbow .bcm-wave-bar:nth-child(19) { background: linear-gradient(to top, #0000ff, #4b0082); }
.wave-style-rainbow .bcm-wave-bar:nth-child(20) { background: linear-gradient(to top, #4b0082, #9400d3); }
.wave-style-rainbow .bcm-wave-bar:nth-child(21) { background: linear-gradient(to top, #9400d3, #ff0000); }

/* Wave bar animations for all 21 bars */
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(1) { animation: waveBar1 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(2) { animation: waveBar2 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(3) { animation: waveBar3 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(4) { animation: waveBar4 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(5) { animation: waveBar5 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(6) { animation: waveBar6 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(7) { animation: waveBar7 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(8) { animation: waveBar8 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(9) { animation: waveBar9 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(10) { animation: waveBar10 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(11) { animation: waveBar11 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(12) { animation: waveBar12 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(13) { animation: waveBar13 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(14) { animation: waveBar14 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(15) { animation: waveBar15 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(16) { animation: waveBar16 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(17) { animation: waveBar17 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(18) { animation: waveBar18 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(19) { animation: waveBar19 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(20) { animation: waveBar20 1.2s ease-in-out infinite; }
.bcm-wave-bars.playing .bcm-wave-bar:nth-child(21) { animation: waveBar21 1.2s ease-in-out infinite; }

@keyframes waveBar1 { 0%, 100% { height: 8px; } 50% { height: 55px; } }
@keyframes waveBar2 { 0%, 100% { height: 12px; } 50% { height: 40px; } }
@keyframes waveBar3 { 0%, 100% { height: 6px; } 50% { height: 45px; } }
@keyframes waveBar4 { 0%, 100% { height: 15px; } 50% { height: 35px; } }
@keyframes waveBar5 { 0%, 100% { height: 10px; } 50% { height: 60px; } }
@keyframes waveBar6 { 0%, 100% { height: 8px; } 50% { height: 30px; } }
@keyframes waveBar7 { 0%, 100% { height: 12px; } 50% { height: 40px; } }
@keyframes waveBar8 { 0%, 100% { height: 6px; } 50% { height: 45px; } }
@keyframes waveBar9 { 0%, 100% { height: 14px; } 50% { height: 33px; } }
@keyframes waveBar10 { 0%, 100% { height: 9px; } 50% { height: 47px; } }
@keyframes waveBar11 { 0%, 100% { height: 11px; } 50% { height: 37px; } }
@keyframes waveBar12 { 0%, 100% { height: 13px; } 50% { height: 42px; } }
@keyframes waveBar13 { 0%, 100% { height: 7px; } 50% { height: 38px; } }
@keyframes waveBar14 { 0%, 100% { height: 16px; } 50% { height: 48px; } }
@keyframes waveBar15 { 0%, 100% { height: 9px; } 50% { height: 52px; } }
@keyframes waveBar16 { 0%, 100% { height: 12px; } 50% { height: 35px; } }
@keyframes waveBar17 { 0%, 100% { height: 8px; } 50% { height: 44px; } }
@keyframes waveBar18 { 0%, 100% { height: 14px; } 50% { height: 39px; } }
@keyframes waveBar19 { 0%, 100% { height: 10px; } 50% { height: 46px; } }
@keyframes waveBar20 { 0%, 100% { height: 11px; } 50% { height: 41px; } }
@keyframes waveBar21 { 0%, 100% { height: 13px; } 50% { height: 43px; } }

/* Player Controls */
.bcm-player-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

/* Play Button */
.bcm-play-button {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bcm-play-button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.bcm-play-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Stop Button */
.bcm-speech-stop {
    padding: 12px 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bcm-speech-stop:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Options */
.bcm-speech-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 15px;
}

.bcm-speech-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.bcm-speech-options select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.bcm-speech-options input[type="range"] {
    width: 100px;
    margin: 0 5px;
}

.bcm-speed-value {
    font-weight: 600;
    color: #333;
    min-width: 30px;
}

/* Icons */
.bcm-speech-icon {
    font-size: 16px;
}

.bcm-speech-loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .bcm-speech-container {
        margin: 15px 0;
        padding: 12px;
    }
    
    .bcm-speech-controls {
        padding: 12px;
    }
    
    .bcm-speech-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .bcm-speech-btn-modern,
    .bcm-speech-btn-classic,
    .bcm-speech-btn-minimal,
    .bcm-speech-btn-shortcode {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bcm-speech-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .bcm-speech-controls {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .bcm-speech-btn-minimal {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .bcm-speech-btn-minimal:hover {
        background: #718096;
    }
    
    .bcm-speech-options select {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
}

/* Accessibility */
.bcm-speech-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.bcm-speech-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Print styles */
@media print {
    .bcm-speech-container {
        display: none;
    }
}
