/* Public Assistant Widget (Landing Page) */
.public-assistant-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

/* Minimized Bubble Button - Refined 48px size */
.public-assistant-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 136, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    touch-action: manipulation;
    overflow: visible;
}

.public-assistant-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 136, 255, 0.4);
    border-color: rgba(0, 212, 255, 0.4);
}

.public-assistant-bubble:active {
    transform: scale(0.96);
}

/* Ensure orb is properly centered in bubble */
.public-assistant-bubble .aether-orb {
    width: 44px;
    height: 44px;
}

/* Mascot in bubble - refined with breathing animation */
button.public-assistant-bubble.mascot-mode {
    width: 48px;
    height: 48px;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25) !important;
    overflow: visible !important;
    animation: publicMascotBreathe 4s ease-in-out infinite;
}

@keyframes publicMascotBreathe {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.3));
    }
    50% { 
        transform: scale(1.02);
        filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
    }
}

button.public-assistant-bubble.mascot-mode:hover {
    animation: none;
    transform: scale(1.08);
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.4) !important;
    border: none !important;
    background: transparent !important;
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
}

.public-assistant-bubble .aether-mascot {
    width: 40px;
    height: 40px;
    background: transparent;
}

.public-assistant-bubble .aether-mascot.aether-bubble {
    width: 40px;
    height: 40px;
    background: transparent !important;
}

.public-assistant-bubble .aether-mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Simple mascot image in bubble - refined size */
.public-assistant-bubble .mascot-bubble-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.public-assistant-bubble .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #EF4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Expanded Chat Window */
.public-assistant-window {
    display: none;
    flex-direction: column;
    width: 380px;
    height: 550px;
    background-color: #1F2937;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.public-assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #1F2937, #111827);
    border-bottom: 1px solid #374151;
}

.public-assistant-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Styling for the small orb in header */
.public-assistant-header-left .aether-orb-small {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.public-assistant-header-left span {
    font-weight: 600;
    color: #00ffff;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.badge-public {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3) 0%, rgba(0, 136, 255, 0.3) 100%);
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: #00ffff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.public-assistant-actions {
    display: flex;
    gap: 8px;
}

.public-assistant-actions button {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
    touch-action: manipulation; /* Eliminate 300ms delay on mobile Safari */
}

.public-assistant-actions button:hover {
    color: white;
}

/* Messages Area */
.public-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #111827;
}

.public-assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.public-assistant-messages::-webkit-scrollbar-track {
    background: #1F2937;
}

.public-assistant-messages::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 3px;
}

.public-assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Welcome Message */
.public-welcome-message {
    text-align: center;
    padding: 20px;
    color: white;
}

.welcome-icon {
    font-size: 48px;
    color: #10B981;
    margin-bottom: 16px;
}

