/* Audio Start Message */
.audio-start-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-start-message.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.message-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 255, 0.95));
    backdrop-filter: blur(20px);
    padding: 40px 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: pulseGlow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.message-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #FF6B6B, #4ECDC4);
    border-radius: 27px;
    z-index: -1;
    animation: borderRotate 4s linear infinite;
}

@keyframes borderRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message-content p {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

@keyframes pulseGlow {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 
            0 30px 60px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
}

/* Desktop Audio Controls */
.audio-controls {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
    backdrop-filter: blur(25px);
    border-radius: 16px;
    padding: 0;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    z-index: 1001;
    cursor: move;
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.audio-controls:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(102, 126, 234, 0.25);
}

.audio-controls.dragging {
    cursor: grabbing;
    opacity: 0.9;
    transform: rotate(0.5deg);
}

.audio-controls.minimized {
    min-width: 180px;
    max-width: 180px;
    width: 180px;
}

.audio-controls.minimized .audio-content {
    display: none;
}

.audio-controls.minimized .minimize-btn {
    transform: rotate(180deg);
}

.audio-controls:not(.minimized) {
    min-width: auto;
    max-width: none;
    width: auto;
}

.audio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    position: relative;
    user-select: none;
    font-size: 0.9rem;
}

.audio-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.08), transparent);
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.audio-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.minimize-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn:hover {
    background: rgba(255, 107, 107, 0.8);
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.4);
}

.audio-content {
    padding: 10px;
    display: flex;    
    gap: 8px;
}

.audio-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
}

.audio-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.audio-button:hover::before {
    left: 100%;
}

.audio-button:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.3);
}

.audio-button:active {
    transform: translateY(0) scale(0.98);
}

.audio-button.reading {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
}

.audio-button.reading:hover {
    box-shadow: 0 6px 18px rgba(255, 107, 107, 0.3);
}

.button-icon {
    font-size: 0.9rem;
}

/* Language selector */
.language-selector {
    display: flex;
    gap: 6px;
    background: rgba(102, 126, 234, 0.08);
    padding: 4px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: transparent;
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.lang-btn.active:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.02);
}

/* Mobile Audio Controls */
.mobile-audio-control {
    display: none;
    position: fixed;
    top: 20px;
    right: 70px;
    z-index: 1001;
}

.mobile-audio-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.mobile-audio-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.mobile-audio-btn:hover::before {
    left: 100%;
}

.mobile-audio-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.mobile-audio-btn:active {
    transform: scale(0.98);
}

.mobile-audio-btn.reading {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.mobile-audio-btn.reading:hover {
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.mobile-btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
    margin-left: 1px;
}

.mobile-btn-text {
    display: none;
}

.mobile-audio-btn.reading .mobile-btn-icon {
    transform: scale(1.1);
    margin-left: 0;
}