/**
 * Recipe Reader Frontend Styles - Interactive Voice Assistant
 */

/* Read Recipe Button */

.recipe-reader-spinner {
    font-size: 18px;
    line-height: 1;
    animation: spin 1s linear infinite;
}

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

/* Button States */
.recipe-reader-button.loading {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.recipe-reader-button.listening {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.recipe-reader-button.thinking {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.recipe-reader-button.speaking {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.recipe-reader-button.playing {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.recipe-reader-button.ready {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Conversation Panel */
.recipe-reader-conversation-panel {
    margin-top: 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.recipe-reader-panel-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-reader-panel-header strong {
    font-size: 16px;
    font-weight: 700;
}

.recipe-reader-status {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

/* Messages Container */
.recipe-reader-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Message Bubbles */
.recipe-reader-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
}

.recipe-reader-message-user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    margin-left: auto;
    margin-right: 0;
    border-bottom-right-radius: 4px;
}

.recipe-reader-message-assistant {
    background: #e5e7eb;
    color: #1f2937;
    margin-left: 0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* Controls */
.recipe-reader-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.recipe-reader-pause-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    background: #ffffff;
    border: 2px solid #2563eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.recipe-reader-pause-button:hover {
    background: #2563eb;
    color: #ffffff;
}

.recipe-reader-end-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    background: #ffffff;
    border: 2px solid #dc2626;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.recipe-reader-end-button:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Scrollbar Styling */
.recipe-reader-messages::-webkit-scrollbar {
    width: 8px;
}

.recipe-reader-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.recipe-reader-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.recipe-reader-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive */
@media (max-width: 640px) {
    .recipe-reader-button {
        font-size: 14px;
        padding: 10px 18px;
    }

    .recipe-reader-icon {
        font-size: 18px;
    }

    .recipe-reader-conversation-panel {
        padding: 15px;
    }

    .recipe-reader-messages {
        max-height: 300px;
        padding: 12px;
    }

    .recipe-reader-message {
        max-width: 90%;
        padding: 10px 14px;
    }

    .recipe-reader-end-button {
        width: 100%;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recipe-reader-message {
    animation: fadeIn 0.3s ease;
}

/* Accessibility */
.recipe-reader-button:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.recipe-reader-end-button:focus {
    outline: 3px solid #dc2626;
    outline-offset: 2px;
}