.public-welcome-message h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.public-welcome-message p {
    color: #9CA3AF;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* CTA Buttons in Welcome */
.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.cta-btn {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cta-btn.primary {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
}

.cta-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.cta-btn.secondary {
    background: transparent;
    color: white;
    border: 1px solid #374151;
}

.cta-btn.secondary:hover {
    border-color: #10B981;
    color: #10B981;
}

/* Suggested Prompts */
.suggested-prompts-container {
    margin-top: 16px;
}

.prompts-label {
    color: #9CA3AF;
    font-size: 14px;
    margin-bottom: 10px;
}

.suggested-prompt {
    display: block;
    width: 100%;
    background: #1F2937;
    color: #E5E7EB;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.suggested-prompt:hover {
    background: #374151;
    border-color: #10B981;
    color: white;
}

/* Messages */
.public-message {
    margin-bottom: 16px;
}

.message-content {
    display: flex;
    gap: 12px;
}

.user-content {
    justify-content: flex-end;
}

.user-content p {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    max-width: 80%;
    word-wrap: break-word;
}

.assistant-content {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.assistant-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #10B981, #3B82F6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assistant-avatar i {
    color: white;
    font-size: 16px;
}

.assistant-text {
    flex: 1;
}

.assistant-text p {
    background: #1F2937;
    color: #E5E7EB;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.6;
}

.assistant-text strong {
    color: #10B981;
}

/* Signup Nudge */
.signup-nudge {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid #10B981;
    border-radius: 12px;
    text-align: center;
}

.nudge-content i {
    color: #10B981;
    font-size: 24px;
    margin-bottom: 8px;
}

.nudge-content p {
    color: #E5E7EB;
    margin-bottom: 12px;
}

.nudge-btn {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nudge-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Input Area */
.public-assistant-input {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #1F2937;
    border-top: 1px solid #374151;
}

.public-assistant-input textarea {
    flex: 1;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.public-assistant-input textarea:focus {
    border-color: #10B981;
}

.public-assistant-input textarea::placeholder {
    color: #6B7280;
}

.public-assistant-input button {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    touch-action: manipulation; /* Eliminate 300ms delay on mobile Safari */
}

.public-assistant-input button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.public-assistant-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Aether Avatar Images */
.aether-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.welcome-icon .aether-avatar-img {
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.assistant-avatar .aether-avatar-img {
    width: 32px;
    height: 32px;
}

.header-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Ensure avatar images are responsive */
@media (max-width: 768px) {
    .aether-avatar-img {
        width: 40px;
        height: 40px;
    }
    
    .welcome-icon .aether-avatar-img {
        width: 56px;
        height: 56px;
    }
    
    .assistant-avatar .aether-avatar-img {
        width: 28px;
        height: 28px;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .public-assistant-widget {
        position: fixed !important;
        bottom: 16px !important;
        right: 16px !important;
        z-index: 9999 !important;
        transform: none !important;
    }
    
    .public-assistant-window {
        width: calc(100vw - 20px);
        max-width: 100%;
        right: 10px;
        height: 500px;
    }
    
    .public-assistant-bubble {
        width: 44px;
        height: 44px;
    }
    
    .public-assistant-bubble .mascot-bubble-img {
        width: 36px;
        height: 36px;
    }
    
    .public-assistant-bubble i {
        font-size: 18px;
    }
    
    .aether-avatar-img {
        width: 36px;
        height: 36px;
    }
    
    .welcome-icon .aether-avatar-img {
        width: 48px;
        height: 48px;
    }
}

/* Ensure fixed positioning works on all devices */
@media (max-width: 768px) {
    .public-assistant-widget {
        position: fixed !important;
        bottom: 16px !important;
        right: 16px !important;
        z-index: 9999 !important;
    }
}

/* Voice Toggle Button */
.voice-toggle-btn {
    background: transparent;
    border: none;
    color: #a78bfa;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    transition: all 0.2s;
    touch-action: manipulation;
}

.voice-toggle-btn:hover {
    color: #8b5cf6;
    transform: scale(1.1);
}

.voice-toggle-btn i {
    pointer-events: none;
}

/* Voice Controls Panel */
.voice-controls-panel {
    background: #374151;
    border-bottom: 1px solid #4b5563;
    padding: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

.voice-control-group {
    margin-bottom: 16px;
}

.voice-control-group:last-child {
    margin-bottom: 0;
}

.voice-control-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #d1d5db;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.voice-control-group label i {
    margin-right: 8px;
    color: #a78bfa;
}

.voice-control-group label span {
    color: #60a5fa;
    font-family: monospace;
    font-weight: 600;
}

.voice-control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #4b5563;
    outline: none;
    -webkit-appearance: none;
}

.voice-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    cursor: pointer;
    transition: all 0.2s;
}

.voice-control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

.voice-control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.voice-control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

.voice-mute-toggle {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border: 1px solid #6b7280;
    border-radius: 8px;
    color: #d1d5db;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.voice-mute-toggle:hover {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    border-color: #9ca3af;
}

.voice-mute-toggle.muted {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #b91c1c;
}

.voice-mute-toggle.muted i {
    color: #fee2e2;
}

.voice-mute-toggle i {
    color: #a78bfa;
    transition: all 0.2s;
}

