/* Custom Audio Player with Big Green Pulsing Play Button */

.tale-audio-player {
    position: relative;
    width: 100%;
    margin-top: 1rem;
    padding: 0;
    background: transparent;
    border-radius: 10px;
    order: 2;
}

/* Hide default audio controls completely */
.tale-audio-player audio,
#tale-audio {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Custom audio player container */
.custom-audio-player {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Big green pulsing play button */
.custom-play-button {
    position: relative;
    width: 70px;
    height: 70px;
    min-width: 70px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    z-index: 2;
    animation: gentle-blink 1.5s ease-in-out infinite;
}

/* Pulsing animation */
.custom-play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Gentle blink animation for button */
@keyframes gentle-blink {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 6px 25px rgba(16, 185, 129, 0.8);
        transform: scale(1.05);
    }
}

/* Hover effect */
.custom-play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Active/playing state */
.custom-play-button:active {
    transform: scale(0.95);
}

.custom-play-button.playing {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    animation: none; /* Stop blinking when playing */
    opacity: 1; /* Ensure full opacity when playing */
}

.custom-play-button.playing::before {
    animation: none;
}

/* Play/Pause icon */
.custom-play-button i {
    margin-left: 3px; /* Slight offset for play icon to look centered */
}

.custom-play-button.playing i {
    margin-left: 0;
}

/* Progress container */
.custom-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Time display */
.custom-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress bar */
.custom-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
}

.custom-progress-bar:hover {
    height: 10px;
}

.custom-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.1s linear;
}

/* Loading state */
.custom-audio-player.loading .custom-play-button {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    cursor: not-allowed;
    animation: none;
}

.custom-audio-player.loading .custom-play-button::before {
    animation: none;
}

/* VIP feature message styling */
.vip-feature-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.vip-feature-message i {
    color: #f59e0b;
    font-size: 1.2rem;
}

/* Audio Order Container - коли немає аудіо */
.audio-order-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-audio-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.no-audio-message i {
    color: #3b82f6;
    font-size: 1.2rem;
}

.audio-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.audio-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.audio-order-btn:active {
    transform: translateY(0);
}

.audio-order-btn i {
    font-size: 1.2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .custom-audio-player {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .custom-play-button {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 24px;
    }

    .custom-time-display {
        font-size: 0.75rem;
    }

    .custom-progress-bar {
        height: 6px;
    }

    .custom-progress-bar:hover {
        height: 8px;
    }

    .vip-feature-message {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .audio-order-container {
        padding: 1rem;
    }
    
    .no-audio-message {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .audio-order-btn {
        font-size: 0.9rem;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .custom-audio-player {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .custom-play-button {
        width: 70px;
        height: 70px;
        align-self: center;
    }

    .custom-progress-container {
        width: 100%;
    }
    
    .audio-order-container {
        padding: 0.875rem;
    }
    
    .no-audio-message {
        font-size: 0.8rem;
    }
    
    .audio-order-btn {
        font-size: 0.85rem;
    }
}
