/* Ghost Voice Button Styles */

/* Base Ghost voice button styling */
.ghost-voice-button {
    position: relative;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
}

/* Ghost logo inside button */
.ghost-voice-button .ghost-logo {
    width: 28px !important;
    height: 28px !important;
    filter: invert(1) brightness(2);  /* Invert to white and make bright */
    transition: all 0.3s ease;
    opacity: 1;  /* Full opacity */
}

/* Hover state */
.ghost-voice-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a3a3a 0%, #222 100%);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.ghost-voice-button:hover:not(:disabled) .ghost-logo {
    filter: invert(1) brightness(2.2);  /* Slightly brighter on hover */
    opacity: 1;
}

/* Inactive state */
.ghost-voice-button.mic-inactive {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
}

.ghost-voice-button.mic-inactive .ghost-logo {
    filter: invert(1) brightness(1.8);  /* White ghost even when inactive */
}

/* Activating state - preparing to record */
.ghost-voice-button.mic-activating {
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    animation: ghost-pulse 0.8s ease-in-out infinite;
}

.ghost-voice-button.mic-activating .ghost-logo {
    filter: brightness(1.2);
    animation: ghost-float 1s ease-in-out infinite;
}

/* Recording state - handled by ghost-smoke-animation.css */

/* Logo and ripple effects handled by ghost-smoke-animation.css */

/* Listening state - waiting for response */
.ghost-voice-button.mic-listening {
    background: linear-gradient(135deg, #44ff44 0%, #00cc00 100%);
    border-color: rgba(68, 255, 68, 0.5);
}

.ghost-voice-button.mic-listening .ghost-logo {
    filter: brightness(1.3) hue-rotate(90deg);
    animation: ghost-listen 2s ease-in-out infinite;
}

/* Processing state - processing audio */
.ghost-voice-button.mic-processing {
    background: linear-gradient(135deg, #4488ff 0%, #0066cc 100%);
    border-color: rgba(68, 136, 255, 0.5);
    animation: processing-spin 2s linear infinite;
}

.ghost-voice-button.mic-processing .ghost-logo {
    filter: brightness(1.4) hue-rotate(180deg);
    animation: ghost-process 0.5s ease-in-out infinite alternate;
}

/* Hume EVI specific states */
.ghost-voice-button.hume-connected {
    border-color: rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

.ghost-voice-button.hume-speaking {
    background: linear-gradient(135deg, #8a2be2 0%, #6a1b9a 100%);
    border-color: rgba(138, 43, 226, 0.5);
}

.ghost-voice-button.hume-speaking .ghost-logo {
    filter: brightness(1.5) hue-rotate(270deg);
    animation: ghost-speak 0.3s ease-in-out infinite alternate;
}

/* Animations */
@keyframes ghost-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ghost-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes ghost-glow {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

@keyframes recording-ripple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

@keyframes recording-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 255, 128, 0.3);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 0 30px rgba(0, 255, 128, 0.5);
    }
}

@keyframes ghost-listen {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-5deg); }
    75% { transform: scale(1.05) rotate(5deg); }
}

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

@keyframes ghost-process {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 1; }
}

@keyframes ghost-speak {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.15) translateY(-1px); }
}

/* Status indicator dot */
.ghost-voice-button .status-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    border: 1px solid #333;
}

.ghost-voice-button.hume-connected .status-dot {
    background: #4caf50;
    animation: dot-pulse 2s ease-in-out infinite;
}

.ghost-voice-button.mic-recording .status-dot {
    background: #00ff80;
    animation: dot-pulse 0.5s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Disabled state */
.ghost-voice-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ghost-voice-button:disabled .ghost-logo {
    filter: grayscale(1) brightness(0.5);
}

/* Mobile touch feedback */
@media (hover: none) {
    .ghost-voice-button:active {
        transform: scale(0.95);
    }
}

/* Tooltip for voice status */
.ghost-voice-button::before {
    content: attr(data-status);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ghost-voice-button[data-status]:hover::before {
    opacity: 1;
}