.avatar-web-container {
    position: relative;
    overflow: hidden;
}

.avatar-web-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.avatar-web-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease-in-out;
}

.avatar-web-avatar:not(.avatar-web-avatar-visible) {
    opacity: 0;
    pointer-events: none;
}

/* === NEW Play Button Styles === */
.play-button {
    position: fixed; /* Position relative to viewport */
    bottom: 150px; /* Moved up further */
    left: 20px;
    width: 130px; /* Increased size */
    height: 130px; /* Increased size */
    background-color: rgba(255, 19, 0, 0.6); /* Blue with 0.6 opacity */
    border: none;
    border-radius: 50%; /* Make it round */
    color: white;
    font-size: 52px; /* Increased icon size */
    display: flex; /* Use flexbox to center icon */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Slightly stronger shadow for transparent bg */
    z-index: 100002; /* Above component container */
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    animation: pulse 2s infinite; /* Apply pulsing animation */
}

.play-button:hover {
    background-color: rgba(255, 0,0, 0.8); /* Darker blue, 0.8 opacity on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    animation-play-state: paused; /* Pause animation on hover */
}

.play-button i {
    /* Adjust icon position slightly if needed */
    margin-left: 7px; /* Adjusted margin for larger size */
}

/* Pulsing Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4); /* Adjusted shadow color/spread */
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6); /* Adjusted shadow color/spread */
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4); /* Adjusted shadow color/spread */
    }
}

/* === End NEW Play Button Styles === */

/* === Play Button Click Animation === */
@keyframes playButtonClickEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.play-button-clicked {
    animation: playButtonClickEffect 0.5s ease-out; /* Apply the click animation */
    background-color: #4CAF50 !important; /* Green background on click */
}

/* Add styles for the fullscreen button */
.fullscreen-button {
    position: fixed;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 999999;
}

.fullscreen-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Style for the icon inside the button */
.fullscreen-button i {
    display: block; /* Ensures the icon behaves like a block element */
}

/* Toast notification style */
#toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-align: center;
    border-radius: 10px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    font-size: 16px;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

/* Config panel style */
#config-panel {
    display: none !important; /* Force hiding with !important */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
    width: 300px;
    visibility: hidden; /* Add visibility hidden as a backup */
    opacity: 0; /* Start with opacity 0 */
    transition: opacity 0.3s; /* Add transition for smoother appearance */
}

#config-panel.show {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

#config-panel h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.config-item {
    margin-bottom: 15px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
}

.volume-control {
    width: 100%;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* Config trigger style */
#config-trigger {
    position: fixed;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    z-index: 999;
    opacity: 0.01; /* Almost invisible but still touchable */
    background-color: rgba(255, 255, 255, 0.1); /* Slightly visible for testing */
    border-radius: 0 0 0 15px;
}

/* Config button style */
.config-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, transform 0.2s;
}

.config-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.config-button:active {
    transform: scale(0.95);
}

/* Ensure the config button doesn't interfere with other elements */
.config-button i {
    pointer-events: none;
}
