/* JC Avatar - Floating AI Assistant Styles */

.jc-avatar-floating {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.jc-avatar-floating.minimized {
    height: 60px;
}

.jc-avatar-floating.minimized .jc-avatar-video-container,
.jc-avatar-floating.minimized .jc-avatar-footer {
    display: none;
}

.jc-avatar-header {
    background: linear-gradient(135deg, #00a0af 0%, #00c0ca 100%);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.jc-avatar-title {
    font-weight: 600;
    font-size: 0.95em;
}

.jc-avatar-controls {
    display: flex;
    gap: 8px;
}

.jc-btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.jc-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.jc-avatar-video-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: #000;
    overflow: hidden;
}

#jc-avatar-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jc-avatar-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 30px;
    border-radius: 10px;
}

.jc-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.jc-avatar-footer {
    padding: 12px 15px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.jc-help-button,
.jc-restart-button {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #00a0af 0%, #00c0ca 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jc-restart-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.jc-help-button:hover,
.jc-restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 160, 175, 0.4);
}

.jc-restart-button:hover {
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

/* Field highlighting when avatar explains */
.jc-explaining {
    animation: pulse 1s ease-in-out;
    border-color: #00a0af !important;
    box-shadow: 0 0 0 3px rgba(0, 160, 175, 0.2) !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .jc-avatar-floating {
        width: 280px;
        bottom: 10px;
        right: 10px;
    }

    .jc-avatar-video-container {
        height: 280px;
    }
}

/* Dragging cursor */
.jc-avatar-floating.dragging {
    cursor: grabbing;
}

/* Speaking indicator */
.jc-avatar-floating.speaking .jc-avatar-header {
    animation: speaking-glow 1.5s ease-in-out infinite;
}

@keyframes speaking-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(0, 160, 175, 0); }
    50% { box-shadow: 0 0 20px rgba(0, 160, 175, 0.5); }
}

/* Audio unlock overlay */
.jc-audio-unlock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(3px);
}

.jc-unmute-button {
    background: linear-gradient(135deg, #00a0af 0%, #00c0ca 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.jc-unmute-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 160, 175, 0.5);
}

/* Reopen JC button (shows when window closed) */
.jc-reopen-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, #00a0af 0%, #00c0ca 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.jc-reopen-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 160, 175, 0.5);
}
