/**
 * Flexible WiFi Voice Chat Widget Styles
 */

#voiceWidget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0a1628 0%, #1a2d47 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Header */
.widget-header {
    text-align: center;
    margin-bottom: 20px;
}

.widget-header h3 {
    color: #29C3D3;
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.widget-header p {
    color: #94a3b8;
    margin: 0;
    font-size: 14px;
}

/* Voice Button */
#voiceButton {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #29C3D3 0%, #1a9aa8 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(41, 195, 211, 0.4);
}

#voiceButton:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(41, 195, 211, 0.5);
}

#voiceButton:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#voiceButton.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    animation: pulse 1.5s infinite;
}

#voiceButton.processing {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

#voiceButton.speaking {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Status Text */
#statusText {
    color: #94a3b8;
    text-align: center;
    font-size: 14px;
    margin-bottom: 20px;
    min-height: 20px;
}

/* Error Message */
#errorMessage {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

/* Chat Messages */
#chatMessages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 8px;
}

#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
}

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

.chat-message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #29C3D3 0%, #1a9aa8 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-bubble {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

/* Text Input Section */
#textSection {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    margin-top: 16px;
}

.text-input-container {
    display: flex;
    gap: 8px;
}

#textInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#textInput::placeholder {
    color: #64748b;
}

#textInput:focus {
    border-color: #29C3D3;
}

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #29C3D3;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-button:hover {
    background: #1a9aa8;
    transform: scale(1.05);
}

/* Toggle Text Link */
.toggle-text-link {
    display: block;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-top: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-text-link:hover {
    color: #29C3D3;
}

/* Options */
.widget-options {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.widget-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
}

.widget-options input[type="checkbox"] {
    accent-color: #29C3D3;
}

/* Clear button */
.clear-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #64748b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-button:hover {
    border-color: #29C3D3;
    color: #29C3D3;
}

/* Spinner Animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    #voiceWidget {
        margin: 16px;
        padding: 20px;
    }

    #voiceButton {
        width: 70px;
        height: 70px;
    }
}
